38 #include <gtest/gtest.h> 43 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
44 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf,
48 TEST(CircleBufTest, BasicReadWriteNoOverflow)
69 TEST(CircleBufTest, SingleWriteOverflow)
82 TEST(CircleBufTest, MultiWriteOverflow)
97 TEST(CircleBufTest, PointerWrapAround)
111 buf.
read(foo + 4, 6);
115 buf.
read(foo + 10, 2);
std::true_type foo(void(*)(ThreadContext *, const Ret &ret, State &state))
void peek(OutputIterator out, size_t len) const
Copy buffer contents without advancing the read pointer.
TEST(CircleBufTest, BasicReadWriteNoOverflow)
void write(InputIterator in, size_t len)
Add elements to the end of the ring buffers and advance.
void read(OutputIterator out, size_t len)
Copy buffer contents and advance the read pointer.
#define EXPECT_EQ(lhs, rhs)
A macro which verifies that lhs and rhs are equal to each other.