Skip to content

Commit

Permalink
update evic policy to add more test cases with different capacity.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyatgithub committed Nov 3, 2022
1 parent 5d39615 commit 250a1ba
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions eviction/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@ int main() {
vector<int> jobList = {1,2,3,4,5,6,7,1,2,3,4,5,6,7};
// test 1, FIFO
SwapManager FIFO = SwapManager(5, "FIFO");
SwapManager FILO = SwapManager(5, "FILO");
std::cout << "Testing FIFO with cap = 5" << std::endl;
for( int job: jobList) {
FIFO.get(job);
}

SwapManager FILO = SwapManager(5, "FILO");
std::cout << "Testing FILO with cap = 5" << std::endl;
for( int job: jobList) {
FILO.get(job);
}

std::cout << "Hello, World!" << std::endl;
// std::cout << "Change capacity to 7!" << std::endl;

std::cout << "Testing FIFO with cap = 7" << std::endl;
FIFO.setCapacity(7);
for( int job: jobList) {
FIFO.get(job);
}

std::cout << "Testing FILO with cap = 7" << std::endl;
FILO.setCapacity(7);
for( int job: jobList) {
FILO.get(job);
}
return 0;
}

0 comments on commit 250a1ba

Please sign in to comment.