diff mbox series

[v2,2/4] t-ctype: simplify EOF check

Message ID 20240303101330.20187-3-l.s.r@web.de (mailing list archive)
State New
Headers show
Series t-ctype: simplify unit test definitions | expand

Commit Message

René Scharfe March 3, 2024, 10:13 a.m. UTC
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>
---
 t/unit-tests/t-ctype.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.44.0
diff mbox series

Patch

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