aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests/t-ctype.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-19 11:07:36 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-19 11:07:36 -0700
commit4dbca805e07de19412807da9dde45bd61f510710 (patch)
treeaeebd2cda1c4573e866de1a72cf6456ed7c46dbd /t/unit-tests/t-ctype.c
parentSync with 'maint' (diff)
parentt-strvec: use if_test (diff)
downloadgit-4dbca805e07de19412807da9dde45bd61f510710.tar.gz
git-4dbca805e07de19412807da9dde45bd61f510710.zip
Merge branch 'rs/unit-tests-test-run'
Unit-test framework has learned a simple control structure to allow embedding test statements in-line instead of having to create a new function to contain them. * rs/unit-tests-test-run: t-strvec: use if_test t-reftable-basics: use if_test t-ctype: use if_test unit-tests: add if_test unit-tests: show location of checks outside of tests t0080: use here-doc test body
Diffstat (limited to 't/unit-tests/t-ctype.c')
-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"