Home | History | Annotate | only in /src/tests/lib/libc/stdlib
History log of /src/tests/lib/libc/stdlib
RevisionDateAuthorComments
 1.2 13-Jul-2010  jmmv Get rid of static Atffiles and let bsd.test.mk generate them on the fly.
 1.1 20-Jul-2009  joerg Add a fast, platform independent hash function to libc.
The algorithm used is the Jenkins hash. The name (mi_vector_hash)
reflects the nature of the hash function.
Add glue for libc ATF tests and include a test case to make sure that
(mis)alignment and endianess are handled correctly.

Bump libc minor to 169.
 1.36 18-Sep-2025  mrg introduce a couple of new turn-off-gcc-warning variables and use them.

GCC 14 has a new annoying calloc() checker that we turn off in a bunch
of places, and there are a few more dangling-pointer issuse that come up,
but seem bogus.
 1.35 02-Mar-2025  riastradh libc: New _r variants of heapsort, mergesort, qsort.

Also kheapsort_r for kernel/standalone use.

These variants allow the caller to pass a cookie through to the
comparison function, e.g. if you want to sort an array of indices
into a buffer.

qsort_r is new in POSIX.1-2024; the others are obvious analogues of
our nonstandard extensions for heapsort and mergesort.

PR lib/58931: qsort_r() missing
 1.34 04-Jul-2023  riastradh branches: 1.34.2;
t_posix_memalign: Expand test cases and properties.

- Test cartesian product of a sampling of sizes and a sampling of
alignments.

- Verify all the edge cases I could find in posix_memalign and
aligned_alloc, including failure modes.

- Test an unreasonably large (but aligned) allocation size.

- Use ATF_CHECK_* instead of ATF_REQUIRE_* so all failures will be
reported, not just the first one.

- While here, build with -fno-builtin-aligned_alloc and with
-fno-builtin-posix_memalign to make sure the compiler doesn't try
any shenanigans.

XXX pullup-10
 1.33 01-Jul-2020  jruoho branches: 1.33.6;
Add basic checks for a64l(3), l64a(3), and l64a_r(3).
 1.32 30-Jun-2020  jruoho After a comedy of errors, move t_mbtowc to its final resting place.
 1.31 29-Jun-2020  jruoho Use -Wl,--no-fatal-warnings for the mktemp(3) test.
 1.30 27-Jun-2020  jruoho Start moving the remaining tests from src/regress to src/tests.
 1.29 27-Jun-2020  jruoho Move the test for mktemp(3) to the right place.
 1.28 22-Dec-2015  christos Add __TEST_FENV
 1.27 22-Dec-2015  martin Sync list of fenv enabled architectures again (PR 48633), this time for mips
addition.
 1.26 21-Dec-2015  martin While PR 48633 is not properly fixed, keep the additional lists of
fenv-enabled architectures in sync.
 1.25 01-May-2015  christos - new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
 1.24 27-Dec-2014  martin Move the list of <fenv.h> supporting architectures to the makefile and
sync it with other copies.
 1.23 04-Apr-2012  joerg branches: 1.23.10;
Try fixing t_strtod to not depend on -ffloat-store by adding the
necessary volatiles.
 1.22 29-Mar-2012  jruoho Few fundamental consistency checks for the abs(3) family.
 1.21 29-Mar-2012  jruoho Few naive consistency checks for the atoi(3) family.
 1.20 28-Mar-2012  jruoho Add a small test that checks that random(3) does not always return zero when
the RNG is initialized with zero. Prompoted by the recent nasty bug in the
OpenBSD libc.
 1.19 24-Feb-2012  joerg Restrict -ffloat-store to t_strtod.c.
 1.18 11-Sep-2011  jruoho branches: 1.18.2;
See that system(3) works.
 1.17 15-Jul-2011  jruoho Fix wrong linker flag that has always been lurking here.
 1.16 15-Jul-2011  jruoho Split out the -lpthread tests to a separate file.

XXX: The only thing gained from this is seeing whether -lpthread breaks
the getenv(3) family. Yet, a strict hypothesis about this would require
that the two test files are identical, which they are not.
 1.15 07-Jul-2011  jruoho Merge 't_environment' and 't_environment_pth'.
 1.14 04-Jun-2011  jruoho Add some tests for strtol(3).
 1.13 04-Jun-2011  jruoho Add -ffloat-store add test lib/45020 also with __isnanl().
 1.12 09-May-2011  jruoho branches: 1.12.2;
Few basic tests for exit(3).
 1.11 05-Apr-2011  jruoho Try to maintain the structure of libc and move 't_strtox' to 't_strtod'.
 1.10 05-Apr-2011  jruoho Add simple test cases for ttyname(3), strtod(3), and getgrent(3).
 1.9 13-Jan-2011  pgoyette Moving t_hsearch - belongs in stdlib/
 1.8 12-Jan-2011  pgoyette Put the atexit test where it belongs - in libc/stdlib/
 1.7 01-Jan-2011  pgoyette Convert a few more tests from regress to atf
 1.6 23-Dec-2010  pgoyette Migrate a couple more tests to aft
 1.5 03-Dec-2010  njoly Add testcase for PR/44189: strtod(3) wrong results with "-0x".
 1.4 16-Nov-2010  tron Split threaded environment test for the other environment tests as
suggested by Nicolas Joly in private e-mail. Linking a binary with
"libpthread" effects the beaviour of "libc" and we really want to
test both cases.
 1.3 14-Nov-2010  tron Add a new regression test "t_threaded" which tests using getenv_r(3),
putenv(3), setenv(3) and unsetenv(3) concurrently.
 1.2 23-Sep-2010  christos unit test for environment. Grr, someone should make fixing the sets easier
