KUNIT_EXPECT_MEMNEQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– KUNIT_EXPECT_MEMNEQ(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual page for KUNIT_EXPECT_MEMNEQ(9) β€” yes, the whole name is right there, cute and official. this one is about expecting two chunks of memory to be not equal, and it's giving β€œquick vibe check for data arrays” energy. ✨


πŸŽ€ NAME πŸŽ€

KUNIT_EXPECT_MEMNEQ β€” expects that the first @size bytes of @left and @right are not equal. fr fr, that's the whole name.

✨ SYNOPSIS ✨

KUNIT_EXPECT_MEMNEQ (test , left , right , size );

🫢 ARGUMENTS 🫢

  • test β€” the test context object. yes, the main character.
  • left β€” an arbitrary expression that evaluates to the specified size. that's literally the description, i'm not gonna pretend otherwise.
  • right β€” an arbitrary expression that evaluates to the specified size. same energy, other side.
  • size β€” number of bytes compared. that's the byte count, bestie.

πŸ’… DESCRIPTION πŸ’…

so this macro sets an expectation that the values that left and right evaluate to are not equal. it is semantically equivalent to KUNIT_EXPECT_TRUE(test, memcmp((left), (right), (size))). for more info, see KUNIT_EXPECT_TRUE β€” iykyk.

now, real talk: although this expectation works for any memory block, it is not recommended for comparing more structured data, such as structs. like, don't force it. this expectation is recommended for comparing, for example, data arrays. slay for arrays, no cap. πŸ“

bestie reminder: structured data (structs etc.) = not the vibe here. data arrays = the vibe here.

πŸ‘€ SEE ALSO πŸ‘€

okay the whole squad is linked, and we're listing every single one because we don't skip the boring parts in this group chat. first up: Kernel file ./include/kunit/test.h β€” then the references, in order:


k bye bestie! πŸ’– this page is from ./include/kunit and the date on the footer is October 2026 β€” mwah! πŸ’‹βœ¨

πŸ“¦ where this page comes from