gem5
v20.1.0.0
|
Go to the source code of this file.
Functions | |
TEST (CircularQueueTest, Empty) | |
Testing that once instantiated with a fixed size, the queue is still empty. More... | |
TEST (CircularQueueTest, HeadTailEmpty) | |
Testing that once instantiated with a fixed size, the queue has Head = Tail + 1. More... | |
TEST (CircularQueueTest, AddingElements) | |
Adding elements to the circular queue. More... | |
TEST (CircularQueueTest, RemovingElements) | |
Removing elements from the circular queue. More... | |
TEST (CircularQueueTest, Full) | |
Testing CircularQueue::full This tests adds elements to the queue and checks that it is full, which means: More... | |
TEST (CircularQueueTest, BeginEnd) | |
Testing CircularQueue::begin(), CircularQueue::end() This tests the following: More... | |
TEST (CircularQueueTest, BeginFrontEndBack) | |
Testing that begin() and end() (-1) iterators actually point to the correct values so that dereferencing them leads to a match with the values of (front() and back()) More... | |
TEST (CircularQueueTest, IteratorsOp) | |
Testing circular queue iterators: By allocating two iterators to a queue we test several operators. More... | |
TEST (CircularQueueTest, FullLoop) | |
Testing a full loop, which is incrementing one iterator until it wraps and has the same index as the starting iterator. More... | |
TEST (CircularQueueTest, MultipleRound) | |
Testing correct behaviour when rounding multiple times: More... | |
TEST | ( | CircularQueueTest | , |
AddingElements | |||
) |
Adding elements to the circular queue.
Once an element has been added we test the new value of front() and back() (head an tail). Since we are just adding elements and not removing them, we expect the front value to be fixed and the back value to change, matching the latest pushed value.
Definition at line 69 of file circular_queue.test.cc.
References CircularQueue< T >::back(), CircularQueue< T >::front(), CircularQueue< T >::push_back(), and CircularQueue< T >::size().
TEST | ( | CircularQueueTest | , |
BeginEnd | |||
) |
Testing CircularQueue::begin(), CircularQueue::end() This tests the following:
Definition at line 147 of file circular_queue.test.cc.
References CircularQueue< T >::begin(), CircularQueue< T >::end(), and CircularQueue< T >::push_back().
TEST | ( | CircularQueueTest | , |
BeginFrontEndBack | |||
) |
Testing that begin() and end() (-1) iterators actually point to the correct values so that dereferencing them leads to a match with the values of (front() and back())
Definition at line 170 of file circular_queue.test.cc.
References CircularQueue< T >::back(), CircularQueue< T >::begin(), CircularQueue< T >::end(), CircularQueue< T >::front(), and CircularQueue< T >::push_back().
TEST | ( | CircularQueueTest | , |
Empty | |||
) |
Testing that once instantiated with a fixed size, the queue is still empty.
Definition at line 44 of file circular_queue.test.cc.
References CircularQueue< T >::capacity(), CircularQueue< T >::empty(), and CircularQueue< T >::size().
TEST | ( | CircularQueueTest | , |
Full | |||
) |
Testing CircularQueue::full This tests adds elements to the queue and checks that it is full, which means:
Definition at line 127 of file circular_queue.test.cc.
References CircularQueue< T >::full(), CircularQueue< T >::head(), CircularQueue< T >::push_back(), and CircularQueue< T >::tail().
TEST | ( | CircularQueueTest | , |
FullLoop | |||
) |
Testing a full loop, which is incrementing one iterator until it wraps and has the same index as the starting iterator.
This test checks that even if they have the same index, they are not the same iterator since they have different round.
Definition at line 233 of file circular_queue.test.cc.
References CircularQueue< T >::begin().
TEST | ( | CircularQueueTest | , |
HeadTailEmpty | |||
) |
Testing that once instantiated with a fixed size, the queue has Head = Tail + 1.
Definition at line 56 of file circular_queue.test.cc.
References CircularQueue< T >::head(), and CircularQueue< T >::tail().
TEST | ( | CircularQueueTest | , |
IteratorsOp | |||
) |
Testing circular queue iterators: By allocating two iterators to a queue we test several operators.
Definition at line 189 of file circular_queue.test.cc.
References CircularQueue< T >::begin(), and CircularQueue< T >::push_back().
TEST | ( | CircularQueueTest | , |
MultipleRound | |||
) |
Testing correct behaviour when rounding multiple times:
Definition at line 253 of file circular_queue.test.cc.
References CircularQueue< T >::begin(), CircularQueue< T >::end(), and CircularQueue< T >::push_back().
TEST | ( | CircularQueueTest | , |
RemovingElements | |||
) |
Removing elements from the circular queue.
We add two elements and we consequently remove them. After removing them we check that the elements have been effectively removed, which means the circular queue is empty
Definition at line 92 of file circular_queue.test.cc.
References CircularQueue< T >::empty(), CircularQueue< T >::head(), CircularQueue< T >::pop_front(), CircularQueue< T >::push_back(), CircularQueue< T >::size(), and CircularQueue< T >::tail().