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

Function test_oidmap__remove

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

Source from the content-addressed store, hash-verified

84}
85
86void test_oidmap__remove(void)
87{
88 struct test_entry *entry;
89 struct object_id oid;
90
91 cl_parse_any_oid("11", &oid);
92 entry = oidmap_remove(&map, &oid);
93 cl_assert(entry != NULL);
94 cl_assert_equal_s(entry->name, "one");
95 cl_assert(oidmap_get(&map, &oid) == NULL);
96 free(entry);
97
98 cl_parse_any_oid("22", &oid);
99 entry = oidmap_remove(&map, &oid);
100 cl_assert(entry != NULL);
101 cl_assert_equal_s(entry->name, "two");
102 cl_assert(oidmap_get(&map, &oid) == NULL);
103 free(entry);
104
105 cl_parse_any_oid("44", &oid);
106 cl_assert(oidmap_remove(&map, &oid) == NULL);
107}
108
109static int key_val_contains(struct test_entry *entry, char seen[])
110{

Callers

nothing calls this directly

Calls 3

cl_parse_any_oidFunction · 0.85
oidmap_removeFunction · 0.85
oidmap_getFunction · 0.85

Tested by

no test coverage detected