From: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
To: SeongJae Park <sjpark@amazon.com>
Cc: brendanhiggins@google.com, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org,
SeongJae Park <sj38.park@gmail.com>
Subject: Re: What is the best way to compare an unsigned and a constant?
Date: Fri, 27 Dec 2019 13:52:27 +0100 [thread overview]
Message-ID: <688d8f4b-266f-2c47-d4e9-d0336316a0a9@petrovitsch.priv.at> (raw)
In-Reply-To: <20191227123938.5271-1-sjpark@amazon.com>
[-- Attachment #1: Type: text/plain, Size: 778 bytes --]
Hi all!
On 27/12/2019 13:39, SeongJae Park wrote:
[...]
> I have a function returning 'unsigned long', and would like to write a kunit
> test for the function, as below.
>
> unsigned long foo(void)
> {
> return 42;
> }
>
> static void foo_test(struct kunit *test)
> {
> KUNIT_EXPECT_EQ(test, 42, foo());
> }
For this case: shouldn't
---- snip ----
static void foo_test(struct kunit *test)
{
KUNIT_EXPECT_EQ(test, 42ul, foo());
}
---- snip ----
do the trick?
MfG,
Bernd
--
"I dislike type abstraction if it has no real reason. And saving
on typing is not a good reason - if your typing speed is the main
issue when you're coding, you're doing something seriously wrong."
- Linus Torvalds
[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 2513 bytes --]
next prev parent reply other threads:[~2019-12-27 13:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-27 12:39 What is the best way to compare an unsigned and a constant? SeongJae Park
2019-12-27 12:52 ` Bernd Petrovitsch [this message]
2019-12-27 13:08 ` SeongJae Park
2020-01-07 11:52 ` SeongJae Park
2020-01-07 13:35 ` Brendan Higgins
2020-01-07 13:49 ` SeongJae Park
2020-01-08 14:12 ` Brendan Higgins
2020-01-08 14:26 ` SeongJae Park
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=688d8f4b-266f-2c47-d4e9-d0336316a0a9@petrovitsch.priv.at \
--to=bernd@petrovitsch.priv.at \
--cc=brendanhiggins@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=sj38.park@gmail.com \
--cc=sjpark@amazon.com \
/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;
as well as URLs for NNTP newsgroup(s).