otherwise people are not going to want to write unit-tests.
 1.1 20-Jul-2009  joerg Add a fast, platform independent hash function to libc.
The algorithm used is the Jenkins hash. The name (mi_vector_hash)
reflects the nature of the hash function.
Add glue for libc ATF tests and include a test case to make sure that
(mis)alignment and endianess are handled correctly.

Bump libc minor to 169.
 1.12.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.18.2.1 17-Apr-2012  yamt sync with head
 1.23.10.1 16-May-2015  snj Pull up following revision(s) (requested by christos in ticket #781):
common/lib/libc/stdlib/strtoi.c: revision 1.2
common/lib/libc/stdlib/strtou.c: revision 1.2
distrib/sets/lists/debug/mi: revision 1.113
distrib/sets/lists/tests/mi: revision 1.617
lib/libc/include/namespace.h: revision 1.178
lib/libc/stdlib/Makefile.inc: revision 1.90 via patch
lib/libc/stdlib/strtoi.3: revisions 1.1, 1.2
lib/libc/stdlib/strtol.3: revision 1.32
lib/libc/stdlib/strtou.3: revisions 1.1, 1.2
lib/libc/stdlib/strtoul.3: revisions 1.30, 1.31
tests/lib/libc/stdlib/Makefile: revision 1.25
tests/lib/libc/stdlib/t_strtoi.c: revision 1.1
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
--
Sort ERRORS and SEE ALSO.
--
Sort ERRORS and SEE ALSO.
--
Sort SEE ALSO.
 1.33.6.1 24-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #808):

tests/lib/libc/stdlib/t_posix_memalign.c: revision 1.6
tests/lib/libc/stdlib/t_posix_memalign.c: revision 1.7
tests/lib/libc/stdlib/Makefile: revision 1.34

t_posix_memalign: Expand test cases and properties.
- Test cartesian product of a sampling of sizes and a sampling of
alignments.
- Verify all the edge cases I could find in posix_memalign and
aligned_alloc, including failure modes.
- Test an unreasonably large (but aligned) allocation size.
- Use ATF_CHECK_* instead of ATF_REQUIRE_* so all failures will be
reported, not just the first one.
- While here, build with -fno-builtin-aligned_alloc and with
-fno-builtin-posix_memalign to make sure the compiler doesn't try
any shenanigans.

t_posix_memalign: Fix this to reflect restriction lifted in C17.
 1.34.2.1 02-Aug-2025  perseant Sync with HEAD
 1.1 12-Jan-2011  pgoyette Put the atexit test where it belongs - in libc/stdlib/
 1.1 01-Jan-2011  pgoyette Convert a few more tests from regress to atf
 1.1 01-Jan-2011  pgoyette Convert a few more tests from regress to atf
 1.3 02-Mar-2025  riastradh branches: 1.3.4;
tests/lib/libc/stdlib/h_sort: Reserve room for a NUL byte.

PR lib/58931: qsort_r() missing
 1.2 02-Mar-2025  riastradh t_sort: Test mergesort for stability too.

These test cases are trivial, but they're enough to trigger unstable
heapsort and qsort.

Fix some error branches while here.

PR lib/58931: qsort_r() missing
 1.1 02-Mar-2025  riastradh libc: New _r variants of heapsort, mergesort, qsort.

Also kheapsort_r for kernel/standalone use.

These variants allow the caller to pass a cookie through to the
comparison function, e.g. if you want to sort an array of indices
into a buffer.

qsort_r is new in POSIX.1-2024; the others are obvious analogues of
our nonstandard extensions for heapsort and mergesort.

PR lib/58931: qsort_r() missing
 1.3.4.2 02-Aug-2025  perseant Sync with HEAD
 1.3.4.1 02-Mar-2025  perseant file h_sort.c was added on branch perseant-exfatfs on 2025-08-02 05:58:06 +0000
 1.1 01-Jul-2020  jruoho Add basic checks for a64l(3), l64a(3), and l64a_r(3).
 1.3 01-Mar-2014  joerg Fix sign.
 1.2 27-Feb-2014  joerg Don't use integer downcasts, use correctly sized constants for each test.
 1.1 29-Mar-2012  jruoho branches: 1.1.2; 1.1.4;
Few fundamental consistency checks for the abs(3) family.
 1.1.4.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.2.2 17-Apr-2012  yamt sync with head
 1.1.2.1 29-Mar-2012  yamt file t_abs.c was added on branch yamt-pagecache on 2012-04-17 00:09:12 +0000
 1.2 10-Jul-2017  joerg Reference correct binary in error messages.
 1.1 12-Jan-2011  pgoyette branches: 1.1.38;
Put the atexit test where it belongs - in libc/stdlib/
 1.1.38.1 01-Sep-2017  martin Pull up following revision(s) (requested by joerg in ticket #255):
tests/lib/libc/stdlib/t_atexit.sh: revision 1.2
Reference correct binary in error messages.
 1.3 03-Feb-2019  mrg - enlarge buffer to avoid snprintf() truncation
 1.2 29-Mar-2012  jruoho branches: 1.2.2; 1.2.34;
There was also atoll(3).
 1.1 29-Mar-2012  jruoho Few naive consistency checks for the atoi(3) family.
 1.2.34.1 10-Jun-2019  christos Sync with HEAD
 1.2.2.2 17-Apr-2012  yamt sync with head
 1.2.2.1 29-Mar-2012  yamt file t_atoi.c was added on branch yamt-pagecache on 2012-04-17 00:09:12 +0000
 1.2 07-Jul-2011  jruoho Rename some test case names. No functional change.
 1.1 23-Dec-2010  pgoyette Migrate a couple more tests to aft
 1.13 07-Jul-2011  jruoho Merge 't_environment' and 't_environment_pth'.
 1.12 16-Nov-2010  tron Split threaded environment test for the other environment tests as
suggested by Nicolas Joly in private e-mail. Linking a binary with
"libpthread" effects the beaviour of "libc" and we really want to
test both cases.
 1.11 14-Nov-2010  tron Add a new regression test "t_threaded" which tests using getenv_r(3),
putenv(3), setenv(3) and unsetenv(3) concurrently.
 1.10 14-Nov-2010  tron Update tests for *env(3):
- Introduce randomness into "t_setenv" to avoid freeing environment
variables exactly in the order they have been allocated.
Also call unsetenv(3) twice to make sure it behaves well if the
environment variable doesn't exist.
- "t_getenv" is no longer a known failure after getenv(3) and getenv_r(3)
have been fixed.
 1.9 13-Nov-2010  tron Add a test for getenv(3) which fails at the moment because it doesn't
handle "=" in variable names properly.

I'll send out a diff for review soon which fixes this.
 1.8 13-Nov-2010  tron Improve testing of environment handling:
1.) Always check the return value of setenv(3) and unsetenv(3).
2.) Test that calling setenv(..., ..., 0) doesn't overwrite environment
variables.
3.) Add a new test which mixes putenv(3) and setenv(3).
 1.7 09-Nov-2010  pooka This test is cursed.

