KUNIT_ASSERT_NULL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_ASSERT_NULL πŸ’…

okay so this is KUNIT_ASSERT_NULL(9) from the Kernel API Manual, and it's literally the vibe check for a null pointer πŸ’–


✨ NAME ✨

KUNIT_ASSERT_NULL β€” asserts that pointers @ptr is null.


πŸŽ€ SYNOPSIS πŸŽ€

KUNIT_ASSERT_NULL (test , ptr );

🌸 ARGUMENTS 🌸

  • test β€” the test context object πŸ‘‘
  • ptr β€” an arbitrary pointer, no cap 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

It sets an assertion that the values that ptr evaluates to is null. Slay.

This is the same as KUNIT_EXPECT_NULL, except it causes an assertion failure (see KUNIT_ASSERT_TRUE) when the assertion is not met. So yeah, bestie, this one is not just a gentle little expectation β€” it's giving real consequences 😭


🌈 SEE ALSO 🌈

Kernel file: ./include/kunit/test.h


cute sign-off time πŸŽ€: this page's source/version is ./include/kunit, it's dated October 2026, and its page id is KUNIT_ASSERT_NULL(9). stay slay, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from