Lines Matching refs:rb

9   ringbuffer_t *rb = ringbuffer_init(4096);  in TEST()  local
10 ASSERT_TRUE(rb != NULL); in TEST()
11 EXPECT_EQ((size_t)4096, ringbuffer_available(rb)); in TEST()
12 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
13 ringbuffer_free(rb); in TEST()
17 ringbuffer_t *rb = ringbuffer_init(16); in TEST() local
20 ringbuffer_insert(rb, buffer, 10); in TEST()
21 EXPECT_EQ((size_t)10, ringbuffer_size(rb)); in TEST()
22 EXPECT_EQ((size_t)6, ringbuffer_available(rb)); in TEST()
25 size_t peeked = ringbuffer_peek(rb, 0, peek, 10); in TEST()
26 EXPECT_EQ((size_t)10, ringbuffer_size(rb)); // Ensure size doesn't change in TEST()
27 EXPECT_EQ((size_t)6, ringbuffer_available(rb)); in TEST()
31 ringbuffer_free(rb); in TEST()
35 ringbuffer_t *rb = ringbuffer_init(5); in TEST() local
41 size_t added = ringbuffer_insert(rb, aa, 7); in TEST()
43 EXPECT_EQ((size_t)0, ringbuffer_available(rb)); in TEST()
44 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
46 added = ringbuffer_insert(rb, bb, 5); in TEST()
48 EXPECT_EQ((size_t)0, ringbuffer_available(rb)); in TEST()
49 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
51 size_t peeked = ringbuffer_peek(rb, 0, peek, 5); in TEST()
53 EXPECT_EQ((size_t)0, ringbuffer_available(rb)); in TEST()
54 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
58 ringbuffer_free(rb); in TEST()
62 ringbuffer_t *rb = ringbuffer_init(16); in TEST() local
63 EXPECT_EQ((size_t)16, ringbuffer_available(rb)); in TEST()
64 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
69 size_t added = ringbuffer_insert(rb, aa, sizeof(aa)); in TEST()
71 EXPECT_EQ((size_t)8, ringbuffer_available(rb)); in TEST()
72 EXPECT_EQ((size_t)8, ringbuffer_size(rb)); in TEST()
75 ringbuffer_insert(rb, bb, sizeof(bb)); in TEST()
76 EXPECT_EQ((size_t)3, ringbuffer_available(rb)); in TEST()
77 EXPECT_EQ((size_t)13, ringbuffer_size(rb)); in TEST()
81 size_t peeked = ringbuffer_peek(rb, 0, peek, 16); in TEST()
87 ringbuffer_delete(rb, sizeof(aa)); in TEST()
88 EXPECT_EQ((size_t)11, ringbuffer_available(rb)); in TEST()
89 EXPECT_EQ((size_t)5, ringbuffer_size(rb)); in TEST()
94 ringbuffer_insert(rb, cc, sizeof(cc)); in TEST()
95 EXPECT_EQ((size_t)2, ringbuffer_available(rb)); in TEST()
96 EXPECT_EQ((size_t)14, ringbuffer_size(rb)); in TEST()
99 peeked = ringbuffer_peek(rb, 0, peek, 7); in TEST()
106 size_t popped = ringbuffer_pop(rb, peek, 7); in TEST()
108 EXPECT_EQ((size_t)9, ringbuffer_available(rb)); in TEST()
114 added = ringbuffer_insert(rb, dd, sizeof(dd)); in TEST()
116 EXPECT_EQ((size_t)1, ringbuffer_available(rb)); in TEST()
120 ringbuffer_delete(rb, 16); in TEST()
121 EXPECT_EQ((size_t)16, ringbuffer_available(rb)); in TEST()
122 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
127 added = ringbuffer_insert(rb, ae, sizeof(ae)); in TEST()
128 EXPECT_EQ((size_t)13, ringbuffer_available(rb)); in TEST()
132 popped = ringbuffer_pop(rb, peek, 16); in TEST()
134 EXPECT_EQ((size_t)16, ringbuffer_available(rb)); in TEST()
135 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST()
138 ringbuffer_free(rb); in TEST()