Skip to content

Commit 1052280

Browse files
Chandra Pratapgitster
authored andcommitted
t-reftable-stack: use reftable_ref_record_equal() to compare ref records
In the current stack tests, ref records are compared for equality by sometimes using the dedicated function for ref-record comparison, reftable_ref_record_equal(), and sometimes by explicity comparing contents of the ref records. The latter method is undesired because there can exist unequal ref records with some of the contents being equal. Replace the latter instances of ref-record comparison with the former. This has the added benefit of preserving uniformity throughout the test file. 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 476abc3 commit 1052280

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static void t_reftable_stack_add_one(void)
174174

175175
err = reftable_stack_read_ref(st, ref.refname, &dest);
176176
check(!err);
177-
check_str("master", dest.value.symref);
177+
check(reftable_ref_record_equal(&ref, &dest, GIT_SHA1_RAWSZ));
178178
check_int(st->readers_len, >, 0);
179179

180180
#ifndef GIT_WINDOWS_NATIVE
@@ -285,7 +285,7 @@ static void t_reftable_stack_transaction_api(void)
285285
err = reftable_stack_read_ref(st, ref.refname, &dest);
286286
check(!err);
287287
check_int(REFTABLE_REF_SYMREF, ==, dest.value_type);
288-
check_str("master", dest.value.symref);
288+
check(reftable_ref_record_equal(&ref, &dest, GIT_SHA1_RAWSZ));
289289

290290
reftable_ref_record_release(&dest);
291291
reftable_stack_destroy(st);

0 commit comments

Comments
 (0)