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: <CABVgOSnGvrpUx=YauvpquZRp++6-JhaXjoQiUOG7-xQNmsLwng@mail.gmail.com>
Date:   Tue, 8 Feb 2022 12:08:48 +0800
From:   David Gow <davidgow@...gle.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Shuah Khan <skhan@...uxfoundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Brendan Higgins <brendanhiggins@...gle.com>,
        Daniel Latypov <dlatypov@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        KUnit Development <kunit-dev@...glegroups.com>
Subject: Re: [PATCH 2/3] list: test: Add a test for list_is_head()

On Sat, Feb 5, 2022 at 9:09 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Sat, Feb 05, 2022 at 02:15:37PM +0800, David Gow wrote:
> > list_is_head() was added recently[1], and didn't have a KUnit test. The
> > implementation is trivial, so it's not a particularly exciting test, but
> > it'd be nice to get back to full coverage of the list functions.
> >
> > [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/list.h?id=0425473037db40d9e322631f2d4dc6ef51f97e88
>
> ...
>
> > +static void list_test_list_is_head(struct kunit *test)
> > +{
> > +     struct list_head a, b;
> > +
> > +     KUNIT_EXPECT_TRUE(test, list_is_head(&a, &a));
>
> OK.
>
> > +     KUNIT_EXPECT_FALSE(test, list_is_head(&a, &b));
>
> Perhaps OK, but the main case here is to test an (arbitrary) member of the existing list.
>

That makes sense. I've updated the test to verify both the case where
the elements are from the same list and where it's from a different
list:
https://lore.kernel.org/linux-kselftest/20220208040122.695258-2-davidgow@google.com/T/#u

(I've also updated patch 3 for list_entry_is_head() similarly, which
was even worse before.)

> > +}
>

Cheers,
-- David

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4003 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