mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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 b8a926bea8
("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>
This commit is contained in:
parent
a5b9abaa60
commit
34c68f432c
2 changed files with 6 additions and 13 deletions
|
@ -192,13 +192,6 @@ void kunit_binary_str_assert_format(const struct kunit_assert *assert,
|
||||||
const struct va_format *message,
|
const struct va_format *message,
|
||||||
struct string_stream *stream);
|
struct string_stream *stream);
|
||||||
|
|
||||||
#define KUNIT_INIT_MEM_ASSERT_STRUCT(text_, left_val, right_val, size_) { \
|
|
||||||
.text = text_, \
|
|
||||||
.left_value = left_val, \
|
|
||||||
.right_value = right_val, \
|
|
||||||
.size = size_ \
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct kunit_mem_assert - An expectation/assertion that compares two
|
* struct kunit_mem_assert - An expectation/assertion that compares two
|
||||||
* memory blocks.
|
* memory blocks.
|
||||||
|
|
|
@ -666,13 +666,13 @@ do { \
|
||||||
left, \
|
left, \
|
||||||
op, \
|
op, \
|
||||||
right, \
|
right, \
|
||||||
size, \
|
size_, \
|
||||||
fmt, \
|
fmt, \
|
||||||
...) \
|
...) \
|
||||||
do { \
|
do { \
|
||||||
const void *__left = (left); \
|
const void *__left = (left); \
|
||||||
const void *__right = (right); \
|
const void *__right = (right); \
|
||||||
const size_t __size = (size); \
|
const size_t __size = (size_); \
|
||||||
static const struct kunit_binary_assert_text __text = { \
|
static const struct kunit_binary_assert_text __text = { \
|
||||||
.operation = #op, \
|
.operation = #op, \
|
||||||
.left_text = #left, \
|
.left_text = #left, \
|
||||||
|
@ -686,10 +686,10 @@ do { \
|
||||||
assert_type, \
|
assert_type, \
|
||||||
kunit_mem_assert, \
|
kunit_mem_assert, \
|
||||||
kunit_mem_assert_format, \
|
kunit_mem_assert_format, \
|
||||||
KUNIT_INIT_MEM_ASSERT_STRUCT(&__text, \
|
KUNIT_INIT_ASSERT(.text = &__text, \
|
||||||
__left, \
|
.left_value = __left, \
|
||||||
__right, \
|
.right_value = __right, \
|
||||||
__size), \
|
.size = __size), \
|
||||||
fmt, \
|
fmt, \
|
||||||
##__VA_ARGS__); \
|
##__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue