STRUCT KUNIT_BINARY_STR_ASSERT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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