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]
Message-ID: <CA+7tXijdGYdEBT6PB7hWk0Ups3Y97iWPx=AWWsb0z=OPqVzA1g@mail.gmail.com>
Date:   Tue, 25 May 2021 14:09:23 -0700
From:   Trent Piepho <tpiepho@...il.com>
To:     Daniel Latypov <dlatypov@...gle.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        andy@...nel.org, Andrew Morton <akpm@...ux-foundation.org>,
        Oskar Schirmer <oskar@...ra.com>
Subject: Re: [PATCH v2 2/2] lib/math/rational: Add Kunit test cases

On Tue, May 25, 2021 at 10:34 AM Daniel Latypov <dlatypov@...gle.com> wrote:
> On Tue, May 25, 2021 at 7:43 AM Trent Piepho <tpiepho@...il.com> wrote:
> > Adds a number of test cases that cover a range of possible code paths.
> >
> > Signed-off-by: Trent Piepho <tpiepho@...il.com>
>
> Reviewed-by: Daniel Latypov <dlatypov@...gle.com>
>
> Looks really good to me, just two nits.
>
> Tangent:
> I didn't check to see that this covers all the interesting cases, but
> it seems like it does.
> If you want, you can try generating a code coverage report to double check.
> Instructions for doing so can be found in
> https://lore.kernel.org/linux-kselftest/20210414222256.1280532-1-dlatypov@google.com/
> I would have done that and included the #s in this email, but my
> workplace decided to subtly break my workstation in some way and I
> haven't gotten around to root causing...

I installed a gcc 6.4 toolchain and changed the uml_abort() call to
exit(), coverage was generated, but still truncated and incorrectly
near 0%.  So what I did was crash after running all the test cases I
cared about by dividing by zero and then coverage data was produced
correctly.  It's 100% by lines.  But I think both possibilities when
the largest semiconvergent is exactly half the previous convergent
aren't tested.

> >  lib/math/rational-test.c | 56 ++++++++++++++++++++++++++++++++++++++++
>
> Ah, sorry, I forgot to mention this in the previous email.
> If you look at kunit/style.rst docs, you'll see the documentation now
> states a preference for the name of this file to be one of
> {rational_test.c, rational_kunit.c}

Before I chose a name, I checked every file with kunit tests cases,
and *-test was the most common naming pattern, including the sample
case.  I would be nice if changing the docs to say something is a
standard also updated the code to make that reality.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