KUNIT_ASSERT_PTR_EQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_ASSERT_PTR_EQ πŸ’…

okay bestie, welcome to the Kernel API Manual section for KUNIT_ASSERT_PTR_EQ β€” the pointer-equality assert that does not play around 😀✨

🌸 NAME 🌸

KUNIT_ASSERT_PTR_EQ β€” Asserts that pointers @left and @right are equal. 🎯


πŸ¦‹ SYNOPSIS πŸ¦‹

KUNIT_ASSERT_PTR_EQ (test , left , right );

πŸŽ€ ARGUMENTS πŸŽ€

  • test β€” the test context object, aka the little world this assertion lives in 🌍
  • left β€” an arbitrary expression that evaluates to a pointer. literally any expression, as long as it's pointer-shaped πŸ‘ˆ
  • right β€” an arbitrary expression that evaluates to a pointer. same deal, other side πŸ‘‰

✨ DESCRIPTION ✨

So here's the tea β˜•: this sets an assertion that the values left and right evaluate to are equal. That's the whole vibe. 🫢

It's the same as KUNIT_EXPECT_EQ, with one big main-character difference: when the assertion is not met, it causes an assertion failure (see KUNIT_ASSERT_TRUE). So like… no soft launch, no "hmm that's a bit off" β€” it fully aborts the test. πŸ’€πŸ”₯

ngl bestie, that's the whole point of the ASSERT family vs the EXPECT family β€” one keeps going, one stops the music. πŸŽ΅βœ‹

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/kunit/test.h πŸ’– and, alphabetically-ish, the whole group chat:


and that's the page, bestie πŸŒˆπŸ’œ sign-off time: this masterpiece lives in the source tree at ./include/kunit, and it's dated October 2026 πŸ—“οΈβœ¨ go forth and assert those pointers, iykyk πŸ’…πŸ«Ά

πŸ“¦ where this page comes from