Skip to content

testing/ostest: add strto base tests - #3688

Open
Zepp-Hanzj wants to merge 1 commit into
apache:masterfrom
Zepp-Hanzj:fix/ostest-strto-base36
Open

testing/ostest: add strto base tests#3688
Zepp-Hanzj wants to merge 1 commit into
apache:masterfrom
Zepp-Hanzj:fix/ostest-strto-base36

Conversation

@Zepp-Hanzj

Copy link
Copy Markdown
Contributor

Summary

Add regression coverage to ostest for the explicit-base handling fixed by apache/nuttx#19594.

The new test:

  • exhaustively checks bases 2 through 36 with lower- and upper-case digits
  • verifies positional values and end pointers
  • exercises strtol(), strtoul(), strtoll(), strtoull(), strtoimax(), and strtoumax()
  • verifies that bases 1 and 37 still fail with EINVAL
  • is included by both the Make and CMake builds

Impact

This only extends ostest; application behavior is unchanged.

Testing

Built sim:ostest with GNU Make against apache/nuttx#19594.

Without the libc fix, the new regression test fails at the first base-27 assertion:

user_main: libc tests
dump_assert_info: Assertion failed : at file: libc_strto.c:58 task: ostest process: ostest
ostest_main: Exiting with status 256

With the libc fix, the libc test section completes and ostest proceeds to the following tests:

user_main: libc tests

End of test memory usage:
...
user_main: setvbuf test

Commit-level style checks also pass:

$ tools/checkpatch.sh -g HEAD~1..HEAD
✔️ All checks pass.

Add regression coverage for integer conversions with explicit bases from 2 through 36.  Exercise lower- and upper-case digits, positional values, all six strto* interfaces, end pointers, errno, and the invalid range boundaries.

The tests fail at base 27 without apache/nuttx#19594 and pass with the corresponding libc fix.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
@Zepp-Hanzj
Zepp-Hanzj marked this pull request as ready for review August 1, 2026 09:58
@acassis

acassis commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

@Zepp-Hanzj seems like there is an issue in our CI:

  Building NuttX...
aarch64-none-elf-ld: /github/workspace/sources/nuttx/nuttx section `.rodata' will not fit in region `ocram'
aarch64-none-elf-ld: section .data LMA [00000000204e0000,00000000204e213f] overlaps section .rodata LMA [00000000204c7000,00000000204e0267]
aarch64-none-elf-ld: region `ocram' overflowed by 616 bytes
make[1]: *** [Makefile:194: nuttx] Error 1
make: *** [tools/Unix.mk:569: nuttx] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 397: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize imx93-evk/bootloader
/github/workspace/sources/nuttx /github/workspace/sources/nuttx
On branch master
Your branch is up to date with 'origin/master'.

@eenurkka could you please take a look, this imx93-evk:bootloader was created by you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants