From: Thomas Weißschuh Date: Sat, 4 Apr 2026 08:08:18 +0000 (+0200) Subject: selftests/nolibc: add some tests for makedev() and friends X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c0ff257fbbe7f42a81c7b4eeefe8dfc9e8f52b3;p=thirdparty%2Fkernel%2Fstable.git 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 Acked-by: Willy Tarreau Link: https://patch.msgid.link/20260404-nolibc-makedev-v2-1-456a429bf60c@weissschuh.net --- diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index e6fef6eb1db1..4a9b6eb9e477 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -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 */