KUNIT_ASSERT_EQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ KUNIT_ASSERT_EQ ✨

okay bestie, welcome to the KUNIT_ASSERT_EQ(9) page from the Kernel API Manual β€” yes it's a real manual page, yes it's from the kernel, and yes we're gonna make it make sense πŸ’…


🌸 NAME 🌸

KUNIT_ASSERT_EQ β€” sets an assertion that @left and @right are equal. that's it, that's the whole vibe check πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

KUNIT_ASSERT_EQ (test , left , right );

like, three arguments, in that exact order, no notes πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • test β€” the test context object. it's the main character of the whole test suite, no cap πŸ‘‘
  • left β€” an arbitrary expression that evaluates to a primitive C type. literally anything, as long as it lands on a primitive C type πŸ“
  • right β€” an arbitrary expression that evaluates to a primitive C type. same deal, bestie β€” arbitrary expression, primitive C type, that's the assignment πŸ’œ

⭐ DESCRIPTION ⭐

so what this does: it sets an assertion that the values that left and right evaluate to are equal. simple. iconic. very demure ✨

lowkey the important part is this β€” it's the same as KUNIT_EXPECT_EQ, except it causes an assertion failure (see KUNIT_ASSERT_TRUE) when the assertion is not met. so EXPECT is the chill one that just judges you quietly, and ASSERT is the one that actually stops the whole thing 😭 fr fr, know the difference.

heads up bestie: this one aborts. if you weren't ready for that, maybe you wanted the EXPECT version πŸ’€

πŸ’… SEE ALSO πŸ’…

everything's in the Kernel file ./include/kunit/test.h, and here is the full squad β€” every single one, because we don't do half-finished lists in this house 🫢

yeah that's a lot of siblings but we love a big family 🌈


and that's the page, bestie πŸ’– this one lives in ./include/kunit and it's dated October 2026 β€” so go forth, assert your equalities, and remember who actually aborts. slay πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from