summaryrefslogtreecommitdiff
path: root/lib/Kconfig.debug
diff options
context:
space:
mode:
authorBruno Sobreira França <brunofrancadevsec@gmail.com>2024-12-02 15:55:39 +0800
committerKees Cook <kees@kernel.org>2025-02-10 18:25:37 -0800
commit84ec093f55f58f5a4a66eb98bd6b6af413190bde (patch)
tree056bc717c75894cc5f18130bf18a2711c3927a41 /lib/Kconfig.debug
parent3e50ba8fc834cadead733e4feeb969fce2f3b6e1 (diff)
downloadlinux-84ec093f55f58f5a4a66eb98bd6b6af413190bde.tar.gz
linux-84ec093f55f58f5a4a66eb98bd6b6af413190bde.tar.bz2
linux-84ec093f55f58f5a4a66eb98bd6b6af413190bde.zip
lib/math: Add int_log test suite
This commit introduces KUnit tests for the intlog2 and intlog10 functions, which compute logarithms in base 2 and base 10, respectively. The tests cover a range of inputs to ensure the correctness of these functions across common and edge cases. Signed-off-by: Bruno Sobreira França <brunofrancadevsec@gmail.com> Reviewed-by: David Gow <davidgow@google.com> Reviewed-by: Rae Moar <rmoar@google.com> Link: https://lore.kernel.org/r/20241202075545.3648096-3-davidgow@google.com Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'lib/Kconfig.debug')
-rw-r--r--lib/Kconfig.debug11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index b18dbfc53ca4..f30929ed1a84 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -3197,6 +3197,17 @@ config INT_SQRT_KUNIT_TEST
If unsure, say N
+config INT_LOG_KUNIT_TEST
+ tristate "Integer log (int_log) test" if !KUNIT_ALL_TESTS
+ depends on KUNIT
+ default KUNIT_ALL_TESTS
+ help
+ This option enables the KUnit test suite for the int_log library, which
+ provides two functions to compute the integer logarithm in base 2 and
+ base 10, called respectively as intlog2 and intlog10.
+
+ If unsure, say N
+
endif # RUNTIME_TESTING_MENU
config ARCH_USE_MEMTEST