KUNIT_EXPECT..._ERR_OR_NULL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… KUNIT_EXPECT_NOT_ERR_OR_NULL β€” the KUNIT_EXPECT..._ERR_OR_NULL(9) glow-up ✨

okay so bestie, you found the page for KUNIT_EXPECT_NOT_ERR_OR_NULL, and yes β€” this is that KUNIT_EXPECT..._ERR_OR_NULL(9) corner of the manual, from the kernel API manual. she's little. she's specific. she's iconic. let's get into it πŸŽ€


✨ NAME ✨

KUNIT_EXPECT_NOT_ERR_OR_NULL β€” expects that @ptr is not null and not err. literally her whole job 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

KUNIT_EXPECT_NOT_ERR_OR_NULL (test , ptr );

no cap, that's the whole invocation. eat it up πŸ’…


🌸 ARGUMENTS 🌸

  • test β€” the test context object. the main character of your test, lowkey. she holds the vibes and the results.
  • ptr β€” an arbitrary pointer. that's it. that's the vibe. any pointer you wanna check ✨

πŸ’– DESCRIPTION πŸ’–

so here's the tea, bestie: this sets an expectation that the value ptr evaluates to is not null and not an errno stored in a pointer. both. at once. she's doing the most πŸ’€

it's semantically equivalent to:

KUNIT_EXPECT_TRUE(test, !IS_ERR_OR_NULL(ptr))

like, fr fr, that's exactly what it means. and if you want more info, go peek at KUNIT_EXPECT_TRUE β€” she's the one who actually explains the mechanics πŸ‘‘

one thing: this is an expectation, not a hard stop. so the test keeps going. very chill of her. 🌈

πŸŽ€ SEE ALSO πŸŽ€

the friend group. the whole group chat. she knows everybody and everybody knows her β€” kernel file ./include/kunit/test.h, plus:


and that's the whole page bestie, you ate that πŸ’…βœ¨

quick sign-off so we keep receipts: this one lives at ./include/kunit, it's dated October 2026, and it's filed under KUNIT_EXPECT..._ERR_OR_NULL(9). mwah πŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from