ASSERT_LE(9)
π ASSERT_LE(9) π
ok so this is a page from the Kernel API Manual, bestie β section 9, the kernel dev corner. sit down, grab a strawberry π, we're learning about a macro that checks one number is less than or equal to another. yes that's it. no cap.
β¨ SYNOPSIS β¨
ASSERT_LE (expected , seen );
like, that's the whole call. two things go in, vibes come out π€
π ARGUMENTS π
- expected β the expected value, aka the number you think it should be. your main character number π
- seen β the measured value, aka the number reality actually handed you. the vibe check result πΈ
π¦ DESCRIPTION π¦
ASSERT_LE(expected, measured): expected <= measured
basically: the expected value has to be less than or equal to the measured one. if it is, slay, we move on β¨ if it isn't β the assertion fails, and it's giving "not me getting caught lacking" ππ
literally <=. that's the whole thing. ASSERT_LE is the "less than or equal" girlie of the ASSERT family. periodt π«Ά
ngl, the argument is named seen in the signature but measured in the description β that's just how the docs wrote it, i'm not changing a single character of it π
π SEE ALSO π
ok this is the part where the whole friend group shows up, so let me introduce everyone π
Kernel file ./tools/testing/selftests/kselftest_harness.h example(9)β the actual file, the source of truth, the blueprint πTH_LOG(9)SKIP(9)TEST(9)TEST_SIGNAL(9)FIXTURE_DATA(9)FIXTURE(9)FIXTURE_SETUP(9)FIXTURE_TEARDOWN(9)FIXTURE_TEARDOWN_PARENT(9)FIXTURE_VARIANT(9)FIXTURE_VARIANT_ADD(9)TEST_F(9)TEST_HARNESS_MAIN(9)operators(9)ASSERT_EQ(9)ASSERT_NE(9)ASSERT_LT(9)β the strict little sister of the one we're reading rn πASSERT_GT(9)ASSERT_GE(9)ASSERT_NULL(9)ASSERT_TRUE(9)ASSERT_FALSE(9)ASSERT_STREQ(9)ASSERT_STRNE(9)EXPECT_EQ(9)EXPECT_NE(9)EXPECT_LT(9)EXPECT_LE(9)EXPECT_GT(9)EXPECT_GE(9)EXPECT_NULL(9)EXPECT_TRUE(9)EXPECT_FALSE(9)EXPECT_STREQ(9)EXPECT_STRNE(9)XFAIL_ADD(9)
like, the whole squad. read them all, iykyk π₯
anyway that's the page, bestie β go forth and assert responsibly π§
sign-off szn: this gem lives in ./tools/testing/selftests, and the page is dated October 2026. that's the version, that's the date, mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms