Skip to content

Commit 5a24c0b

Browse files
coverage
1 parent 96ac7b5 commit 5a24c0b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/src/test_fragment.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ void test_udpard_fragment_gather()
247247
TEST_ASSERT_EQUAL_MEMORY("ABCDEMIDWXYZ", buf, 12);
248248
TEST_ASSERT_EQUAL_PTR(right, cursor);
249249

250+
// Gather starting exactly at the end of the current cursor fragment.
251+
(void)std::memset(static_cast<void*>(buf), 0, sizeof(buf));
252+
cursor = left;
253+
TEST_ASSERT_EQUAL_size_t(7, udpard_fragment_gather(&cursor, 5, 7, static_cast<void*>(buf)));
254+
TEST_ASSERT_EQUAL_MEMORY("MIDWXYZ", buf, 7);
255+
TEST_ASSERT_EQUAL_PTR(right, cursor);
256+
250257
// Test 7: Truncation with multiple fragments - buffer smaller than total.
251258
(void)std::memset(static_cast<void*>(buf), 0, sizeof(buf));
252259
cursor = root;

0 commit comments

Comments
 (0)