KUNIT_ASSER...ARNING_COUNT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_ASSERT_SUPPRESSED_WARNING_COUNT πŸ’…

okay so we're in the Kernel API Manual, and this macro is genuinely giving β€œbestie let me check the suppressed warnings for you” energy. no cap, it's a tiny but iconic assertion helper.


✨ NAME ✨

KUNIT_ASSERT_SUPPRESSED_WARNING_COUNT β€” sets an assertion that the suppressed warning count equals @expected.

πŸŽ€ SYNOPSIS πŸŽ€

KUNIT_ASSERT_SUPPRESSED_WARNING_COUNT (test , expected );

🫢 ARGUMENTS 🫢

  • test β€” the test context object, aka the little world this check lives in.
  • expected β€” an expression that evaluates to the expected warning count.

πŸ’– DESCRIPTION πŸ’–

okay so this macro sets an assertion that the number of suppressed WARN*() calls equals expected. it's literally the same as KUNIT_EXPECT_SUPPRESSED_WARNING_COUNT, except it causes an assertion failure (see KUNIT_ASSERT_TRUE) when the assertion is not met.

that's the whole vibe. lowkey simple, highkey useful. πŸ’…

🌈 SEE ALSO 🌈

Kernel file ./include/kunit/test.h is the spot. then the whole linked crew:


signed off with love from the ./include/kunit source, dated October 2026 πŸ’œβœ¨

πŸ“¦ where this page comes from