src/base/circular_queue.test.cc
/**
 * Testing correct behaviour when rounding multiple times:
 * - Round indexes in sync
 * - Difference between begin() and end() iterator is still
 * equal to the CircularQueue size.
 */
Testing correct behaviour when rounding multiple times:
- Round indexes in sync
- Difference between begin() and end() iterator is still
equal to the CircularQueue size.
Testing correct behaviour when rounding multiple times : - Round indexes in sync - Difference between begin () and end () iterator is still equal to the CircularQueue size .
TEST(CircularQueueTest, MultipleRound)
{
    const auto cq_size = 8;
    CircularQueue<uint32_t> cq(cq_size);
    auto items_added = cq_size * 3;
    for (auto idx = 0; idx < items_added; idx++) {
        cq.push_back(0);
    }
    auto starting_it = cq.begin();
    auto ending_it = cq.end();
    ASSERT_EQ(ending_it - starting_it, cq_size);
}
TEST ( CircularQueueTest , MultipleRound ) { const auto cq_size = 8 ; CircularQueue < uint32_t > cq ( cq_size ) ; auto items_added = cq_size * 3 ; for ( auto idx = 0 ; idx < items_added ; idx ++ ) { cq . push_back ( 0 ) ; } auto starting_it = cq . begin ( ) ; auto ending_it = cq . end ( ) ; ASSERT_EQ ( ending_it - starting_it , cq_size ) ; }
Testing correct behaviour when rounding multiple times:
 - Round indexes in sync
 - Difference between begin() and end() iterator is still
 equal to the CircularQueue size.
Testing correct behaviour when rounding multiple times : - Round indexes in sync - Difference between begin () and end () iterator is still equal to the CircularQueue size .
// Filling the queue making it round multiple times