opnsense-src/lib/libc/tests/string
Robert Clausecker 61ed5748e4 lib/libc/tests/string: improve memccpy "bounds" unit test
The purpose of the "bounds" test is to check that the function does not
overread the array bounds.  The old unit test, copied from the strlcpy()
one, always ensured that we see the character c memccpy() is looking for
in the source array before the array ends.  While this is correct for
strlcpy(), memccpy()'s specification does not guarantee that c is
present within the given size limit.

The updated test handles this case better, ensuring that the source
array ends early if c is not supposed to be present.

Reported by:	getz
Approved by:	emaste
See also:	D46052
Event:		GSoC 2024
Differential Revision:	https://reviews.freebsd.org/D46051
2024-09-14 20:42:19 +02:00
..
bcmp_test.c lib/libc/tests/string: expand memcmp test to bcmp, timingsafe_{b,mem}cmp 2023-10-02 15:25:31 -04:00
ffs_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
ffsl_test.c lib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll 2023-07-03 22:18:27 +02:00
ffsll_test.c lib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll 2023-07-03 22:18:27 +02:00
fls_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
flsl_test.c lib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll 2023-07-03 22:18:27 +02:00
flsll_test.c lib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll 2023-07-03 22:18:27 +02:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
memccpy_test.c lib/libc/tests/string: improve memccpy "bounds" unit test 2024-09-14 20:42:19 +02:00
memcmp_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
memrchr_test.c lib/libc/tests/string: add memrchr unit tests 2023-12-25 14:59:58 +01:00
memset_s_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
memset_test.c libc: Add memset test for int-to-char conversion 2024-07-13 15:07:49 +02:00
stpncpy_test.c lib/libc/tests/string/stpncpy_test.c: extend for upcoming SSE implementation 2023-12-25 14:55:37 +01:00
strcmp_test.c lib/libc/tests/string: add extended unit tests for strcmp() 2023-11-14 12:37:06 -05:00
strcspn_test.c lib/libc/tests/string/strcspn_test.c: add test for correct match order 2023-12-21 03:16:57 +01:00
strerror_test.c Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
strlcpy_test.c lib/libc/tests/string: add unit test for strlcpy 2023-12-25 14:56:02 +01:00
strncmp_test.c lib/libc/tests/string: add unit tests for strncmp(3) 2023-12-25 14:55:08 +01:00
strspn_test.c lib/libc/tests/string: derive strspn(3) tests from strcspn(3) tests 2023-09-08 17:21:59 -04:00
strverscmp_test.c libc: Add strverscmp(3) and versionsort(3) 2022-08-25 03:29:03 +03:00
strxfrm_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
timingsafe_bcmp_test.c lib/libc/tests/string: expand memcmp test to bcmp, timingsafe_{b,mem}cmp 2023-10-02 15:25:31 -04:00
timingsafe_memcmp_test.c lib/libc/tests/string: expand memcmp test to bcmp, timingsafe_{b,mem}cmp 2023-10-02 15:25:31 -04:00
wcscasecmp_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
wcscoll_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
wcsnlen_test.c libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00