EXPECT_LT(9)
πΈ EXPECT_LT(9) β the "is it actually smaller tho" check πΈ
okay so real talk, this one lives in the Kernel API Manual and it's one of the kselftest harness assertion macros. bestie, it's giving "tiny but mighty" and i'm obsessed π
β¨ NAME β¨
EXPECT_LT β
that's it. that's the whole name section. no description, no follow-up, no nothing. she said "my name is enough" and honestly? main character energy π like, the confidence. we love to see it.
π«Ά SYNOPSIS π«Ά
EXPECT_LT (expected , seen );
(yes the spacing is like that, don't @ me, that's literally how it's written, copy it exactly bestie π)
π ARGUMENTS π
expectedβ the value you expect to see. your hopes, your dreams, your predictions πseenβ the value you actually measured. the reality check. the "well, we ran it" π
π₯ DESCRIPTION π₯
okay so here's the whole entire deal, and it's literally one line:
EXPECT_LT(expected, measured): expected < measured
so it's checking that expected is less than measured. that's the vibe check. expected < measured, and if that's true you slay, and if it's not... well, it's an EXPECT, not an ASSERT, iykyk π (EXPECT macros keep going after a failure, unlike the ASSERT family β but hey, that's a whole other manpage, go read ASSERT_LT(9) if you want the strict one).
it's fr fr just the < operator in a little fancy harness outfit. iconic. periodt. π¦
π SEE ALSO π
the whole squad, assembled. all of these are literally listed, so here they are, all of them, no skipping, no cap:
- Kernel file
./tools/testing/selftests/kselftest_harness.hexample(9) 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)ASSERT_LE(9)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_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, that's the entire friend group. go read them, they're all bangers π
heads up bestie: this page is source-ified from the actual kselftest harness docs, so if anything looks weirdly terse, that's just how the kernel rolls. it's not you, it's the manpage π
and that's the page!! mwah π sign-off time: this lil cutie came out of ./tools/testing/selftests and it's dated October 2026, manual section EXPECT_LT(9) β go forth and compare things, you're gonna do amazing π§β¨
π¦ 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