STRUCT KUNIT_MEM_ASSERT(9)
β¨ struct kunit_mem_assert β Kernel API Manual, bestie edition β¨
okay so picture this: you're deep in ./include/kunit/assert.h land, the Kernel API Manual is open, and you just need to know what a struct kunit_mem_assert is. Don't worry bestie, I got you π
πΈ NAME πΈ
struct kunit_mem_assert β it's an expectation/assertion that compares two memory blocks. literally that's the whole vibe. no cap.
π SYNOPSIS π
struct kunit_mem_assert {
struct kunit_assert assert;
const struct kunit_binary_assert_text *text;
const void *left_value;
const void *right_value;
const size_t size;
};
π¦ Members π¦
assertβ the parent of this type. every icon needs a parent, periodt.textβ holds the textual representations of the operands and the comparator. it's giving receipts for your comparison π₯left_valueβ the actual evaluated value of the expression in the left slot. main character of the left side πright_valueβ the actual evaluated value of the expression in the right slot. and the right side said "not me being compared" πsizeβ size of the memory block analysed, in bytes. number-crunching icon, fr fr π
π§ Description π§
so here's the tea β β this struct represents an expectation/assertion that compares two memory blocks. yes, literally two blocks of memory, byte by byte, no drama (except the drama you're inherently creating by asserting things β¨).
for example, to expect that the first three bytes of foo is equal to the first three bytes of bar, you can use the expectation
KUNIT_EXPECT_MEMEQ(test, foo, bar, 3);
the way that 3 just... says "first three bytes, bestie" π it ate and left no crumbs π
π SEE ALSO π
- Kernel file
./include/kunit/assert.h 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_ptr_assert(9)struct kunit_binary_str_assert(9)
and that's the whole page, bestie π«Ά go forth and compare those memory blocks, iykyk.
π that's a wrap π β brought to you fresh from the source tree at ./include/kunit, dated October 2026, manual page struct kunit_mem_assert(9). slay πβ¨
π¦ 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