t: move reftable/record_test.c to the unit testing framework
commitba9661b457effa34b6f6188e10546d00e4a49d54
authorChandra Pratap <chandrapratap3519@gmail.com>
Tue, 2 Jul 2024 07:22:14 +0000 (2 12:52 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Jul 2024 15:12:24 +0000 (2 08:12 -0700)
tree6d5907ba1fce3603efa22c09ab2a98583b5e2dd1
parentd63586cb314731c851f28e14fc8012988467e2da
t: move reftable/record_test.c to the unit testing framework

reftable/record_test.c exercises the functions defined in
reftable/record.{c, h}. Migrate reftable/record_test.c to the
unit testing framework. Migration involves refactoring the tests
to use the unit testing framework instead of reftable's test
framework, and renaming the tests to fit unit-tests' naming scheme.

While at it, change the type of index variable 'i' to 'size_t'
from 'int'. This is because 'i' is used in comparison against
'ARRAY_SIZE(x)' which is of type 'size_t'.

Also, use set_hash() which is defined locally in the test file
instead of set_test_hash() which is defined by
reftable/test_framework.{c, h}. This is fine to do as both these
functions are similarly implemented, and
reftable/test_framework.{c, h} is not #included in the ported test.

Get rid of reftable_record_print() from the tests as well, because
it clutters the test framework's output and we have no way of
verifying the output.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
Acked-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/helper/test-reftable.c
t/unit-tests/t-reftable-record.c [moved from reftable/record_test.c with 72% similarity]