]> git.ipfire.org Git - thirdparty/git.git/commit
unit-tests: rewrite t/helper/test-ctype.c as a unit test
authorAchu Luma <ach.lumap@gmail.com>
Fri, 12 Jan 2024 10:27:43 +0000 (11:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jan 2024 15:37:47 +0000 (07:37 -0800)
commite875d4511c34eed952f1123401a1727b4bd583fa
tree57051d9a85645656e574a515e86b6ded992dad84
parent055bb6e9969085777b7fab83e3fee0017654f134
unit-tests: rewrite t/helper/test-ctype.c as a unit test

In the recent codebase update (8bf6fbd00d (Merge branch
'js/doc-unit-tests', 2023-12-09)), a new unit testing framework was
merged, providing a standardized approach for testing C code. Prior to
this update, some unit tests relied on the test helper mechanism,
lacking a dedicated unit testing framework. It's more natural to perform
these unit tests using the new unit test framework.

This commit migrates the unit tests for C character classification
functions (isdigit(), isspace(), etc) from the legacy approach
using the test-tool command `test-tool ctype` in t/helper/test-ctype.c
to the new unit testing framework (t/unit-tests/test-lib.h).

The migration involves refactoring the tests to utilize the testing
macros provided by the framework (TEST() and check_*()).

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Helped-by: René Scharfe <l.s.r@web.de>
Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Achu Luma <ach.lumap@gmail.com>
Acked-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/helper/test-ctype.c [deleted file]
t/helper/test-tool.c
t/helper/test-tool.h
t/t0070-fundamental.sh
t/unit-tests/t-ctype.c [new file with mode: 0644]