linux/lib/math
Adi Nata a0275efa65 lib/math: add KUnit test suite for polynomial_calc()
Add a KUnit test suite for the polynomial_calc() function, which had no
in-kernel test coverage.  The tests verify correct evaluation of constant,
linear, quadratic, and cubic polynomials, including negative coefficients,
negative input data, zero-coefficient terms.

The Kconfig entry uses 'select POLYNOMIAL' rather than 'depends on
POLYNOMIAL' because POLYNOMIAL is a promptless tristate that cannot
be manually enabled on UML without an explicit selector.

Link: https://lore.kernel.org/20260606030319.316752-1-adinata.softwareengineer@gmail.com
Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
Cc: Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <david@davidgow.net>
Cc: Rae Moar <raemoar63@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-08-03 21:10:07 -07:00
..
tests lib/math: add KUnit test suite for polynomial_calc() 2026-08-03 21:10:07 -07:00
cordic.c
div64.c lib: mul_u64_u64_div_u64(): optimise the divide code 2025-11-20 14:03:42 -08:00
gcd.c lib/math/gcd: use static key to select implementation at runtime 2025-07-19 19:08:28 -07:00
int_log.c lib/math/int_log: Replace LGPL-2.1-or-later boilerplate with SPDX identifier 2023-07-09 22:47:50 +01:00
int_pow.c kernel.h: split out mathematical helpers 2020-12-15 22:46:15 -08:00
int_sqrt.c kernel.h: split out mathematical helpers 2020-12-15 22:46:15 -08:00
Kconfig lib: polynomial: move to math/ subfolder 2026-03-27 21:19:39 -07:00
lcm.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
Makefile lib: polynomial: move to math/ subfolder 2026-03-27 21:19:39 -07:00
polynomial.c lib: math: polynomial: remove link to non-exist file and fix spelling 2026-03-27 21:19:39 -07:00
prime_numbers_private.h lib/prime_numbers: convert self-test to KUnit 2025-02-12 14:00:11 -08:00
prime_numbers.c lib/prime_numbers: convert self-test to KUnit 2025-02-12 14:00:11 -08:00
rational.c math: rational: add missing MODULE_DESCRIPTION() macro 2024-07-04 23:43:11 -07:00
reciprocal_div.c kernel.h: split out mathematical helpers 2020-12-15 22:46:15 -08:00
test_div64.c lib/math/test_div64: add some edge cases relevant to __div64_const32() 2024-10-28 21:44:28 +00:00
test_mul_u64_u64_div_u64.c lib: test_mul_u64_u64_div_u64(): test the 32bit code on 64bit 2025-11-20 14:03:42 -08:00