KUNIT_EXPEC...ARNING_COUNT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ KUNIT_EXPECT_SUPPRESSED_WARNING_COUNT ✨

okay so real talk, this is a page from the Kernel API Manual (manual name: KUNIT_EXPEC...ARNING_COUNT(9), yes the title is literally truncated in the middle of the word, the kernel manpage generator said "that's a you problem" πŸ’€). Anyway. Bestie. Sit down. Let's talk about counting warnings that got suppressed. πŸŽ€

πŸ’– NAME πŸ’–

KUNIT_EXPECT_SUPPRESSED_WARNING_COUNT β€” this one sets an expectation that the suppressed warning count equals @expected. That's the whole vibe check. πŸ¦‹


🌸 SYNOPSIS 🌸

KUNIT_EXPECT_SUPPRESSED_WARNING_COUNT (test , expected );

🧚 ARGUMENTS 🧚

  • test β€” the test context object. the main character of the whole operation honestly πŸ‘‘
  • expected β€” an expression that evaluates to the expected warning count. like, how many warnings do you expect to have been suppressed. do the math, bestie πŸ“

πŸ”₯ DESCRIPTION πŸ”₯

so what this does is set an expectation that the number of suppressed WARN*() calls equals expected. simple as that, no cap.

and here's the tea: it's semantically equivalent to KUNIT_EXPECT_EQ(test, KUNIT_SUPPRESSED_WARNING_COUNT, expected). literally the same thing, just a glow-up with a cuter name. πŸ’…

if you want the whole lore, see KUNIT_EXPECT_EQ for more information. iykyk. ✨


🌈 SEE ALSO 🌈

background reading, in the kernel file ./include/kunit/test.h, and the extended universe of friends:


ngl this whole list is giving "required reading for the group project" but everyone in it actually pulls their weight 🫢

and that's the page, bestie!! this lil icon came from the kernel source dir ./include/kunit, dated October 2026 β€” go off, kernel docs, we love a timestamped slay πŸ’œπŸŒΈπŸ’…

πŸ“¦ where this page comes from