Yesterday I thought I committed the increased timeout and when the
test was still failing for the autotests n hours later I noticed
I had actually failed to commit it. I did manage to commit something
in the evening, but the autotests were still failing this morning,
so I noticed I increased the timeout of the wrong test. I wonder
what will go wrong this time...

(and p.s.: 10240 is probably slow because it's O(n^2) with a constant
of quite a few)
 1.6 08-Nov-2010  pooka Increase timeout from 30 to 300 since this test runs for a long time.

XXX1: should 2x10240 loops really be *that* slow?
XXX2: is 10240 a sensible number to begin with?
 1.5 03-Nov-2010  christos add a clearenv test.
 1.4 25-Oct-2010  njoly Make putenv(3) fails with EINVAL for a null pointer, or for a string
that either miss or start with a `=' character.

Adjust man page and testcase accordingly.
 1.3 16-Oct-2010  njoly Make setenv(3) follow the standard, by rejecting invalid strings. It
now fails with EINVAL errno when variable is NULL, empty or contains
an `=' character; or value is NULL.

Adjust the man page accordingly, and exercize them in the existing
environment testcase.
 1.2 01-Oct-2010  christos Add tests for putenv(3)
 1.1 23-Sep-2010  christos unit test for environment. Grr, someone should make fixing the sets easier
otherwise people are not going to want to write unit-tests.
 1.3 07-Jul-2011  jruoho Merge 't_environment' and 't_environment_pth'.
 1.2 17-Nov-2010  tron Put my name in the author section.
 1.1 16-Nov-2010  tron Split threaded environment test for the other environment tests as
suggested by Nicolas Joly in private e-mail. Linking a binary with
"libpthread" effects the beaviour of "libc" and we really want to
test both cases.
 1.1 09-May-2011  jruoho Few basic tests for exit(3).
 1.3 27-Feb-2015  martin Double the timeout for sentev_basic to 600 seconds to make it work on
slower machines.
 1.2 15-Jul-2011  jruoho Split out the -lpthread tests to a separate file.

XXX: The only thing gained from this is seeing whether -lpthread breaks
the getenv(3) family. Yet, a strict hypothesis about this would require
that the two test files are identical, which they are not.
 1.1 07-Jul-2011  jruoho Merge 't_environment' and 't_environment_pth'.
 1.2 15-Mar-2012  joerg Add __printflike attribution to use vprintf and friends with an argument
as format string.
 1.1 15-Jul-2011  jruoho branches: 1.1.2;
Split out the -lpthread tests to a separate file.

XXX: The only thing gained from this is seeing whether -lpthread breaks
the getenv(3) family. Yet, a strict hypothesis about this would require
that the two test files are identical, which they are not.
 1.1.2.1 17-Apr-2012  yamt sync with head
 1.3 10-May-2023  gutteridge t_getopt.sh: fix naming of head() of getopt_optval test case
 1.2 20-Feb-2023  christos New optval test from des @ FreeBSD
 1.1 01-Jan-2011  pgoyette Convert a few more tests from regress to atf
 1.4 20-Jul-2014  christos amend the new destroy function to take function pointers.
 1.3 15-Sep-2011  christos branches: 1.3.8; 1.3.18;
add the reentrant function tests (copies of the non-reentrant one).
 1.2 07-Jul-2011  jruoho Rename some test case names. No functional change.
 1.1 13-Jan-2011  pgoyette Moving t_hsearch - belongs in stdlib/
 1.3.18.1 10-Aug-2014  tls Rebase.
 1.3.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4 30-Jun-2020  jruoho After a comedy of errors, move t_mbtowc to its final resting place.
 1.3 29-Jun-2020  maya Avoid copyright issues and name the listed author as the copyright holder.

In a private email, Miloslav had agreed that if they had written the
test, then it can be licensed bsd-2-clause. I am going to assume this
is true as the file names Miloslav as the author.

This test was likely sent to tcsh (not netbsd) that had changed bug
report systems since.
 1.2 27-Jun-2020  jruoho Add the default TNF copyright (2005), cf. PR misc/55419.
 1.1 27-Jun-2020  jruoho Start moving the remaining tests from src/regress to src/tests.
 1.3 07-Jul-2011  jruoho Rename some test case names. No functional change.
 1.2 20-Jul-2009  joerg Use __RCSID.
 1.1 20-Jul-2009  joerg Add a fast, platform independent hash function to libc.
