aboutsummaryrefslogtreecommitdiffstats
path: root/reftable/record_test.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-12 13:16:10 -0800
committerJunio C Hamano <gitster@pobox.com>2024-02-12 13:16:10 -0800
commitf424d7c33df373fb8eb4c9dc63ab6dc24de24aa5 (patch)
tree0a4a0ce4fd72be818d68f736c9eb98a42edbe123 /reftable/record_test.c
parentMerge branch 'ps/reftable-multi-level-indices-fix' (diff)
parentreftable/record: improve semantics when initializing records (diff)
downloadgit-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.c8
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(&copy, typ);
reftable_record_copy_from(&copy, rec, GIT_SHA1_RAWSZ);
/* do it twice to catch memory leaks */
reftable_record_copy_from(&copy, 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"),