Skip to content

Commit f0d7e24

Browse files
committed
test: CircularBuffer: Don't push zero elements
The CircularBuffer doesn't allow pushing zero elements; you must push at least one. Update the CircularBuffer unit test to avoid invalid use of the CircularBuffer.
1 parent 0a944f0 commit f0d7e24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform/tests/UNITTESTS/CircularBuffer/test_CircularBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ TEST_F(TestCircularBuffer, push_pop_multiple)
6969
const int test_numbers[TEST_BUFFER_SIZE] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
7070

7171
/* this will check pushing across the buffer end */
72-
for (int i = 0; i < TEST_BUFFER_SIZE; i++) {
72+
for (int i = 1; i < TEST_BUFFER_SIZE; i++) {
7373
int test_numbers_popped[TEST_BUFFER_SIZE] = { 0 };
7474
buf->push(test_numbers, i);
7575
EXPECT_EQ(buf->size(), i);

0 commit comments

Comments
 (0)