Skip to content

Commit 40c80ea

Browse files
Chandra Pratapgitster
authored andcommitted
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 <[email protected]> Mentored-by: Christian Couder <[email protected]> Signed-off-by: Chandra Pratap <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 84958ec commit 40c80ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/unit-tests/t-reftable-merged.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static void t_merged_single_record(void)
158158

159159
err = reftable_iterator_next_ref(&it, &ref);
160160
check(!err);
161-
check_int(ref.update_index, ==, 2);
161+
check(reftable_ref_record_equal(&r2[0], &ref, GIT_SHA1_RAWSZ));
162162
reftable_ref_record_release(&ref);
163163
reftable_iterator_destroy(&it);
164164
readers_destroy(readers, 3);

0 commit comments

Comments
 (0)