aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2024-07-30 16:10:09 +0200
committerJunio C Hamano <gitster@pobox.com>2024-07-30 13:32:43 -0700
commite51d7ef9405e45bbc744e688b232d311034ef01d (patch)
tree0adb9e68b4708a21824fd949fae0b97a266d12c9
parentunit-tests: add if_test (diff)
downloadgit-e51d7ef9405e45bbc744e688b232d311034ef01d.tar.gz
git-e51d7ef9405e45bbc744e688b232d311034ef01d.zip
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>
-rw-r--r--t/unit-tests/t-ctype.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/t/unit-tests/t-ctype.c b/t/unit-tests/t-ctype.c
index d6ac1fe678..e28a7f50f9 100644
--- a/t/unit-tests/t-ctype.c
+++ b/t/unit-tests/t-ctype.c
@@ -4,15 +4,13 @@
size_t len = ARRAY_SIZE(string) - 1 + \
BUILD_ASSERT_OR_ZERO(ARRAY_SIZE(string) > 0) + \
BUILD_ASSERT_OR_ZERO(sizeof(string[0]) == sizeof(char)); \
- int skip = test__run_begin(); \
- if (!skip) { \
+ if_test (#class " works") { \
for (int i = 0; i < 256; i++) { \
if (!check_int(class(i), ==, !!memchr(string, i, len)))\
test_msg(" i: 0x%02x", i); \
} \
check(!class(EOF)); \
} \
- test__run_end(!skip, TEST_LOCATION(), #class " works"); \
} while (0)
#define DIGIT "0123456789"