MCPcopy Index your code
hub / github.com/git/git / t_lookup

Function t_lookup

t/unit-tests/u-oid-array.c:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 t_enumeration(input, ARRAY_SIZE(input), expect, ARRAY_SIZE(expect));
50
51static void t_lookup(const char **input_hexes, size_t n, const char *query_hex,
52 int lower_bound, int upper_bound)
53{
54 struct oid_array array = OID_ARRAY_INIT;
55 struct object_id oid_query;
56 int ret;
57
58 cl_parse_any_oid(query_hex, &oid_query);
59 fill_array(&array, input_hexes, n);
60 ret = oid_array_lookup(&array, &oid_query);
61
62 cl_assert(ret <= upper_bound);
63 cl_assert(ret >= lower_bound);
64
65 oid_array_clear(&array);
66}
67
68#define TEST_LOOKUP(input_hexes, query, lower_bound, upper_bound) \
69 t_lookup(input_hexes, ARRAY_SIZE(input_hexes), query, \

Callers

nothing calls this directly

Calls 4

cl_parse_any_oidFunction · 0.85
fill_arrayFunction · 0.85
oid_array_lookupFunction · 0.85
oid_array_clearFunction · 0.85

Tested by

no test coverage detected