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] [day] [month] [year] [list]
Message-ID: <CAGS_qxrYGrvg--bmdJ8zOV8+hCcY6=OZj0FtqheNtGP81XFL6Q@mail.gmail.com>
Date:   Tue, 2 Aug 2022 12:56:30 -0700
From:   Daniel Latypov <dlatypov@...gle.com>
To:     Maíra Canal <mairacanal@...eup.net>
Cc:     André Almeida <andrealmeid@...eup.net>,
        melissa.srw@...il.com, daniel@...ll.ch, javierm@...hat.com,
        siqueirajordao@...eup.net, Isabella Basso <isabbasso@...eup.net>,
        jose.exposito89@...il.com, magalilemes00@...il.com,
        tales.aparecida@...il.com, davidgow@...gle.com,
        davem@...emloft.net, Brendan Higgins <brendanhiggins@...gle.com>,
        linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
        linux-kernel@...r.kernel.org, airlied@...ux.ie, kuba@...nel.org
Subject: Re: [PATCH 2/3] kunit: add KUnit array assertions to the example_all_expect_macros_test

On Tue, Aug 2, 2022 at 12:00 PM Maíra Canal <mairacanal@...eup.net> wrote:
> > I don't know how we make a maximally fool-proof version of this macro :\
>
> This is a hard one also. I believe that use KUNIT_EXPECT_ARREQ(test,
> expected, expected, sizeof(expected)); is more compliant to the
> memcpy/memset/memcmp signature. Moreover, this problem also occur for
> the KUNIT_EXPECT_EQ(test, memcmp(expected, expected, sizeof(expected)), 0);
>
> I believe that the number of array elements will make it easier for
> users to avoid mistakes.

Actually, another idea: perhaps KUNIT_EXPECT_MEMEQ?
I think that might be clearer in terms of the semantics and people
could more easily infer the right unit (bytes).

Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