STRUCT KUNIT_BINARY_STR_ASSERT(9)
β¨ NAME β¨
ok so struct kunit_binary_str_assert β welcome to the Kernel API Manual bestie π
this is the struct behind an expectation/assertion that compares two string values (like, for example, KUNIT_EXPECT_STREQ(test, foo, "bar")). yes that's the whole vibe. it's giving "did these two strings match or not" and honestly it ate.
πΈ SYNOPSIS πΈ
struct kunit_binary_str_assert {
struct kunit_assert assert;
const struct kunit_binary_assert_text *text;
const char *left_value;
const char *right_value;
};
ok yes the indentation in that last closing brace is literally what the original has, don't come for me π«Ά
π Members π
assertβ the parent of this type. every icon has a parent, periodt.textβ holds the textual representations of the operands and the comparator. it's basically the receipts β¨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. main character of the right side π
π¦ Description π¦
so this struct represents an expectation/assertion that compares two string values. no cap. for example, if you wanna expect that the string in foo is equal to "bar", you can use the expectation:
KUNIT_EXPECT_STREQ(test, foo, "bar");
that's it, that's the whole thing, and it's iconic π
π 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_mem_assert(9)
like a whole friend group of asserts fr fr π
ok bestie that's the whole page, go forth and assert your strings π
and before you go β this lil baddie lives in ./include/kunit, the manual is the Kernel API Manual, and it's dated October 2026 β so yeah, future-flavored docs. mwah, study up π
π
π¦ 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