Skip to content

Commit 09ca347

Browse files
Chandra Pratapgitster
authored andcommitted
t-reftable-record: add log tests for reftable_record_is_deletion()
reftable_record_is_deletion() is a function defined in reftable/record.{c, h} that determines whether a record is of type deletion or not. In the current testing setup, this function is left untested for three of the four record types (log, obj, index). Add tests for this function in the case of log records. Mentored-by: Patrick Steinhardt <[email protected]> Mentored-by: Christian Couder <[email protected]> Signed-off-by: Chandra Pratap <[email protected]> Acked-by: Karthik Nayak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aa3fef4 commit 09ca347

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ static void t_reftable_log_record_roundtrip(void)
220220
set_hash(in[2].value.update.new_hash, 3);
221221
set_hash(in[2].value.update.old_hash, 4);
222222

223+
check(!reftable_log_record_is_deletion(&in[0]));
224+
check(reftable_log_record_is_deletion(&in[1]));
225+
check(!reftable_log_record_is_deletion(&in[2]));
226+
223227
for (size_t i = 0; i < ARRAY_SIZE(in); i++) {
224228
struct reftable_record rec = { .type = BLOCK_TYPE_LOG };
225229
struct strbuf key = STRBUF_INIT;

0 commit comments

Comments
 (0)