aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2024-03-03 11:13:26 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-03 09:47:33 -0800
commit752cb6ef816c8b2b37e38e418bd11698c00027e4 (patch)
treef4728cfdbbad2c3537842d97e4a1ffaa188061a1 /t/unit-tests
parent980013e90dd12ec1ff9eec23cebb0c845f198dab (diff)
downloadgit-752cb6ef816c8b2b37e38e418bd11698c00027e4.tar.gz
t-ctype: simplify EOF check
EOF is not a member of any character class. If a classifier function returns a non-zero result for it, presumably by mistake, then the unit test check reports: # check "!iseof(EOF)" failed at t/unit-tests/t-ctype.c:53 # i: 0xffffffff (EOF) The numeric value of EOF is not particularly interesting in this context. Stop printing the second line. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
-rw-r--r--t/unit-tests/t-ctype.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/t/unit-tests/t-ctype.c b/t/unit-tests/t-ctype.c
index 35473c41d8..f0d61d6eb2 100644
--- a/t/unit-tests/t-ctype.c
+++ b/t/unit-tests/t-ctype.c
@@ -10,8 +10,7 @@ static void test_ctype_##func(void) { \
if (!check_int(func(i), ==, !!memchr(string, i, len))) \
test_msg(" i: 0x%02x", i); \
} \
- if (!check(!func(EOF))) \
- test_msg(" i: 0x%02x (EOF)", EOF); \
+ check(!func(EOF)); \
}
#define TEST_CHAR_CLASS(class) TEST(test_ctype_##class(), #class " works")