| 53 | } |
| 54 | |
| 55 | LAST_ARG_MUST_BE_NULL |
| 56 | static 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 | |
| 78 | void test_oidtree__initialize(void) |
| 79 | { |