summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandra Pratap <chandrapratap3519@gmail.com>2024-07-12 07:39:02 +0200
committerJunio C Hamano <gitster@pobox.com>2024-07-12 18:55:41 +0200
commit40c80eab83f3f7eae4be14cccf756c0a89931b59 (patch)
tree44a4afe15e938cf92d6b32468542c8eee93209a7
parentt-reftable-merged: add tests for reftable_merged_table_max_update_index (diff)
downloadgit-40c80eab83f3f7eae4be14cccf756c0a89931b59.tar.xz
git-40c80eab83f3f7eae4be14cccf756c0a89931b59.zip
t-reftable-merged: use reftable_ref_record_equal to compare ref records
In the test t_merged_single_record() defined in t-reftable-merged.c, the 'input' and 'expected' ref records are checked for equality by comparing their update indices. It is very much possible for two different ref records to have the same update indices. Use reftable_ref_record_equal() instead for a stronger check. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/unit-tests/t-reftable-merged.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/unit-tests/t-reftable-merged.c b/t/unit-tests/t-reftable-merged.c
index 065b359200..9f9275f871 100644
--- a/t/unit-tests/t-reftable-merged.c
+++ b/t/unit-tests/t-reftable-merged.c
@@ -158,7 +158,7 @@ static void t_merged_single_record(void)
err = reftable_iterator_next_ref(&it, &ref);
check(!err);
- check_int(ref.update_index, ==, 2);
+ check(reftable_ref_record_equal(&r2[0], &ref, GIT_SHA1_RAWSZ));
reftable_ref_record_release(&ref);
reftable_iterator_destroy(&it);
readers_destroy(readers, 3);