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

Function check_each

t/unit-tests/u-oidtree.c:55–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55LAST_ARG_MUST_BE_NULL
56static void check_each(struct oidtree *ot, const char *query, ...)
57{
58 struct object_id oid;
59 struct expected_hex_iter hex_iter = { .expected_hexes = STRVEC_INIT,
60 .query = query };
61 const char *arg;
62 va_list hex_args;
63
64 va_start(hex_args, query);
65 while ((arg = va_arg(hex_args, const char *)))
66 strvec_push(&hex_iter.expected_hexes, arg);
67 va_end(hex_args);
68
69 cl_parse_any_oid(query, &oid);
70 oidtree_each(ot, &oid, strlen(query), check_each_cb, &hex_iter);
71
72 if (hex_iter.i != hex_iter.expected_hexes.nr)
73 cl_failf("error: could not find some 'object_id's for query ('%s')", query);
74
75 strvec_clear(&hex_iter.expected_hexes);
76}
77
78void test_oidtree__initialize(void)
79{

Callers 1

test_oidtree__eachFunction · 0.85

Calls 4

strvec_pushFunction · 0.85
cl_parse_any_oidFunction · 0.85
oidtree_eachFunction · 0.85
strvec_clearFunction · 0.85

Tested by 1

test_oidtree__eachFunction · 0.68