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

Function test_oidmap__clear_without_free_callback

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

Source from the content-addressed store, hash-verified

143}
144
145void test_oidmap__clear_without_free_callback(void)
146{
147 struct oidmap local_map = OIDMAP_INIT;
148 struct test_entry *entry;
149
150 freed = 0;
151
152 FLEX_ALLOC_STR(entry, name, "one");
153 cl_parse_any_oid("11", &entry->entry.oid);
154 cl_assert(oidmap_put(&local_map, entry) == NULL);
155
156 oidmap_clear_with_free(&local_map, NULL);
157
158 cl_assert_equal_i(freed, 0);
159
160 free(entry);
161}
162
163void test_oidmap__clear_with_free_callback(void)
164{

Callers

nothing calls this directly

Calls 3

cl_parse_any_oidFunction · 0.85
oidmap_putFunction · 0.85
oidmap_clear_with_freeFunction · 0.85

Tested by

no test coverage detected