TEST(CircularBuffer, SimplePushFrontPop)
{
    CircularBuffer<int, 5> cb;

    cb.pushFront(123);
    
    ASSERT_FALSE(cb.empty());
    ASSERT_EQ(cb.size(), 1);
    ASSERT_EQ(cb.popFront(), 123);
    ASSERT_TRUE(cb.empty());
    ASSERT_EQ(cb.size(), 0);    
}
TEST(CircularBuffer, SimplePushFrontFull)
{
    CircularBuffer<int, 5> cb;

    cb.pushFront(0);
    cb.pushFront(1);
    cb.pushFront(2);
    cb.pushFront(3);
    cb.pushFront(4);

    ASSERT_FALSE(cb.empty());
    ASSERT_EQ(cb.size(), 5);

    ASSERT_EQ(cb.popFront(), 4);
    ASSERT_EQ(cb.popFront(), 3);
    ASSERT_EQ(cb.popFront(), 2);
    ASSERT_EQ(cb.popFront(), 1);
    ASSERT_EQ(cb.popFront(), 0);

    ASSERT_TRUE(cb.empty());
    ASSERT_EQ(cb.size(), 0);
}
TEST(CircularBuffer, OverlapPushFrontPop)
{
    CircularBuffer<int, 5> cb;

    cb.pushFront(0);
    cb.pushFront(1);
    cb.pushFront(2);
    cb.pushFront(3);

    ASSERT_FALSE(cb.empty());
    ASSERT_EQ(cb.size(), 4);

    ASSERT_EQ(cb.popFront(), 3);
    ASSERT_EQ(cb.popFront(), 2);
    ASSERT_EQ(cb.popFront(), 1);
    ASSERT_EQ(cb.popFront(), 0);

    ASSERT_TRUE(cb.empty());
    ASSERT_EQ(cb.size(), 0);

    cb.pushFront(0);
    cb.pushFront(1);
    cb.pushFront(2);
    cb.pushFront(3);

    ASSERT_FALSE(cb.empty());
    ASSERT_EQ(cb.size(), 4);

    ASSERT_EQ(cb.popFront(), 3);
    ASSERT_EQ(cb.popFront(), 2);
    ASSERT_EQ(cb.popFront(), 1);
    ASSERT_EQ(cb.popFront(), 0);

    ASSERT_TRUE(cb.empty());
    ASSERT_EQ(cb.size(), 0);
}