diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-02-12 13:16:10 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-02-12 13:16:10 -0800 |
| commit | f424d7c33df373fb8eb4c9dc63ab6dc24de24aa5 (patch) | |
| tree | 0a4a0ce4fd72be818d68f736c9eb98a42edbe123 /reftable/record_test.c | |
| parent | Merge branch 'ps/reftable-multi-level-indices-fix' (diff) | |
| parent | reftable/record: improve semantics when initializing records (diff) | |
| download | git-f424d7c33df373fb8eb4c9dc63ab6dc24de24aa5.tar.gz git-f424d7c33df373fb8eb4c9dc63ab6dc24de24aa5.zip | |
Merge branch 'ps/reftable-styles'
Code clean-up in various reftable code paths.
* ps/reftable-styles:
reftable/record: improve semantics when initializing records
reftable/merged: refactor initialization of iterators
reftable/merged: refactor seeking of records
reftable/stack: use `size_t` to track stack length
reftable/stack: use `size_t` to track stack slices during compaction
reftable/stack: index segments with `size_t`
reftable/stack: fix parameter validation when compacting range
reftable: introduce macros to allocate arrays
reftable: introduce macros to grow arrays
Diffstat (limited to 'reftable/record_test.c')
| -rw-r--r-- | reftable/record_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/reftable/record_test.c b/reftable/record_test.c index 2876db7d27..a86cff5526 100644 --- a/reftable/record_test.c +++ b/reftable/record_test.c @@ -16,11 +16,11 @@ static void test_copy(struct reftable_record *rec) { - struct reftable_record copy = { 0 }; + struct reftable_record copy; uint8_t typ; typ = reftable_record_type(rec); - copy = reftable_new_record(typ); + reftable_record_init(©, typ); reftable_record_copy_from(©, rec, GIT_SHA1_RAWSZ); /* do it twice to catch memory leaks */ reftable_record_copy_from(©, rec, GIT_SHA1_RAWSZ); @@ -231,8 +231,8 @@ static void test_reftable_log_record_roundtrip(void) .value_type = REFTABLE_LOG_UPDATE, .value = { .update = { - .new_hash = reftable_calloc(GIT_SHA1_RAWSZ), - .old_hash = reftable_calloc(GIT_SHA1_RAWSZ), + .new_hash = reftable_calloc(GIT_SHA1_RAWSZ, 1), + .old_hash = reftable_calloc(GIT_SHA1_RAWSZ, 1), .name = xstrdup("old name"), .email = xstrdup("old@email"), .message = xstrdup("old message"), |
