summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2026-04-04 11:08:18 +0300
committerThomas Weißschuh <linux@weissschuh.net>2026-04-04 11:28:35 +0300
commit9c0ff257fbbe7f42a81c7b4eeefe8dfc9e8f52b3 (patch)
treedd0d0c163767c40e786b38d325067d209c7956da /tools/testing
parent7933969e1f733e18795a755cd9822ccf510140a1 (diff)
downloadlinux-9c0ff257fbbe7f42a81c7b4eeefe8dfc9e8f52b3.tar.xz
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
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/nolibc/nolibc-test.c3
1 files changed, 3 insertions, 0 deletions
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 */