Skip to content

Commit

Permalink
tests/unittests: chunked_ringbuffer: add test for half-written chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Dec 12, 2024
1 parent 982a2c1 commit 50b7467
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ static void test_crb_add_and_consume(void)

crb_init(&cb, buffer, sizeof(buffer));

/* add a chunk but don't finish it */
crb_start_chunk(&cb);
crb_add_byte(&cb, 1);
crb_add_byte(&cb, 2);
crb_add_byte(&cb, 3);

TEST_ASSERT(crb_add_chunk(&cb, "one", 4));
TEST_ASSERT(crb_add_chunk(&cb, "two", 4));
TEST_ASSERT(crb_add_chunk(&cb, "three", 6));
Expand Down

0 comments on commit 50b7467

Please sign in to comment.