The algorithm used is the Jenkins hash. The name (mi_vector_hash)
reflects the nature of the hash function.
Add glue for libc ATF tests and include a test case to make sure that
(mis)alignment and endianess are handled correctly.

Bump libc minor to 169.
 1.4 11-Jan-2021  christos Only try to create up-to NAME_MAX filenames.
XXX: this should be moved to stdio/t_mktemp.c where the rest of the tests
are and the code lives.
 1.3 01-Nov-2020  gson Make the mkstemps_basic and mkostemps_basic test cases not randomly
fail when the replacement string happens to contain the letter "y".
 1.2 01-Jul-2020  jruoho Add basic tests for the rest of the mktemp(3) family of functions, including
a case for PR lib/55441.
 1.1 27-Jun-2020  jruoho Move the test for mktemp(3) to the right place.
 1.8 05-Jul-2023  riastradh t_posix_memalign: Simplify.

No functional change intended.
 1.7 05-Jul-2023  riastradh t_posix_memalign: Fix this to reflect restriction lifted in C17.
 1.6 04-Jul-2023  riastradh t_posix_memalign: Expand test cases and properties.

- Test cartesian product of a sampling of sizes and a sampling of
alignments.

- Verify all the edge cases I could find in posix_memalign and
aligned_alloc, including failure modes.

- Test an unreasonably large (but aligned) allocation size.

- Use ATF_CHECK_* instead of ATF_REQUIRE_* so all failures will be
reported, not just the first one.

- While here, build with -fno-builtin-aligned_alloc and with
-fno-builtin-posix_memalign to make sure the compiler doesn't try
any shenanigans.

XXX pullup-10
 1.5 29-Jul-2018  maya branches: 1.5.10;
Don't require size to be a multiple of alignment. This is no longer a
requirement as of C18.
 1.4 07-Nov-2015  nros branches: 1.4.14; 1.4.16;
Fix code style errors pointed out by christos during the review of the
aligned_alloc test that also applies to the posix_memalign test.
Fix code style errors that I forgot to fix in the aligned_alloc test.
 1.3 07-Nov-2015  nros Add the C11 function aligned_alloc to libc.
 1.2 07-Jul-2011  jruoho Rename some test case names. No functional change.
 1.1 01-Jan-2011  pgoyette Convert a few more tests from regress to atf
 1.4.16.1 10-Jun-2019  christos Sync with HEAD
 1.4.14.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.5.10.1 24-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #808):

tests/lib/libc/stdlib/t_posix_memalign.c: revision 1.6
tests/lib/libc/stdlib/t_posix_memalign.c: revision 1.7
tests/lib/libc/stdlib/Makefile: revision 1.34

t_posix_memalign: Expand test cases and properties.
- Test cartesian product of a sampling of sizes and a sampling of
alignments.
- Verify all the edge cases I could find in posix_memalign and
aligned_alloc, including failure modes.
- Test an unreasonably large (but aligned) allocation size.
- Use ATF_CHECK_* instead of ATF_REQUIRE_* so all failures will be
reported, not just the first one.
- While here, build with -fno-builtin-aligned_alloc and with
-fno-builtin-posix_memalign to make sure the compiler doesn't try
any shenanigans.

t_posix_memalign: Fix this to reflect restriction lifted in C17.
 1.3 29-Mar-2012  jruoho branches: 1.3.2;
Adjust as per apb@'s suggestion.
 1.2 28-Mar-2012  jruoho Apparently there is a CVE coming for the bug, so append that to a comment.
 1.1 28-Mar-2012  jruoho Add a small test that checks that random(3) does not always return zero when
the RNG is initialized with zero. Prompoted by the recent nasty bug in the
OpenBSD libc.
 1.3.2.2 17-Apr-2012  yamt sync with head
 1.3.2.1 29-Mar-2012  yamt file t_random.c was added on branch yamt-pagecache on 2012-04-17 00:09:12 +0000
 1.2 02-Mar-2025  riastradh branches: 1.2.4;
t_sort: Test mergesort for stability too.

These test cases are trivial, but they're enough to trigger unstable
heapsort and qsort.

Fix some error branches while here.

PR lib/58931: qsort_r() missing
 1.1 02-Mar-2025  riastradh libc: New _r variants of heapsort, mergesort, qsort.

Also kheapsort_r for kernel/standalone use.

These variants allow the caller to pass a cookie through to the
comparison function, e.g. if you want to sort an array of indices
into a buffer.

qsort_r is new in POSIX.1-2024; the others are obvious analogues of
our nonstandard extensions for heapsort and mergesort.

PR lib/58931: qsort_r() missing
 1.2.4.2 02-Aug-2025  perseant Sync with HEAD
 1.2.4.1 02-Mar-2025  perseant file t_sort.sh was added on branch perseant-exfatfs on 2025-08-02 05:58:06 +0000
 1.39 07-Apr-2025  riastradh tests/lib/libc/stdlib/t_strtod: Fix strtod_gherman_bug build on VAX.

A typo (DBL_MANG_DIG) excluded this whole block, so my attempts to
compile-test it failed to find the build errors. Oops!

PR port-vax/59264: t_strtod:strtod_gherman_bug test is failing
 1.38 07-Apr-2025  riastradh tests/lib/libc/stdlib/t_strtod: Adapt strtod_gherman_bug to VAX.

PR port-vax/59264: t_strtod:strtod_gherman_bug test is failing
 1.37 15-Jun-2024  rillig branches: 1.37.2;
