tests: provide a word-at-a-time test implementation
PATCH 1/1 tests: provide a word-at-a-time test implementation
Add some basic tests to test the correctness of has_zero() and find_zero().
Signed-off-by Sven Schnelle <[email protected]>
--- lib/Kconfig.debug | 11 +++++++ lib/Makefile | 1 + lib/test_word-at-a-time.c | 62 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 lib/test_word-at-a-time.c
lib/Kconfig.debug +11 -0
@@ -2791,6 +2791,17 @@ config SIPHASH_KUNIT_TEST This is intended to help people writing architecture-specific optimized versions. If unsure, say N. +config WORDATATIME_KUNIT_TEST + tristate "KUnit test word-at-a-time implementation at runtime" if !KUNIT_ALL_TESTS + depends on KUNIT + default KUNIT_ALL_TESTS + help + Enable this option to test the kernel's word-at-a-time (<asm/word-at-a-time.h>) + functions on boot (or module load). + + This is intended to help people writing architecture-specific + optimized versions. If unsure, say N. + config TEST_UDELAY tristate "udelay test driver" help
lib/Makefile +1 -0
@@ -402,6 +402,7 @@ obj-$(CONFIG_FORTIFY_KUNIT_TEST) += fortify_kunit.o obj-$(CONFIG_STRCAT_KUNIT_TEST) += strcat_kunit.o obj-$(CONFIG_STRSCPY_KUNIT_TEST) += strscpy_kunit.o obj-$(CONFIG_SIPHASH_KUNIT_TEST) += siphash_kunit.o +obj-$(CONFIG_WORDATATIME_KUNIT_TEST) += test_word-at-a-time.o obj-$(CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED) += devmem_is_allowed.o
lib/test_word-at-a-time.c new file +62 -0
62 lines not on this page · raw message
Signature · 1 line
2.39.2
Quoted 4 lines · Sven Schnelle
Add some basic tests to test the correctness of
has_zero()andfind_zero().Signed-off-by Sven Schnelle <[email protected]>
Yay tests! :)
Reviewed-by Kees Cook <[email protected]>
Signature · 1 line
Kees Cook