kunit: drop unused assert_type from kunit_assert and clean up macros

This field has been split out from kunit_assert to make the struct less
heavy along with the filename and line number.

This change drops the assert_type field and cleans up all the macros
that were plumbing assert_type into kunit_assert.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Daniel Latypov
2022-01-13 08:59:31 -08:00
committed by Shuah Khan
parent 21957f90b2
commit 05a7da89c1
2 changed files with 19 additions and 43 deletions

View File

@@ -796,7 +796,7 @@ void kunit_do_failed_assertion(struct kunit *test,
assert_type, \
false, \
kunit_fail_assert, \
KUNIT_INIT_FAIL_ASSERT_STRUCT(assert_type), \
KUNIT_INIT_FAIL_ASSERT_STRUCT, \
fmt, \
##__VA_ARGS__)
@@ -827,8 +827,7 @@ void kunit_do_failed_assertion(struct kunit *test,
assert_type, \
!!(condition) == !!expected_true, \
kunit_unary_assert, \
KUNIT_INIT_UNARY_ASSERT_STRUCT(assert_type, \
#condition, \
KUNIT_INIT_UNARY_ASSERT_STRUCT(#condition, \
expected_true), \
fmt, \
##__VA_ARGS__)
@@ -886,8 +885,7 @@ do { \
assert_type, \
__left op __right, \
assert_class, \
ASSERT_CLASS_INIT(assert_type, \
#op, \
ASSERT_CLASS_INIT(#op, \
#left, \
__left, \
#right, \
@@ -1241,8 +1239,7 @@ do { \
assert_type, \
strcmp(__left, __right) op 0, \
kunit_binary_str_assert, \
KUNIT_INIT_BINARY_STR_ASSERT_STRUCT(assert_type, \
#op, \
KUNIT_INIT_BINARY_STR_ASSERT_STRUCT(#op, \
#left, \
__left, \
#right, \
@@ -1301,8 +1298,7 @@ do { \
assert_type, \
!IS_ERR_OR_NULL(__ptr), \
kunit_ptr_not_err_assert, \
KUNIT_INIT_PTR_NOT_ERR_STRUCT(assert_type, \
#ptr, \
KUNIT_INIT_PTR_NOT_ERR_STRUCT(#ptr, \
__ptr), \
fmt, \
##__VA_ARGS__); \