tests/strtold: test a few simple examples
 1.36 06-May-2024  riastradh tests/lib/libc/stdlib/t_strtod: Spruce up and nix needless #ifdefs.
 1.35 14-Jan-2024  andvar s/rouding/rounding/ in test description.
 1.34 22-Dec-2015  christos Put have fenv elsewhere.
 1.33 27-Dec-2014  martin Move the list of <fenv.h> supporting architectures to the makefile and
sync it with other copies.
 1.32 04-Nov-2014  justin PR misc/49356 remove unnecessary references to atf-c/config.h

The function included via this header is not used and is removed in
later versions of atf, so let us avoid it.
 1.31 26-Sep-2012  jruoho Remove expected failures that no longer fail (probably due a Qemu update).
 1.30 15-May-2012  alnsn branches: 1.30.2;
Test a bug found by Geza Herman.
 1.29 04-Apr-2012  joerg Try fixing t_strtod to not depend on -ffloat-store by adding the
necessary volatiles.
 1.28 18-Mar-2012  jruoho Move the references to PRs from code comments to the test description. Once
ATF has the ability to output the metadata in the HTML reports, it should be
easy to traverse between releng and gnats -reports via links.
 1.27 30-Sep-2011  jruoho branches: 1.27.2;
Add expected failures for Qemu.
 1.26 29-Aug-2011  jruoho Remove some cruft that is no longer needed.
 1.25 29-Aug-2011  jruoho Remove Xfails that are related to the infamous qemu/amd64 floating point
bugs. It appears to be quite difficult to identify the exact Qemu version
and setup. These do not fail on the TNF's qemu/amd64 setup, which can be
taken as a reference point for expected failures.
 1.24 08-Jul-2011  jruoho Remove the amd64-part from the Qemu checks. The following tests fail also on
i386/qemu: 'strtold_inf', 'strtold_nan', and 'infinity_long_double'. It seems
that more than anything else, these are dependent on the used Qemu version.
 1.23 07-Jul-2011  jruoho Improve the QEMU/amd64 detection.
 1.22 04-Jul-2011  mrg XXX: ugly hack to make these valid for vax fp.
XXX: could consolidate some of this into a common header, but i'll
leave that clean up for another time.
 1.21 14-Jun-2011  jruoho The NaN case for strtold(3) was fixed for x86. Adjust for the expected
failures (known failures include again the special case of qemu/amd64).
 1.20 07-Jun-2011  martin Sparc64 does not fail the strtold_nan test, so don't expect failure there
 1.19 05-Jun-2011  jruoho Granularity is fine, but also adjust atf_tc_expect_fail() properly.
 1.18 05-Jun-2011  jmmv Do not blindly skip test code.

Tests are not supposed to skip whole parts of code to later report a success.
Instead, they need to report a 'skipped' result so that it is clear to the
user that some part of the tests were not run.

To do this, add proper calls to atf_tc_skip where some pieces of code are
skipped. Also, make the strtod/strtof/strtold inf and nan tests more granular
so that the *ld versions can be skipped altogether when there is no support
for them. As a result of this, the atf_tc_expect_fail becomes accurate; it
could have hidden bugs in strtod and strtof before.
 1.17 05-Jun-2011  christos - use c99 to avoid extra ifdefs and tidy up the code
- require that undeflow returns 0 and ERANGE
 1.16 04-Jun-2011  matt Only do the long double tests if __HAVE_LONG_DOUBLE is defined
 1.15 04-Jun-2011  jruoho Add -ffloat-store add test lib/45020 also with __isnanl().
 1.14 04-Jun-2011  jruoho Add more strings to the "infinity test".
 1.13 04-Jun-2011  jruoho Verify PR lib/45020. Fails at least on amd64.
 1.12 31-May-2011  jruoho branches: 1.12.2;
Mark the following tests as expected failures on qemu/amd64: 'strtod_inf',
'strtod_round', and 'infinity_long_double'. None of these fail on any known
native host. Use the tracker PR misc/44767 as the reference point.
 1.11 20-May-2011  nakayama Add fenv support for sparc. Mostly copied from sparc64 and share with it.
 1.10 16-May-2011  he The support of <fenv.h> is actually for __sparc64__, not for __sparc__
(which is also defined on sparc64). This fixes a build problem for
plain sparc.
 1.9 10-May-2011  jruoho Use the same conditional check from <fenv.h> to fix an immediate build error
pointed out by cliff@. (This does not however sound like a sane thing to
mandate from a C99 header.)
 1.8 10-May-2011  jruoho Verify that strtod(3) honors the current rounding mode set by fesetround(3).
Passes on amd64. Prompted by a bug in the GNU C library.
 1.7 12-Apr-2011  jruoho Better to still leave the old PR number as a comment.
 1.6 12-Apr-2011  jruoho PR lib/33262 should be fixed; remove expected failure.
 1.5 10-Apr-2011  jruoho Currently known failures affect only amd64; adjust atf_tc_expect_fail().
 1.4 08-Apr-2011  jruoho Fix build failure on VAX.
 1.3 06-Apr-2011  jruoho Verify the existence of PR lib/33262.
 1.2 05-Apr-2011  jruoho Try to maintain the structure of libc and move 't_strtox' to 't_strtod'.
 1.1 05-Apr-2011  jruoho Add simple test cases for ttyname(3), strtod(3), and getgrent(3).
 1.12.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.27.2.3 30-Oct-2012  yamt sync with head
 1.27.2.2 23-May-2012  yamt sync with head.
 1.27.2.1 17-Apr-2012  yamt sync with head
 1.30.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.37.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 24-Jul-2024  kre Add some test cases to tests/lib/libc/stdlib/t_strtoi

