summaryrefslogtreecommitdiff
path: root/include/kunit/test.h
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2022-11-09 13:20:32 -0800
committerShuah Khan <skhan@linuxfoundation.org>2022-12-12 14:13:47 -0700
commit34c68f432c67f0d9bd4e64cf0929f399c6a4e1b0 (patch)
tree0622fe7d810bd31e512eba8a8c97adbb02867231 /include/kunit/test.h
parenta5b9abaa6049340a93a852b1d6d069064fddb624 (diff)
kunit: remove KUNIT_INIT_MEM_ASSERTION macro
Commit 870f63b7cd78 ("kunit: eliminate KUNIT_INIT_*_ASSERT_STRUCT macros") removed all the other macros of this type. But it raced with commit b8a926bea8b1 ("kunit: Introduce KUNIT_EXPECT_MEMEQ and KUNIT_EXPECT_MEMNEQ macros"), which added another instance. Remove KUNIT_INIT_MEM_ASSERTION and just use the generic KUNIT_INIT_ASSERT macro instead. Rename the `size` arg to avoid conflicts by appending a "_" (like we did in the previous commit). Signed-off-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'include/kunit/test.h')
-rw-r--r--include/kunit/test.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/kunit/test.h b/include/kunit/test.h
index d7f60e8aab30..4666a4d199ea 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -666,13 +666,13 @@ do { \
left, \
op, \
right, \
- size, \
+ size_, \
fmt, \
...) \
do { \
const void *__left = (left); \
const void *__right = (right); \
- const size_t __size = (size); \
+ const size_t __size = (size_); \
static const struct kunit_binary_assert_text __text = { \
.operation = #op, \
.left_text = #left, \
@@ -686,10 +686,10 @@ do { \
assert_type, \
kunit_mem_assert, \
kunit_mem_assert_format, \
- KUNIT_INIT_MEM_ASSERT_STRUCT(&__text, \
- __left, \
- __right, \
- __size), \
+ KUNIT_INIT_ASSERT(.text = &__text, \
+ .left_value = __left, \
+ .right_value = __right, \
+ .size = __size), \
fmt, \
##__VA_ARGS__); \
} while (0)