KUNIT_EXPECT_NE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_EXPECT_NE(9) β€” the "no sweety they are NOT equal" check

okay so this is a page from the Kernel API Manual bestie, and it's about the tiniest lil' macro with the biggest "actually tho" energy: KUNIT_EXPECT_NE. it's giving "i expect these two things to be different and i WILL be telling everyone" 🫢


✨ NAME ✨

KUNIT_EXPECT_NE β€” an expectation that @left and @right are not equal. periodt. πŸ’…


🌸 SYNOPSIS 🌸

KUNIT_EXPECT_NE (test , left , right );

πŸŽ€ ARGUMENTS πŸŽ€

  • test β€” the test context object. it's the main character that holds the whole vibe together πŸ‘‘
  • left β€” an arbitrary expression that evaluates to a primitive C type. literally anything, as long as it lands on a primitive C type πŸ¦‹
  • right β€” an arbitrary expression that evaluates to a primitive C type. same deal, bestie, primitive C type only πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this does is set an expectation that the values left and right evaluate to are not equal. like, they show up to the function and they're different people πŸ’€ β€” and that's the whole point.

this is semantically equivalent to:

KUNIT_EXPECT_TRUE(test, (left) != (right))

no cap, that's the exact same thing. so if you wanna know more, go see KUNIT_EXPECT_TRUE for the full tea β˜• β€” it's got all the extra info ✨


🌈 SEE ALSO 🌈

the whole friend group, in order, no one left out 🫢 (kernel file ./include/kunit/test.h):


k that's the whole page bestie, go forth and assert that things are NOT the same πŸ’–

alsooo this came from ./include/kunit, dated October 2026 β€” bookmark it, screenshot it, put it on your fridge, iykyk πŸŒΈπŸŽ€

πŸ“¦ where this page comes from