lkml.org 
[lkml]   [2021]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] lib: add basic KUnit test for lib/math
On Thu, Apr 08, 2021 at 06:40:01PM -0700, Daniel Latypov wrote:
> Add basic test coverage for files that don't require any config options:
> * gcd.c
> * lcm.c
> * int_sqrt.c
> * reciprocal_div.c
> (Ignored int_pow.c since it's a simple textbook algorithm.)

What about adding math.h test cases?

We have some macros there and it might be a good idea to test them, for example
that round_up() and roundup() produces the same output for the same (power of
two divisor) input.

> These tests aren't particularly interesting, but they
> * provide short and simple examples of parameterized tests
> * provide a place to add tests for any new files in this dir
> * are written so adding new test cases to cover edge cases should be easy

Yes, that's why I think macros also can be a good example how to test *macro*.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-04-09 17:30    [W:0.034 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site