lib/math: Add Kunit test suite for gcd()
Add a KUnit test suite for the gcd() function. This test suite verifies the correctness of gcd() across various scenarios, including edge cases. Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com> Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com> Link: https://lore.kernel.org/r/20250203075400.3431330-1-eleanor15x@gmail.com Signed-off-by: Kees Cook <kees@kernel.org>
This commit is contained in:
@@ -3222,6 +3222,19 @@ config INT_LOG_KUNIT_TEST
|
||||
|
||||
If unsure, say N
|
||||
|
||||
config GCD_KUNIT_TEST
|
||||
tristate "Greatest common divisor test" if !KUNIT_ALL_TESTS
|
||||
depends on KUNIT
|
||||
default KUNIT_ALL_TESTS
|
||||
help
|
||||
This option enables the KUnit test suite for the gcd() function,
|
||||
which computes the greatest common divisor of two numbers.
|
||||
|
||||
This test suite verifies the correctness of gcd() across various
|
||||
scenarios, including edge cases.
|
||||
|
||||
If unsure, say N
|
||||
|
||||
endif # RUNTIME_TESTING_MENU
|
||||
|
||||
config ARCH_USE_MEMTEST
|
||||
|
||||
Reference in New Issue
Block a user