PR lib/58461 PR lib/58453

Apologies for the previous commit message - I managed to
forget to include the message filename after commit -F
and so used the file being committed (the only changed file
in the directory) as the log message. (Fortunately that
meant that the log didn't get appended to the PR).

For the PR, the command to check what actually changed is

cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdlib/t_strtoi.c

rather than what will be reported below.

This commit message really belongs to the previous commit,
(1.5) there are no changes at all in this one.

No pullups required.
 1.4 24-Jul-2024  kre /* $NetBSD: t_strtoi.c,v 1.3 2024/01/20 16:52:41 christos Exp $ */

/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jukka Ruohonen.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

/*
* Created by Kamil Rytarowski, based on ID:
* NetBSD: t_strtol.c,v 1.5 2011/06/14 02:45:58 jruoho Exp
*/

#include <sys/cdefs.h>
__RCSID("$NetBSD: t_strtoi.c,v 1.3 2024/01/20 16:52:41 christos Exp $");

#include <atf-c.h>
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

struct test {
const char *str;
intmax_t res;
int base;
const char *end;
intmax_t lo;
intmax_t hi;
int rstatus;
};

static void check(struct test *, intmax_t, char *, int);

static void
check(struct test *t, intmax_t rv, char *end, int rstatus)
{

if (rv != t->res)
atf_tc_fail_nonfatal("strtoi(\"%s\", &end, %d, %jd, %jd, "
"&rstatus) failed (rv = %jd)", t->str, t->base,
t->lo, t->hi, rv);

if (rstatus != t->rstatus) {
char *emsg;

if (rstatus != 0) {
emsg = strerror(rstatus);
if (emsg != NULL) {
emsg = strdup(emsg);
if (emsg == NULL) {
atf_tc_fail("Out of Memory");
return;
}
}
} else
emsg = NULL;

atf_tc_fail_nonfatal("strtoi(\"%s\", &end, %d, %jd, %jd, &rstatus)"
" failed (rstatus: %d %s%s%sexpected %d%s%s%s)",
t->str, t->base, t->lo, t->hi, rstatus, rstatus ? "('" : "",
emsg != NULL ? emsg : "", rstatus ? "') " : "", t->rstatus,
t->rstatus ? " ('" : "", t->rstatus ? strerror(t->rstatus)
: "", t->rstatus ? "')" : "");

free(emsg);
}

if ((t->end != NULL && strcmp(t->end, end) != 0) ||
(t->end == NULL && *end != '\0'))
atf_tc_fail_nonfatal("invalid end pointer ('%s') from "
"strtoi(\"%s\", &end, %d, %jd, %jd, &rstatus), "
"expected '%s'", end, t->str, t->base, t->lo, t->hi,
t->end != NULL ? t->end : "\\0");
}

static void
check_errno(int e)
{
if (e != 0)
atf_tc_fail("strtoi(3) changed errno to %d ('%s')",
e, strerror(e));
}

ATF_TC(strtoi_base);
ATF_TC_HEAD(strtoi_base, tc)
{
atf_tc_set_md_var(tc, "descr", "Test strtoi(3) with different bases");
}

ATF_TC_BODY(strtoi_base, tc)
{
struct test t[] = {
{ "123456789", 123456789, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "111010110111100110100010101",123456789, 2, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "22121022020212200", 123456789, 3, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "13112330310111", 123456789, 4, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "223101104124", 123456789, 5, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "20130035113", 123456789, 6, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "3026236221", 123456789, 7, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "726746425", 123456789, 8, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "277266780", 123456789, 9, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "123456789", 123456789, 10, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "63762A05", 123456789, 11, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "35418A99", 123456789, 12, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "1C767471", 123456789, 13, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "12579781", 123456789, 14, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "AC89BC9", 123456789, 15, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "75BCD15", 123456789, 16, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "1234567", 342391, 8, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "01234567", 342391, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "0123456789", 123456789, 10, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "0x75bcd15", 123456789, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
};
struct test f[] = {
{ "1", 0, 1, "1",
INTMAX_MIN, INTMAX_MAX, EINVAL },
{ "2", 0, -1, "2",
INTMAX_MIN, INTMAX_MAX, EINVAL },
{ "3", 0, 37, "3",
INTMAX_MIN, INTMAX_MAX, EINVAL },
{ "4", 0, -1, "4",
INTMAX_MIN, INTMAX_MAX, EINVAL },
{ "0x", 0, 0, "x",
INTMAX_MIN, INTMAX_MAX, ENOTSUP },
};

intmax_t rv;
char *end;
int e;
size_t i;

for (i = 0; i < __arraycount(t); i++) {

errno = 0;
rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);

check_errno(errno);

check(&t[i], rv, end, e);
}

for (i = 0; i < __arraycount(f); i++) {

end = NULL;
errno = 0;
e = -99;

rv = strtoi(f[i].str, &end, f[i].base, f[i].lo, f[i].hi, &e);

check_errno(errno);

check(&f[i], rv, end, e);
}
}

ATF_TC(strtoi_case);
ATF_TC_HEAD(strtoi_case, tc)
{
atf_tc_set_md_var(tc, "descr", "Case insensitivity with strtoi(3)");
}

ATF_TC_BODY(strtoi_case, tc)
{
struct test t[] = {
{ "abcd", 0xabcd, 16, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ " dcba", 0xdcba, 16, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "abcd dcba", 0xabcd, 16, " dcba",
INTMAX_MIN, INTMAX_MAX, ENOTSUP },
{ "abc0x123", 0xabc0, 16, "x123",
INTMAX_MIN, INTMAX_MAX, ENOTSUP },
{ "abcd\0x123", 0xabcd, 16, "\0x123",
INTMAX_MIN, INTMAX_MAX, 0 },
{ "ABCD", 0xabcd, 16, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "aBcD", 0xabcd, 16, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "0xABCD", 0xabcd, 16, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "0xABCDX", 0xabcd, 16, "X",
INTMAX_MIN, INTMAX_MAX, ENOTSUP},
};

intmax_t rv;
char *end;
int e;
size_t i;

for (i = 0; i < __arraycount(t); i++) {

errno = 0;
rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);

check_errno(errno);

check(&t[i], rv, end, e);
}
}

