Skip to content

Commit 752cb6e

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 980013e commit 752cb6e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

t/unit-tests/t-ctype.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ static void test_ctype_##func(void) { \
1010
if (!check_int(func(i), ==, !!memchr(string, i, len))) \
1111
test_msg(" i: 0x%02x", i); \
1212
} \
13-
if (!check(!func(EOF))) \
14-
test_msg(" i: 0x%02x (EOF)", EOF); \
13+
check(!func(EOF)); \
1514
}
1615

1716
#define TEST_CHAR_CLASS(class) TEST(test_ctype_##class(), #class " works")

0 commit comments

Comments
 (0)