KUNIT_EXPECT_LT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_EXPECT_LT β€” bestie's guide to "is the left one smaller??" ✨

okay so this is a page from the Kernel API Manual (like, the kernel's own little manual shelf πŸ“š) and the star of the show is KUNIT_EXPECT_LT. no cap, it's a whole vibe.


πŸŽ€ NAME πŸŽ€

KUNIT_EXPECT_LT β€” an expectation that @left is less than @right. literally that's it, that's the whole job πŸ’–


✨ SYNOPSIS ✨

KUNIT_EXPECT_LT (test , left , right );

look at her go 🫢 three little args, one big opinion about which number is smaller.


🧚 ARGUMENTS 🧚

  • test β€” the test context object. like, the group chat this expectation is being announced in πŸ’¬
  • left β€” an arbitrary expression that evaluates to a primitive C type. yes bestie, arbitrary β€” go feral, but it's gotta be a primitive C type πŸ‘‘
  • right β€” an arbitrary expression that evaluates to a primitive C type. same deal, other side of the comparison 🌸

πŸ’« DESCRIPTION πŸ’«

so what it actually does: it sets an expectation that the value left evaluates to is less than the value right evaluates to. tiny, simple, iconic. πŸ¦‹

and here's the tea β€” this is semantically equivalent to KUNIT_EXPECT_TRUE(test, (left) < (right)). like, that's not me being shady, that's literally what the page says. fr fr πŸ’€

so if you wanna understand the deep lore of how this expectation behaves, go read KUNIT_EXPECT_TRUE β€” it's got more information for you, iykyk πŸ‘€


🌈 SEE ALSO 🌈

Kernel file ./include/kunit/test.h β€” the source of truth, the mothership, the main character πŸ’…

and now the whole friend group, alphabetically-ish, in no particular order because chaos is a lifestyle:

like, everyone showed up to the party πŸŽ‰ no gatekeeping here.


lowkey important: left and right are expressions, not values, so they get dropped into the comparison as written. don't be weird about it and you're golden πŸ’œ

and that's the page!! sign-off time πŸŽ€ this one lives in ./include/kunit (the source), stamped October 2026 in the version/date corner, and honestly? she ate. periodt. πŸ’…πŸ”₯

πŸ“¦ where this page comes from