KUNIT_ASSERT_PTR_NE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ KUNIT_ASSERT_PTR_NE β€” a Kernel API Manual moment ✨

okay so bestie, this is a kernel API page, and the star of the show is KUNIT_ASSERT_PTR_NE πŸ’… (with a lil cameo from KUNIT_ASSERT_PTR_EQ β€” we'll get to that, don't worry 🫢).


🌸 NAME 🌸

KUNIT_ASSERT_PTR_NE β€” asserts that pointers @left and @right are not equal. πŸ”₯

Also living on this page: KUNIT_ASSERT_PTR_EQ() β€” asserts that pointers @left and @right are equal. Yeah, it's the mirror-twin situation, iconic behavior honestly ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

KUNIT_ASSERT_PTR_NE (test , left , right );

literally that's the whole vibe check πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • test β€” the test context object 🧚 (yes it's required, yes it's important)
  • left β€” an arbitrary expression that evaluates to a pointer 🌈
  • right β€” an arbitrary expression that evaluates to a pointer 🌈

two arbitrary pointer-y expressions, walking into a test, no cap πŸ’€


πŸ’– DESCRIPTION πŸ’–

So what it does: it sets an assertion that the values that left and right evaluate to are not equal. That's it, that's the gig πŸ’…

It's the same as KUNIT_EXPECT_NE, except β€” and this is the main character detail β€” it causes an assertion failure when the assertion is not met (see KUNIT_ASSERT_TRUE). 😭 So like, it's not just gonna side-eye the failure and move on; it actually fails.

🚨 friendly heads-up bestie: "assertion failure" means the test does not simply shrug. If you wanted the chill version, that's KUNIT_EXPECT_NE. If you want the "this must be true or we're done here" energy, this is it.

πŸ”₯ SEE ALSO πŸ”₯

okay this list is LONG but we do not skip, we do not summarize, we list every single one because that's the assignment 🫢

Kernel file ./include/kunit/test.h

like. that's the whole friend group πŸ’œ


and that's the page bestie!! πŸŽ€ this one's from ./include/kunit, dated October 2026, and the manual it lives in is KUNIT_ASSERT_PTR_NE(9) β€” go forth and assert those pointers are not equal, slay πŸ’…βœ¨

πŸ“¦ where this page comes from