Lines Matching refs:rb

6   ringbuffer_t* rb = ringbuffer_init(4096);  in TEST()  local
7 ASSERT_TRUE(rb != nullptr); in TEST()
8 EXPECT_EQ((size_t)4096, ringbuffer_available(rb)); in TEST()
9 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
10 ringbuffer_free(rb); in TEST()
14 ringbuffer_t* rb = ringbuffer_init(16); in TEST() local
18 ringbuffer_insert(rb, buffer, 10); in TEST()
19 EXPECT_EQ((size_t)10, ringbuffer_size(rb)); in TEST()
20 EXPECT_EQ((size_t)6, ringbuffer_available(rb)); in TEST()
23 size_t peeked = ringbuffer_peek(rb, 0, peek, 10); in TEST()
24 EXPECT_EQ((size_t)10, ringbuffer_size(rb)); // Ensure size doesn't change in TEST()
25 EXPECT_EQ((size_t)6, ringbuffer_available(rb)); in TEST()
29 ringbuffer_free(rb); in TEST()
33 ringbuffer_t* rb = ringbuffer_init(5); in TEST() local
39 size_t added = ringbuffer_insert(rb, aa, 7); in TEST()
41 EXPECT_EQ((size_t)0, ringbuffer_available(rb)); in TEST()
42 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
44 added = ringbuffer_insert(rb, bb, 5); in TEST()
46 EXPECT_EQ((size_t)0, ringbuffer_available(rb)); in TEST()
47 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
49 size_t peeked = ringbuffer_peek(rb, 0, peek, 5); in TEST()
51 EXPECT_EQ((size_t)0, ringbuffer_available(rb)); in TEST()
52 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
56 ringbuffer_free(rb); in TEST()
60 ringbuffer_t* rb = ringbuffer_init(16); in TEST() local
61 EXPECT_EQ((size_t)16, ringbuffer_available(rb)); in TEST()
62 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
67 size_t added = ringbuffer_insert(rb, aa, sizeof(aa)); in TEST()
69 EXPECT_EQ((size_t)8, ringbuffer_available(rb)); in TEST()
70 EXPECT_EQ((size_t)8, ringbuffer_size(rb)); in TEST()
73 ringbuffer_insert(rb, bb, sizeof(bb)); in TEST()
74 EXPECT_EQ((size_t)3, ringbuffer_available(rb)); in TEST()
75 EXPECT_EQ((size_t)13, ringbuffer_size(rb)); in TEST()
80 size_t peeked = ringbuffer_peek(rb, 0, peek, 16); in TEST()
86 ringbuffer_delete(rb, sizeof(aa)); in TEST()
87 EXPECT_EQ((size_t)11, ringbuffer_available(rb)); in TEST()
88 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
93 ringbuffer_insert(rb, cc, sizeof(cc)); in TEST()
94 EXPECT_EQ((size_t)2, ringbuffer_available(rb)); in TEST()
95 EXPECT_EQ((size_t)14, ringbuffer_size(rb)); in TEST()
98 peeked = ringbuffer_peek(rb, 0, peek, 7); in TEST()
105 size_t popped = ringbuffer_pop(rb, peek, 7); in TEST()
107 EXPECT_EQ((size_t)9, ringbuffer_available(rb)); in TEST()
113 added = ringbuffer_insert(rb, dd, sizeof(dd)); in TEST()
115 EXPECT_EQ((size_t)1, ringbuffer_available(rb)); in TEST()
119 ringbuffer_delete(rb, 16); in TEST()
120 EXPECT_EQ((size_t)16, ringbuffer_available(rb)); in TEST()
121 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
126 added = ringbuffer_insert(rb, ae, sizeof(ae)); in TEST()
127 EXPECT_EQ((size_t)13, ringbuffer_available(rb)); in TEST()
131 popped = ringbuffer_pop(rb, peek, 16); in TEST()
133 EXPECT_EQ((size_t)16, ringbuffer_available(rb)); in TEST()
134 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
137 ringbuffer_free(rb); in TEST()