EXPECT_EQ(9)
π EXPECT_EQ π
okay bestie, welcome to EXPECT_EQ, section 9 of the Kernel API Manual β aka the kselftest harness macro that checks whether two things are, like, the same thing. no big dramatic exits, no panic energy, just a soft little "hmm, these should match" π
β¨ NAME β¨
EXPECT_EQ β
(yeah the original just trails off there, no cap π that's literally the whole name entry. it's giving mysterious. it's giving "she said she'd text back and then didn't" π«Ά)
π SYNOPSIS π
EXPECT_EQ (expected , seen );
that's it. that's the whole vibe check. two things go in, judgement happens π
π ARGUMENTS π
- expected β the value you're expecting to see. your hopes, your dreams, your little prediction πΈ
- seen β the value you actually measured. the reality check. what the code really did π₯
π¦ DESCRIPTION π¦
so here's the tea, bestie: EXPECT_EQ(expected, measured): expected == measured β you're saying those two should be equal, and the harness is gonna check that expected == measured for you. it's the soft-girl version of an equality assertion, iykyk π
lowkey important: this is the EXPECT family, not the ASSERT family β check the SEE ALSO list below if you wanna meet the whole friend group π
β SEE ALSO β
the whole squad, fr fr β go say hi π
Kernel file ./tools/testing/selftests/kselftest_harness.h example(9)TH_LOG(9)SKIP(9)TEST(9)TEST_SIGNAL(9)FIXTURE_DATA(9)FIXTURE(9)FIXTURE_SETUP(9)FIXTURE_TEARDOWN(9)FIXTURE_TEARDOWN_PARENT(9)FIXTURE_VARIANT(9)FIXTURE_VARIANT_ADD(9)TEST_F(9)TEST_HARNESS_MAIN(9)operators(9)ASSERT_EQ(9)ASSERT_NE(9)ASSERT_LT(9)ASSERT_LE(9)ASSERT_GT(9)ASSERT_GE(9)ASSERT_NULL(9)ASSERT_TRUE(9)ASSERT_FALSE(9)ASSERT_STREQ(9)ASSERT_STRNE(9)EXPECT_NE(9)EXPECT_LT(9)EXPECT_LE(9)EXPECT_GT(9)EXPECT_GE(9)EXPECT_NULL(9)EXPECT_TRUE(9)EXPECT_FALSE(9)EXPECT_STREQ(9)EXPECT_STRNE(9)XFAIL_ADD(9)
mwah π that's the page!! sourced straight from ./tools/testing/selftests, dated October 2026 β screenshot it, memorise it, live by it. periodt. π§β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms