selftests/nolibc: add some tests for makedev() and friends

These functions/macros are about to be changed.

Add some tests to make sure they continue working.
As they only handle small dev_t values, only test those for now.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260404-nolibc-makedev-v2-1-456a429bf60c@weissschuh.net
This commit is contained in:
Thomas Weißschuh 2026-04-04 10:08:18 +02:00
parent 7933969e1f
commit 9c0ff257fb

View File

@ -1680,6 +1680,9 @@ int run_stdlib(int min, int max)
CASE_TEST(memchr_foobar6_o); EXPECT_STREQ(1, memchr("foobar", 'o', 6), "oobar"); break;
CASE_TEST(memchr_foobar3_b); EXPECT_STRZR(1, memchr("foobar", 'b', 3)); break;
CASE_TEST(time_types); EXPECT_ZR(is_nolibc, test_time_types()); break;
CASE_TEST(makedev); EXPECT_EQ(1, makedev(0x12, 0x34), 0x1234); break;
CASE_TEST(major); EXPECT_EQ(1, major(0x1234), 0x12); break;
CASE_TEST(minor); EXPECT_EQ(1, minor(0x1234), 0x34); break;
case __LINE__:
return ret; /* must be last */