MCPcopy Create free account
hub / github.com/git/git / t_trailer_iterator

Function t_trailer_iterator

t/unit-tests/u-trailer.c:12–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10};
11
12static void t_trailer_iterator(const char *msg, size_t num_expected,
13 struct contents *contents)
14{
15 struct trailer_iterator iter;
16 size_t i = 0;
17
18 trailer_iterator_init(&iter, msg);
19 while (trailer_iterator_advance(&iter)) {
20 if (num_expected) {
21 cl_assert_equal_s(iter.raw, contents[i].raw);
22 cl_assert_equal_s(iter.key.buf, contents[i].key);
23 cl_assert_equal_s(iter.val.buf, contents[i].val);
24 }
25 i++;
26 }
27 trailer_iterator_release(&iter);
28
29 cl_assert_equal_i(i, num_expected);
30}
31
32void test_trailer__empty_input(void)
33{

Calls 3

trailer_iterator_initFunction · 0.85
trailer_iterator_advanceFunction · 0.85
trailer_iterator_releaseFunction · 0.85