ATF_TC(strtoi_range);
ATF_TC_HEAD(strtoi_range, tc)
{
atf_tc_set_md_var(tc, "descr", "Test ERANGE from strtoi(3)");
}

ATF_TC_BODY(strtoi_range, tc)
{
struct test t[] = {
#if INTMAX_MAX == 0x7fffffffffffffff
{ "1000000000000000000000", INTMAX_MAX, 8, NULL,
INTMAX_MIN, INTMAX_MAX, ERANGE },
{ "9223372036854775808", INTMAX_MAX, 10, NULL,
INTMAX_MIN, INTMAX_MAX, ERANGE },
{ "8000000000000000", INTMAX_MAX, 16, NULL,
INTMAX_MIN, INTMAX_MAX, ERANGE },
#else
#error extend this test to your platform!
#endif
{ "10", 1, 10, NULL,
-1, 1, ERANGE },
{ "10", 11, 10, NULL,
11, 20, ERANGE },
{ "7", 7, 0, NULL,
7, 7, 0 },
{ "6", 7, 0, NULL,
7, 7, ERANGE },
{ "8", 7, 0, NULL,
7, 7, ERANGE },
{ "7x", 7, 0, "x",
7, 7, ENOTSUP },
{ "8x", 7, 0, "x",
7, 7, ERANGE },
{ "Z", 11, 10, "Z",
11, 20, ECANCELED },
};

intmax_t rv;
char *end;
int e;
size_t i;

for (i = 0; i < __arraycount(t); i++) {

errno = 0;
rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);

if (errno != 0)
atf_tc_fail("Range test %zd set errno=%d", i, errno);
check_errno(errno);

check(&t[i], rv, end, e);
}
}

ATF_TC(strtoi_range_trail);
ATF_TC_HEAD(strtoi_range_trail, tc)
{
atf_tc_set_md_var(tc, "descr", "Test ERANGE from strtoi(3) "
"with trailing characters");
}

ATF_TC_BODY(strtoi_range_trail, tc)
{
struct test t[] = {
{ "11x", 9, 10, "x", 0, 9, ERANGE },
{ " -3y", -2, 10, "y", -2, 1, ERANGE },
{ "11111z", 9, 10, "z", 0, 9, ERANGE },
{ "+0xAq", 9, 16, "q", 0, 9, ERANGE },
{ "-0xBAr", 0, 16, "r", 0, 9, ERANGE },
};

intmax_t rv;
char *end;
int e;
size_t i;

for (i = 0; i < __arraycount(t); i++) {

errno = 0;
rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);

check_errno(errno);

check(&t[i], rv, end, e);
}
}

ATF_TC(strtoi_signed);
ATF_TC_HEAD(strtoi_signed, tc)
{
atf_tc_set_md_var(tc, "descr", "A basic test of strtoi(3)");
}

ATF_TC_BODY(strtoi_signed, tc)
{
struct test t[] = {
{ "1", 1, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ " 2", 2, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ " 3", 3, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ " -3", -3, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "--1", 0, 0, "--1",
INTMAX_MIN, INTMAX_MAX, ECANCELED },
{ "+-2", 0, 0, "+-2",
INTMAX_MIN, INTMAX_MAX, ECANCELED },
{ "++3", 0, 0, "++3",
INTMAX_MIN, INTMAX_MAX, ECANCELED },
{ "+9", 9, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "+123", 123, 0, NULL,
INTMAX_MIN, INTMAX_MAX, 0 },
{ "-1 3", -1, 0, " 3",
INTMAX_MIN, INTMAX_MAX, ENOTSUP },
{ "-1.3", -1, 0, ".3",
INTMAX_MIN, INTMAX_MAX, ENOTSUP },
{ "- 3", 0, 0, "- 3",
INTMAX_MIN, INTMAX_MAX, ECANCELED },
{ "+33.", 33, 0, ".",
INTMAX_MIN, INTMAX_MAX, ENOTSUP },
{ "30x0", 30, 0, "x0",
INTMAX_MIN, INTMAX_MAX, ENOTSUP },
};

intmax_t rv;
char *end;
int e;
size_t i;

for (i = 0; i < __arraycount(t); i++) {

errno = 0;
rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);

check_errno(errno);

check(&t[i], rv, end, e);
}
}

ATF_TP_ADD_TCS(tp)
{

ATF_TP_ADD_TC(tp, strtoi_base);
ATF_TP_ADD_TC(tp, strtoi_case);
ATF_TP_ADD_TC(tp, strtoi_range);
ATF_TP_ADD_TC(tp, strtoi_range_trail);
ATF_TP_ADD_TC(tp, strtoi_signed);

return atf_no_error();
}
 1.3 20-Jan-2024  christos branches: 1.3.2;
Add range tests with trailing characters.
 1.2 28-Apr-2017  kamil branches: 1.2.12; 1.2.20;
Fix typo in ATF test t_strtoi.c

