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

Function cl_assert_object_info

t/unit-tests/u-odb-inmemory.c:17–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15static struct object_database *odb;
16
17static void cl_assert_object_info(struct odb_source_inmemory *source,
18 const struct object_id *oid,
19 enum object_type expected_type,
20 const char *expected_content)
21{
22 enum object_type actual_type;
23 size_t actual_size;
24 void *actual_content;
25 struct object_info oi = {
26 .typep = &actual_type,
27 .sizep = &actual_size,
28 .contentp = &actual_content,
29 };
30
31 cl_must_pass(odb_source_read_object_info(&source->base, oid, &oi, 0));
32 cl_assert_equal_u(actual_size, strlen(expected_content));
33 cl_assert_equal_u(actual_type, expected_type);
34 cl_assert_equal_s((char *) actual_content, expected_content);
35
36 free(actual_content);
37}
38
39void test_odb_inmemory__initialize(void)
40{

Calls 1