KUNIT_FAIL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_FAIL(9) πŸ’…

Okay bestie, welcome to Kernel API Manual section 9, where we meet KUNIT_FAIL β€” the icon that always fails on purpose. No cap. πŸ’–


🌸 NAME 🌸

KUNIT_FAIL β€” always causes a test to fail when evaluated. That's it. That's the tweet. πŸ’€


✨ SYNOPSIS ✨

KUNIT_FAIL (test , fmt , ... );

πŸŽ€ ARGUMENTS πŸŽ€

  • test β€” the test context object. It's the little context bubble your assertion lives in. 🫢
  • fmt β€” an informational message to be printed when the assertion is made. Say what you need to say, bestie. πŸ’¬
  • ... β€” string format arguments. The rest of the format-string squad. ✨

πŸ’– DESCRIPTION πŸ’–

Okay so picture KUNIT_SUCCEED, right? Now flip it. KUNIT_FAIL is the opposite of KUNIT_SUCCEED: it is an expectation that always fails. In other words, it always results in a failed expectation, and consequently it always causes the test case to fail when evaluated. Periodt. πŸŒˆπŸ’…

For more information, see KUNIT_EXPECT_TRUE. Go off, queen. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./include/kunit/test.h β€” and the whole crew:


Later, bestie β€” this page is signed by the Kernel API Manual, source/version ./include/kunit, date October 2026. Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from