KUNIT_ASSERT_MEMEQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so this is KUNIT_ASSERT_MEMEQ(9), straight outta the Kernel API Manual. The whole point: it asserts that the first @size bytes of @left and @right are equal. πŸ’…βœ¨


✨ SYNOPSIS ✨

KUNIT_ASSERT_MEMEQ (test , left , right , size );

πŸŽ€ ARGUMENTS πŸŽ€

  • test β€” the test context object. πŸ§ͺ
  • left β€” an arbitrary expression that evaluates to the specified size.
  • right β€” an arbitrary expression that evaluates to the specified size.
  • size β€” number of bytes compared.

πŸ¦‹ DESCRIPTION πŸ¦‹

This sets an assertion that the values left and right evaluate to are equal. It is semantically equivalent to KUNIT_ASSERT_TRUE(test, !memcmp((left), (right), (size))). See KUNIT_ASSERT_TRUE for more information. 🫢

The way this assertion works for any memory block, it is not recommended for comparing more structured data, such as structs. It is recommended for comparing, for example, data arrays. So: data arrays? slay. Structs? maybe not the vibe. πŸ’€


🌈 SEE ALSO 🌈

Kernel file: ./include/kunit/test.h β€” plus the whole KUnit bestie squad, no cap:


big hugs from the footer, bestie: source/version is ./include/kunit, dated October 2026. πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from