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

Function test_oidmap__iterate

t/unit-tests/u-oidmap.c:126–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void test_oidmap__iterate(void)
127{
128 struct oidmap_iter iter;
129 struct test_entry *entry;
130 char seen[ARRAY_SIZE(key_val)] = { 0 };
131 int count = 0;
132
133 oidmap_iter_init(&map, &iter);
134 while ((entry = oidmap_iter_next(&iter))) {
135 if (key_val_contains(entry, seen) != 0) {
136 cl_failf("Unexpected entry: name = %s, oid = %s",
137 entry->name, oid_to_hex(&entry->entry.oid));
138 }
139 count++;
140 }
141 cl_assert_equal_i(count, ARRAY_SIZE(key_val));
142 cl_assert_equal_i(hashmap_get_size(&map.map), ARRAY_SIZE(key_val));
143}
144
145void test_oidmap__clear_without_free_callback(void)
146{

Callers

nothing calls this directly

Calls 5

oidmap_iter_initFunction · 0.85
oidmap_iter_nextFunction · 0.85
oid_to_hexFunction · 0.85
hashmap_get_sizeFunction · 0.85
key_val_containsFunction · 0.70

Tested by

no test coverage detected