]> git.ipfire.org Git - thirdparty/git.git/commit
t/unit-tests: convert oidtree test to use clar test framework
authorSeyi Kuforiji <kuforiji98@gmail.com>
Tue, 25 Feb 2025 10:10:44 +0000 (11:10 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Feb 2025 18:31:23 +0000 (10:31 -0800)
commit149585079facfbdb5713bb8852caea2068cd4f28
treed196c139c2df4c541d51f5246e140de74916151d
parent69bc044def16e8d8f85cd321b00ae53abe96a567
t/unit-tests: convert oidtree test to use clar test framework

Adapt oidtree test script to clar framework by using clar assertions
where necessary. `cl_parse_any_oid()` ensures the hash algorithm is set
before parsing. This prevents issues from an uninitialized or invalid
hash algorithm.

Introduce 'test_oidtree__initialize` handles the to set up of the global
oidtree variable and `test_oidtree__cleanup` frees the oidtree when all
tests are completed.

With this change, `check_each` stops at the first error encountered,
making it easier to address it.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/meson.build
t/unit-tests/t-oidtree.c [deleted file]
t/unit-tests/u-oidtree.c [new file with mode: 0644]