STRUCT KUNIT_BINARY_PTR_ASSERT(9)
π struct kunit_binary_ptr_assert(9)
okay so this is from the Kernel API Manual and it's genuinely one of those little structs that makes kernel testing not a total nightmare, so let's get into it π«Ά
β¨ NAME β¨
struct kunit_binary_ptr_assert β it's the expectation/assertion type that compares two pointer values, like when you write KUNIT_EXPECT_PTR_EQ(test, foo, bar) π
πΈ SYNOPSIS πΈ
struct kunit_binary_ptr_assert {
struct kunit_assert assert;
const struct kunit_binary_assert_text *text;
const void *left_value;
const void *right_value;
};
π Members π
assertβ the parent of this type, it's giving "I inherited this, respectfully" πtextβ holds the textual representations of the operands and the op (e.g."==") β¨left_valueβ the actual evaluated value of the expression in the left slot πright_valueβ the actual evaluated value of the expression in the right slot π
π¦ Description π¦
so this struct represents an expectation/assertion that compares two pointer values, no cap π
for example, if you wanna expect that foo and bar point to the same thing, you can use the expectation KUNIT_EXPECT_PTR_EQ(test, foo, bar); β literally that simple, slay π₯
π SEE ALSO π
kernel file ./include/kunit/assert.h β plus all these besties:
enum kunit_assert_type(9)struct kunit_loc(9)struct kunit_assert(9)struct kunit_fail_assert(9)struct kunit_unary_assert(9)struct kunit_ptr_not_err_assert(9)struct kunit_binary_assert_text(9)struct kunit_binary_assert(9)struct kunit_binary_str_assert(9)struct kunit_mem_assert(9)
k bye bestie, go forth and assert your pointers π
and that's the whole vibe check β brought to you by ./include/kunit, dated October 2026, signing off from the struct kunit...y_ptr_assert(9) era π§ββοΈβπ
π¦ 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