]> git.ipfire.org Git - thirdparty/git.git/commit
t: move reftable/readwrite_test.c to the unit testing framework
authorChandra Pratap <chandrapratap3519@gmail.com>
Tue, 13 Aug 2024 14:34:47 +0000 (20:04 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Aug 2024 17:08:02 +0000 (10:08 -0700)
commit5b539a53613355a22f5c525eebdd9117fdaedb90
treef495d8297dfaac6a9e873f6abfcabeef73035992
parent406f326d271e0bacecdb00425422c5fa3f314930
t: move reftable/readwrite_test.c to the unit testing framework

reftable/readwrite_test.c exercises the functions defined in
reftable/reader.{c,h} and reftable/writer.{c,h}. Migrate
reftable/readwrite_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
align with unit-tests' naming conventions.

Since some tests in reftable/readwrite_test.c use the functions
set_test_hash(), noop_flush() and strbuf_add_void() defined in
reftable/test_framework.{c,h} but these files are not #included
in the ported unit test, copy these functions in the new test file.

While at it, ensure structs are 0-initialized with '= { 0 }'
instead of '= { NULL }'.

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>
Makefile
reftable/reftable-tests.h
t/helper/test-reftable.c
t/unit-tests/t-reftable-readwrite.c [moved from reftable/readwrite_test.c with 70% similarity]