KUNIT_ASSERT_STRNEQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_ASSERT_STRNEQ(9) β€” from the Kernel API Manual, bestie 🫢

okay so real talk, this one is a banger of a macro and it does exactly one (1) thing, but it does it flawlessly. no cap.


✨ NAME ✨

KUNIT_ASSERT_STRNEQ β€” the assertion that goes "these two strings are not the same, and I'm willing to bet the test run on it." Like, it asserts that @left and @right are not equal. periodt. πŸ’…


✨ SYNOPSIS ✨

KUNIT_ASSERT_STRNEQ (test , left , right );

yes she's a macro, yes she's got three args, yes she ate πŸŽ€


✨ ARGUMENTS ✨

  • test β€” the test context object. your main character. everything gets reported through her πŸ’–
  • left β€” any arbitrary expression that evaluates to a null terminated string. yes, any expression. go off πŸ‘‘
  • right β€” another arbitrary expression that evaluates to a null terminated string. the other half of the vibe check 🌸

✨ DESCRIPTION ✨

So what she actually does: she sets an assertion that the values left and right evaluate to are not equal. that's it. that's the whole personality πŸ¦‹

and ngl, she's semantically equivalent to this:

KUNIT_ASSERT_TRUE(test, strcmp((left), (right)))

like, lowkey the exact same energy, just with a cuter face ✨ and if you want more info on how that whole assert mechanism works, go peek at KUNIT_ASSERT_TRUE β€” she explains the lore πŸ’œ


✨ SEE ALSO ✨

the whole friend group, fr fr β€” and the kernel file she lives in is ./include/kunit/test.h πŸ“


okay that's the whole page, mwah 😘 one last lil sign-off note for the receipts: this cutie comes out of the ./include/kunit directory, dated October 2026, and it's filed under the Kernel API Manual β€” iykyk πŸ§šπŸ’œ

πŸ“¦ where this page comes from