Commit ceb528fe authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Willy Tarreau

selftests/nolibc: avoid gaps in test numbers

As the test numbers are based on line numbers gaps without testcases are
to be avoided.
Instead use the already existing test condition logic to implement
conditional execution.
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent b184a261
......@@ -851,23 +851,19 @@ int run_stdlib(int min, int max)
CASE_TEST(limit_int_fast64_min); EXPECT_EQ(1, INT_FAST64_MIN, (int_fast64_t) INT64_MIN); break;
CASE_TEST(limit_int_fast64_max); EXPECT_EQ(1, INT_FAST64_MAX, (int_fast64_t) INT64_MAX); break;
CASE_TEST(limit_uint_fast64_max); EXPECT_EQ(1, UINT_FAST64_MAX, (uint_fast64_t) UINT64_MAX); break;
#if __SIZEOF_LONG__ == 8
CASE_TEST(limit_intptr_min); EXPECT_EQ(1, INTPTR_MIN, (intptr_t) 0x8000000000000000LL); break;
CASE_TEST(limit_intptr_max); EXPECT_EQ(1, INTPTR_MAX, (intptr_t) 0x7fffffffffffffffLL); break;
CASE_TEST(limit_uintptr_max); EXPECT_EQ(1, UINTPTR_MAX, (uintptr_t) 0xffffffffffffffffULL); break;
CASE_TEST(limit_ptrdiff_min); EXPECT_EQ(1, PTRDIFF_MIN, (ptrdiff_t) 0x8000000000000000LL); break;
CASE_TEST(limit_ptrdiff_max); EXPECT_EQ(1, PTRDIFF_MAX, (ptrdiff_t) 0x7fffffffffffffffLL); break;
CASE_TEST(limit_size_max); EXPECT_EQ(1, SIZE_MAX, (size_t) 0xffffffffffffffffULL); break;
#elif __SIZEOF_LONG__ == 4
CASE_TEST(limit_intptr_min); EXPECT_EQ(1, INTPTR_MIN, (intptr_t) 0x80000000); break;
CASE_TEST(limit_intptr_max); EXPECT_EQ(1, INTPTR_MAX, (intptr_t) 0x7fffffff); break;
CASE_TEST(limit_uintptr_max); EXPECT_EQ(1, UINTPTR_MAX, (uintptr_t) 0xffffffffU); break;
CASE_TEST(limit_ptrdiff_min); EXPECT_EQ(1, PTRDIFF_MIN, (ptrdiff_t) 0x80000000); break;
CASE_TEST(limit_ptrdiff_max); EXPECT_EQ(1, PTRDIFF_MAX, (ptrdiff_t) 0x7fffffff); break;
CASE_TEST(limit_size_max); EXPECT_EQ(1, SIZE_MAX, (size_t) 0xffffffffU); break;
#else
# warning "__SIZEOF_LONG__ is undefined"
#endif /* __SIZEOF_LONG__ */
CASE_TEST(sizeof_long_sane); EXPECT_EQ(1, sizeof(long) == 8 || sizeof(long) == 4, 1); break;
CASE_TEST(limit_intptr_min_64); EXPECT_EQ(sizeof(long) == 8, INTPTR_MIN, (intptr_t) 0x8000000000000000LL); break;
CASE_TEST(limit_intptr_max_64); EXPECT_EQ(sizeof(long) == 8, INTPTR_MAX, (intptr_t) 0x7fffffffffffffffLL); break;
CASE_TEST(limit_uintptr_max_64); EXPECT_EQ(sizeof(long) == 8, UINTPTR_MAX, (uintptr_t) 0xffffffffffffffffULL); break;
CASE_TEST(limit_ptrdiff_min_64); EXPECT_EQ(sizeof(long) == 8, PTRDIFF_MIN, (ptrdiff_t) 0x8000000000000000LL); break;
CASE_TEST(limit_ptrdiff_max_64); EXPECT_EQ(sizeof(long) == 8, PTRDIFF_MAX, (ptrdiff_t) 0x7fffffffffffffffLL); break;
CASE_TEST(limit_size_max_64); EXPECT_EQ(sizeof(long) == 8, SIZE_MAX, (size_t) 0xffffffffffffffffULL); break;
CASE_TEST(limit_intptr_min_32); EXPECT_EQ(sizeof(long) == 4, INTPTR_MIN, (intptr_t) 0x80000000); break;
CASE_TEST(limit_intptr_max_32); EXPECT_EQ(sizeof(long) == 4, INTPTR_MAX, (intptr_t) 0x7fffffff); break;
CASE_TEST(limit_uintptr_max_32); EXPECT_EQ(sizeof(long) == 4, UINTPTR_MAX, (uintptr_t) 0xffffffffU); break;
CASE_TEST(limit_ptrdiff_min_32); EXPECT_EQ(sizeof(long) == 4, PTRDIFF_MIN, (ptrdiff_t) 0x80000000); break;
CASE_TEST(limit_ptrdiff_max_32); EXPECT_EQ(sizeof(long) == 4, PTRDIFF_MAX, (ptrdiff_t) 0x7fffffff); break;
CASE_TEST(limit_size_max_32); EXPECT_EQ(sizeof(long) == 4, SIZE_MAX, (size_t) 0xffffffffU); break;
case __LINE__:
return ret; /* must be last */
/* note: do not set any defaults so as to permit holes above */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment