From: Sander Vanheule <sander@svanheule.net>
To: Brendan Higgins <brendan.higgins@linux.dev>,
David Gow <davidgow@google.com>,
Daniel Latypov <dlatypov@google.com>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com
Cc: linux-kernel@vger.kernel.org, Sander Vanheule <sander@svanheule.net>
Subject: [PATCH] kunit: fix assert_type for KUNIT_EXPECT_LE_MSG()
Date: Sun, 21 Aug 2022 16:59:40 +0200 [thread overview]
Message-ID: <20220821145940.277394-1-sander@svanheule.net> (raw)
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
next reply other threads:[~2022-08-21 14:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-21 14:59 Sander Vanheule [this message]
2022-08-21 15:03 ` Sander Vanheule
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220821145940.277394-1-sander@svanheule.net \
--to=sander@svanheule.net \
--cc=brendan.higgins@linux.dev \
--cc=davidgow@google.com \
--cc=dlatypov@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®