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>
This commit is contained in:
René Scharfe
2024-03-03 11:13:26 +01:00
committed by Junio C Hamano
parent 980013e90d
commit 752cb6ef81

View File

@ -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")