No functional change.
 1.1 01-May-2015  christos branches: 1.1.2; 1.1.8;
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
 1.1.8.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.1.2.2 16-May-2015  snj Pull up following revision(s) (requested by christos in ticket #781):
common/lib/libc/stdlib/strtoi.c: revision 1.2
common/lib/libc/stdlib/strtou.c: revision 1.2
distrib/sets/lists/debug/mi: revision 1.113
distrib/sets/lists/tests/mi: revision 1.617
lib/libc/include/namespace.h: revision 1.178
lib/libc/stdlib/Makefile.inc: revision 1.90 via patch
lib/libc/stdlib/strtoi.3: revisions 1.1, 1.2
lib/libc/stdlib/strtol.3: revision 1.32
lib/libc/stdlib/strtou.3: revisions 1.1, 1.2
lib/libc/stdlib/strtoul.3: revisions 1.30, 1.31
tests/lib/libc/stdlib/Makefile: revision 1.25
tests/lib/libc/stdlib/t_strtoi.c: revision 1.1
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
--
Sort ERRORS and SEE ALSO.
--
Sort ERRORS and SEE ALSO.
--
Sort SEE ALSO.
 1.1.2.1 01-May-2015  snj file t_strtoi.c was added on branch netbsd-7 on 2015-05-16 17:58:47 +0000
 1.2.20.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #792):

common/lib/libc/stdlib/_strtoi.h: revision 1.3
lib/libc/stdlib/strtou.3: revision 1.8
lib/libc/stdlib/strtonum.c: revision 1.7
lib/libc/stdlib/Makefile.inc: revision 1.97
lib/libc/stdlib/strtoi.3: revision 1.8
lib/libc/stdlib/strtoi.3: revision 1.9
lib/libc/stdlib/strtou.3: file removal
tests/lib/libc/stdlib/t_strtoi.c: revision 1.3

PR/57828: Alejandro Colomar: Prioritize test for ERANGE before testing for
fully consuming the string. Adjust strtonum(3) to behave as before. Document
the order of the tests and sync the man pages (I should really autogenerate
one of the two man pages...)

generate strtou.3 from strtoi.3, grammar police

Add range tests with trailing characters.
 1.2.12.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1870):

common/lib/libc/stdlib/_strtoi.h: revision 1.3
lib/libc/stdlib/strtou.3: revision 1.8
lib/libc/stdlib/strtonum.c: revision 1.7
lib/libc/stdlib/Makefile.inc: revision 1.97
lib/libc/stdlib/strtoi.3: revision 1.8
lib/libc/stdlib/strtoi.3: revision 1.9
lib/libc/stdlib/strtou.3: file removal
tests/lib/libc/stdlib/t_strtoi.c: revision 1.3

PR/57828: Alejandro Colomar: Prioritize test for ERANGE before testing for
fully consuming the string. Adjust strtonum(3) to behave as before. Document
the order of the tests and sync the man pages (I should really autogenerate
one of the two man pages...)
generate strtou.3 from strtoi.3, grammar police

Add range tests with trailing characters.
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.8 22-Jul-2024  christos Add strto{i,u}max tests and invalid base tests
 1.7 06-Jul-2017  joerg branches: 1.7.18;
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.6 01-Jun-2016  pgoyette branches: 1.6.8;
Fix testing of returned entptr, and fix three affected tests.

From kamil@ via PR lib/49632
 1.5 14-Jun-2011  jruoho branches: 1.5.2; 1.5.6; 1.5.22;
Remove the cases that cause integer overflow on e.g. i386.
 1.4 08-Jun-2011  jruoho Adjust types.
 1.3 05-Jun-2011  jruoho Do not blindly cast things (obviously makes the test fail).
 1.2 04-Jun-2011  haad Fix problem with overflowing constant definition

t_strtol.c:95: warning: overflow in implicit constant conversion
 1.1 04-Jun-2011  jruoho Add some tests for strtol(3).
 1.5.22.1 17-Nov-2017  snj Pull up following revision(s) (requested by joerg in ticket #1448):
common/lib/libc/stdlib/_strtol.h: revision 1.11
common/lib/libc/stdlib/_strtoul.h: revision 1.11
tests/lib/libc/stdlib/t_strtol.c: revision 1.7
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.5.6.1 26-Aug-2017  snj Pull up following revision(s) (requested by joerg in ticket #1460):
common/lib/libc/stdlib/_strtol.h: 1.11 via patch
common/lib/libc/stdlib/_strtoul.h: 1.11 via patch
tests/lib/libc/stdlib/t_strtol.c: 1.6-1.7
Fix testing of returned entptr, and fix three affected tests.
From kamil@ via PR lib/49632
--
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.5.2.2 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.5.2.1 14-Jun-2011  cherry file t_strtol.c was added on branch cherry-xenmp on 2011-06-23 14:20:40 +0000
 1.6.8.1 10-Jul-2017  martin Pull up following revision(s) (requested by joerg in ticket #112):
common/lib/libc/stdlib/_strtol.h: revision 1.11
common/lib/libc/stdlib/_strtoul.h: revision 1.11
tests/lib/libc/stdlib/t_strtol.c: revision 1.7
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.7.18.1 02-Aug-2025  perseant Sync with HEAD
 1.4 05-Apr-2011  jruoho Try to maintain the structure of libc and move 't_strtox' to 't_strtod'.
 1.3 22-Mar-2011  njoly Test case from PR/44189 should not fail anymore.
 1.2 06-Dec-2010  pooka Adjust PR format in xfail message so that html test results gain a
link to http://gnats.netbsd.org/44189
 1.1 03-Dec-2010  njoly Add testcase for PR/44189: strtod(3) wrong results with "-0x".
 1.1 11-Sep-2011  jruoho See that system(3) works.

RSS XML Feed