gem5 v24.0.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. | |
TEST (CircularQueueTest, HeadTailEmpty) | |
Testing that once instantiated with a fixed size, the queue has Head = Tail + 1. | |
TEST (CircularQueueTest, AddingElements) | |
Adding elements to the circular queue. | |
TEST (CircularQueueTest, RemovingElements) | |
Removing elements from the circular queue. | |
TEST (CircularQueueTest, Full) | |
Testing CircularQueue::full This tests adds elements to the queue and checks that it is full, which means: | |
TEST (CircularQueueTest, BeginEnd) | |
Testing CircularQueue::begin(), CircularQueue::end() This tests the following: | |
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()) | |
TEST (CircularQueueTest, IteratorsOp) | |
Testing circular queue iterators: By allocating two iterators to a queue we test several operators. | |
TEST (CircularQueueTest, FullLoop) | |
Testing a full loop, which is incrementing one iterator until it wraps and has the same index as the starting iterator. | |
TEST (CircularQueueTest, MultipleRound) | |
Testing correct behaviour when rounding multiple times: | |
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 71 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::back(), gem5::CircularQueue< T >::front(), gem5::CircularQueue< T >::push_back(), and gem5::CircularQueue< T >::size().
TEST | ( | CircularQueueTest | , |
BeginEnd | ) |
Testing CircularQueue::begin(), CircularQueue::end() This tests the following:
Definition at line 149 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::begin(), gem5::CircularQueue< T >::end(), and gem5::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 172 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::back(), gem5::CircularQueue< T >::begin(), gem5::CircularQueue< T >::end(), gem5::CircularQueue< T >::front(), and gem5::CircularQueue< T >::push_back().
TEST | ( | CircularQueueTest | , |
Empty | ) |
Testing that once instantiated with a fixed size, the queue is still empty.
Definition at line 46 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::capacity(), gem5::CircularQueue< T >::empty(), and gem5::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 129 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::full(), gem5::CircularQueue< T >::head(), gem5::CircularQueue< T >::push_back(), and gem5::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 232 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::begin().
TEST | ( | CircularQueueTest | , |
HeadTailEmpty | ) |
Testing that once instantiated with a fixed size, the queue has Head = Tail + 1.
Definition at line 58 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::head(), and gem5::CircularQueue< T >::tail().
TEST | ( | CircularQueueTest | , |
IteratorsOp | ) |
Testing circular queue iterators: By allocating two iterators to a queue we test several operators.
Definition at line 191 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::begin(), and gem5::CircularQueue< T >::push_back().
TEST | ( | CircularQueueTest | , |
MultipleRound | ) |
Testing correct behaviour when rounding multiple times:
Definition at line 252 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::begin(), gem5::CircularQueue< T >::end(), and gem5::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 94 of file circular_queue.test.cc.
References gem5::CircularQueue< T >::empty(), gem5::CircularQueue< T >::head(), gem5::CircularQueue< T >::pop_front(), gem5::CircularQueue< T >::push_back(), gem5::CircularQueue< T >::size(), and gem5::CircularQueue< T >::tail().