KUNIT_ASSERT_NE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌈 KUNIT_ASSERT_NE(9) 🌈

hey bestie, welcome to the KUNIT_ASSERT_NE(9) page from the Kernel API Manual. This one is short, sweet, and absolutely ready to check that two things are not equal, fr fr. πŸ’–

✨ NAME ✨

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

πŸ¦‹ SYNOPSIS πŸ¦‹

KUNIT_ASSERT_NE (test , left , right );

πŸŽ€ ARGUMENTS πŸŽ€

  • test β€” the test context object. that's the main-character test context, okay? πŸ’…
  • left β€” an arbitrary expression that evaluates to a primitive C type. no cap.
  • right β€” an arbitrary expression that evaluates to a primitive C type. same energy, other side. ✨

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea: this sets an assertion that the values that left and right evaluate to are not equal. 🫢

It's literally the same as KUNIT_EXPECT_NE, except it causes an assertion failure (see KUNIT_ASSERT_TRUE) when the assertion is not met.

bestie, this one is an assert β€” when the assertion is not met, it causes an assertion failure via KUNIT_ASSERT_TRUE. that's the whole difference from KUNIT_EXPECT_NE, iykyk. πŸ”₯

🌈 SEE ALSO 🌈

Kernel file ./include/kunit/test.h and the whole iconic squad:


that's the whole page, bestie 🫢 this iconic little thing lives in ./include/kunit, in the Kernel API Manual, with the KUNIT_ASSERT_NE(9) tag, dated October 2026. mwah πŸ’‹

πŸ“¦ where this page comes from