* [PATCH] kunit: fix assert_type for KUNIT_EXPECT_LE_MSG()
@ 2022-08-21 14:59 Sander Vanheule
2022-08-21 15:03 ` Sander Vanheule
0 siblings, 1 reply; 2+ messages in thread
From: Sander Vanheule @ 2022-08-21 14:59 UTC (permalink / raw)
To: Brendan Higgins, David Gow, Daniel Latypov, Shuah Khan,
linux-kselftest, kunit-dev
Cc: linux-kernel, Sander Vanheule
When replacing KUNIT_BINARY_LE_MSG_ASSERTION() with
KUNIT_BINARY_INT_ASSERTION() for KUNIT_EXPECT_LE_MSG(), the assert_type
parameter was changed from KUNIT_EXPECTATION to KUNIT_ASSERTION. This
causes KUNIT_EXPECT_LE_MSG() and KUNIT_ASSERT_LE_MSG() to behave the
same way, and tests after a failed KUNIT_EXPECT_LE_MSG() are not run.
Call KUNIT_BINARY_INT_ASSERTIO() with KUNIT_EXPECTATION for again match
the documented behavior for KUNIT_EXPECT_* macros.
Fixes: 40f39777ce4f ("kunit: decrease macro layering for integer asserts")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
---
include/kunit/test.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/kunit/test.h b/include/kunit/test.h
index c958855681cc..617ec995671d 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -826,7 +826,7 @@ do { \
#define KUNIT_EXPECT_LE_MSG(test, left, right, fmt, ...) \
KUNIT_BINARY_INT_ASSERTION(test, \
- KUNIT_ASSERTION, \
+ KUNIT_EXPECTATION, \
left, <=, right, \
fmt, \
##__VA_ARGS__)
--
2.37.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kunit: fix assert_type for KUNIT_EXPECT_LE_MSG()
2022-08-21 14:59 [PATCH] kunit: fix assert_type for KUNIT_EXPECT_LE_MSG() Sander Vanheule
@ 2022-08-21 15:03 ` Sander Vanheule
0 siblings, 0 replies; 2+ messages in thread
From: Sander Vanheule @ 2022-08-21 15:03 UTC (permalink / raw)
To: Brendan Higgins, David Gow, Daniel Latypov, Shuah Khan,
linux-kselftest, kunit-dev
Cc: linux-kernel
Hi everyone,
On Sun, 2022-08-21 at 16:59 +0200, Sander Vanheule wrote:
> When replacing KUNIT_BINARY_LE_MSG_ASSERTION() with
> KUNIT_BINARY_INT_ASSERTION() for KUNIT_EXPECT_LE_MSG(), the assert_type
> parameter was changed from KUNIT_EXPECTATION to KUNIT_ASSERTION. This
> causes KUNIT_EXPECT_LE_MSG() and KUNIT_ASSERT_LE_MSG() to behave the
> same way, and tests after a failed KUNIT_EXPECT_LE_MSG() are not run.
>
> Call KUNIT_BINARY_INT_ASSERTIO() with KUNIT_EXPECTATION for again match
> the documented behavior for KUNIT_EXPECT_* macros.
>
> Fixes: 40f39777ce4f ("kunit: decrease macro layering for integer asserts")
> Signed-off-by: Sander Vanheule <sander@svanheule.net>
> ---
My apologies for the sloppiness, but I accidentally sent out an incomplete
version of this patch. Please disregards this patch, v2 is already posted.
Sorry for the noise!
Best,
Sander
> include/kunit/test.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/kunit/test.h b/include/kunit/test.h
> index c958855681cc..617ec995671d 100644
> --- a/include/kunit/test.h
> +++ b/include/kunit/test.h
> @@ -826,7 +826,7 @@ do
> {
> \
>
> #define KUNIT_EXPECT_LE_MSG(test, left, right, fmt, ...)
> \
> KUNIT_BINARY_INT_ASSERTION(test,
> \
> - KUNIT_ASSERTION,
> \
> + KUNIT_EXPECTATION,
> \
> left, <=, right,
> \
> fmt,
> \
> ##__VA_ARGS__)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-21 15:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-21 14:59 [PATCH] kunit: fix assert_type for KUNIT_EXPECT_LE_MSG() Sander Vanheule
2022-08-21 15:03 ` Sander Vanheule
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.