lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 27 Dec 2019 13:52:27 +0100
From:   Bernd Petrovitsch <bernd@...rovitsch.priv.at>
To:     SeongJae Park <sjpark@...zon.com>
Cc:     brendanhiggins@...gle.com, linux-kselftest@...r.kernel.org,
        kunit-dev@...glegroups.com, linux-kernel@...r.kernel.org,
        SeongJae Park <sj38.park@...il.com>
Subject: Re: What is the best way to compare an unsigned and a constant?

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

Download attachment "pEpkey.asc" of type "application/pgp-keys" (2473 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