t-ctype: use if_test

Use the documented macro if_test instead of the internal functions test__run_begin() and test__run_end(), which are supposed to be private to the unit test framework. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Jul 30, 2024 at 16:10 UTC e51d7ef9405e45bbc744e688b232d311034ef01d
1 file changed +1 -3
t/unit-tests/t-ctype.c
+1 -3
@@ -4,15 +4,13 @@
4 size_t len = ARRAY_SIZE(string) - 1 + \
5 BUILD_ASSERT_OR_ZERO(ARRAY_SIZE(string) > 0) + \
6 BUILD_ASSERT_OR_ZERO(sizeof(string[0]) == sizeof(char)); \
7 - int skip = test__run_begin(); \
8 - if (!skip) { \
7 + if_test (#class " works") { \
8 for (int i = 0; i < 256; i++) { \
9 if (!check_int(class(i), ==, !!memchr(string, i, len)))\
10 test_msg(" i: 0x%02x", i); \
11 } \
12 check(!class(EOF)); \
13 } \
15 - test__run_end(!skip, TEST_LOCATION(), #class " works"); \
14 } while (0)
15
16 #define DIGIT "0123456789"