mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-08 14:45:12 +00:00
Add test_strchrnul() and speed_strchrnul(), selected by the new
CONFIG_TESTING_ARCH_LIBC_STRCHRNUL option, covering the hit, miss and
NUL cases.
Sweep alignment 0..7 and the boundary sizes {0, 1, 7, 8, 9, 15, 16, 17,
31, 32, 33, 63, 64, 65, 127, 128, 129, 255, 256, 257} in the scan
function tests (memcmp, memchr, strlen, strcmp, strchr, strncmp,
strnlen, strrchr) and in memmove. Those sizes sit on the 8 and 16 byte
chunk edges and on the sub-word tails, so vectorized (NEON/MVE) and
word-at-a-time implementations are stressed exactly at their alignment
and size boundaries instead of only at "nice" lengths. memmove is
additionally exercised across four overlap layouts: forward, backward,
contained and adjacent.
Impact: test only, selected by CONFIG_TESTING_ARCH_LIBC (default n).
Testing: built and ran qemu-armv7a:nsh (Cortex-A7, generic C
implementation) and sim:nsh on Linux x86_64 (Ubuntu 24.04, gcc 13.3.0)
with CONFIG_TESTING_ARCH_LIBC=y. All 16 enabled functions report
PASSED and "arch_libc_test Passed". These tests pass against the
generic C routines, which establishes the correctness baseline before
architecture optimized assembly is introduced.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
98 lines
1.7 KiB
Text
98 lines
1.7 KiB
Text
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
config TESTING_ARCH_LIBC
|
|
tristate "arch-specific libc function test"
|
|
default n
|
|
depends on ARCH_TOOLCHAIN_GNU
|
|
---help---
|
|
Enable the arch libc test
|
|
|
|
if TESTING_ARCH_LIBC
|
|
|
|
config TESTING_ARCH_LIBC_MEMCHR
|
|
bool "test memchr"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_MEMCMP
|
|
bool "test memcmp"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_MEMCPY
|
|
bool "test memcpy"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_MEMMOVE
|
|
bool "test memmove"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_MEMSET
|
|
bool "test memset"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRCHR
|
|
bool "test strchr"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRCMP
|
|
bool "test strcmp"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRCPY
|
|
bool "test strcpy"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRLEN
|
|
bool "test strlen"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRNCMP
|
|
bool "test strncmp"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRNLEN
|
|
bool "test strnlen"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRNCPY
|
|
bool "test strncpy"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STPCPY
|
|
bool "test stpcpy"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRCAT
|
|
bool "test strcat"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRRCHR
|
|
bool "test strrchr"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_STRCHRNUL
|
|
bool "test strchrnul"
|
|
default y
|
|
|
|
config TESTING_ARCH_LIBC_PROGNAME
|
|
string "Program name"
|
|
default "arch_libctest"
|
|
---help---
|
|
This is the name of the program that will be used when the NSH ELF
|
|
program is installed.
|
|
|
|
config TESTING_ARCH_LIBC_PRIORITY
|
|
int "arch libc test priority"
|
|
default 100
|
|
|
|
config TESTING_ARCH_LIBC_STACKSIZE
|
|
int "arch libc test stack size"
|
|
default DEFAULT_TASK_STACKSIZE
|
|
|
|
config TESTING_ARCH_LIBC_VERBOSE
|
|
bool "Verbose output"
|
|
default n
|
|
|
|
endif
|