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

Function t_copy

t/unit-tests/u-reftable-record.c:15–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "reftable/record.h"
14
15static void t_copy(struct reftable_record *rec)
16{
17 struct reftable_record copy;
18 uint8_t typ;
19
20 typ = reftable_record_type(rec);
21 cl_assert_equal_i(reftable_record_init(&copy, typ), 0);
22 reftable_record_copy_from(&copy, rec, REFTABLE_HASH_SIZE_SHA1);
23 /* do it twice to catch memory leaks */
24 reftable_record_copy_from(&copy, rec, REFTABLE_HASH_SIZE_SHA1);
25 cl_assert(reftable_record_equal(rec, &copy,
26 REFTABLE_HASH_SIZE_SHA1) != 0);
27
28 reftable_record_release(&copy);
29}
30
31void test_reftable_record__varint_roundtrip(void)
32{

Calls 5

reftable_record_typeFunction · 0.85
reftable_record_initFunction · 0.85
reftable_record_equalFunction · 0.85
reftable_record_releaseFunction · 0.85