<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/tests/string, branch release/14.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-01-04T13:25:21Z</updated>
<entry>
<title>libc/tests/string: improve stpncpy() "bounds" unit test</title>
<updated>2026-01-04T13:25:21Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2025-12-04T16:34:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e2f095779323204e90843b405863c81dc02423d2'/>
<id>urn:sha1:e2f095779323204e90843b405863c81dc02423d2</id>
<content type='text'>
The test is extended the same way I previously extended the memccpy()
test to fix what is probably the same kind of bug.

PR:		291359
Reported by:	Collin Funk &lt;collin.funk1@gmail.com&gt;
Reviewed by:	ngie
Approved by:	markj (mentor)
Fixes:		6fa9e7d8737548ef93c573387ce62402c368d486 (D42519)
See also:	61ed5748e4e9c7397fcb2638b442f46ac5c9e7c5 (D46051)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54169

lib/libc/tests/string/stpncpy_test.c: apply ngie's fixes

(cherry picked from commit 123c086200491819595abc271d360e605288fd18)
(cherry picked from commit 8be8642826099368208efb2c1222f2a102cc5b08)
</content>
</entry>
<entry>
<title>lib/libc/tests/string: add memrchr unit tests</title>
<updated>2024-01-24T19:39:30Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-12-06T09:11:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=acb47064d65813386dc15f6278037f1a76ec7eab'/>
<id>urn:sha1:acb47064d65813386dc15f6278037f1a76ec7eab</id>
<content type='text'>
The "values" test case is specifically crafted to detect the off-by-one
error previous discovered in the scalar strchrnul implementation.

Tested by:	developers@, exp-run
Approved by:	mjg
MFC after:	1 month
MFC to:		stable/14
PR:		275785
Differential Revision:	https://reviews.freebsd.org/D42925

(cherry picked from commit 691ff1832e09a6ccbc8f5b04c88cafc7452b3ce6)
</content>
</entry>
<entry>
<title>lib/libc/tests/string: add unit tests for memccpy()</title>
<updated>2024-01-24T19:39:29Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-12-03T11:42:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=de2d155d2cac49025958d927aaaef66d99bcb537'/>
<id>urn:sha1:de2d155d2cac49025958d927aaaef66d99bcb537</id>
<content type='text'>
Adapted from the strlcpy() unit tests.

Tested by:	developers@, exp-run
Approved by:	mjg
MFC after:	1 month
MFC to:		stable/14
PR:		275785

(cherry picked from commit e4b7b0bcbc741f0998640c2ba55ec00ba613bb75)
</content>
</entry>
<entry>
<title>lib/libc/tests/string: add unit test for strlcpy</title>
<updated>2024-01-24T19:39:28Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-11-09T18:08:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f5d63ae20d653e12d3617704e6317e3c8c50b640'/>
<id>urn:sha1:f5d63ae20d653e12d3617704e6317e3c8c50b640</id>
<content type='text'>
A straightforward derivation from the stpncpy unit test.

Sponsored by:	The FreeBSD Foundation
Tested by:	developers@, exp-run
Approved by:	mjg
MFC after:	1 month
MFC to:		stable/14
PR:		275785
Differential Revision:	https://reviews.freebsd.org/D42863

(cherry picked from commit f7098b8659923873a7c60b64cb68182e470786f9)
</content>
</entry>
<entry>
<title>lib/libc/tests/string/stpncpy_test.c: extend for upcoming SSE implementation</title>
<updated>2024-01-24T19:39:27Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-11-05T04:02:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=438a1ff803a5d033b80b16880b2718f1402d904f'/>
<id>urn:sha1:438a1ff803a5d033b80b16880b2718f1402d904f</id>
<content type='text'>
This adds additional unit tests validating the function for
All possible alignment offsets of source and destination.

Also extend the test to allow testing of an external stpncpy
implementation, which greatly simplifies the development of
custom implementations.

Sponsored by:	The FreeBSD Foundation
Tested by:	developers@, exp-run
Approved by:	mjg
MFC after:	1 month
MFC to:		stable/14
PR:		275785
Differential Revision:	https://reviews.freebsd.org/D42519

(cherry picked from commit 6fa9e7d8737548ef93c573387ce62402c368d486)
</content>
</entry>
<entry>
<title>lib/libc/tests/string: add unit tests for strncmp(3)</title>
<updated>2024-01-24T19:39:25Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-09-28T20:40:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=098997c5f05e157f2fae2787ec9a8b372156d487'/>
<id>urn:sha1:098997c5f05e157f2fae2787ec9a8b372156d487</id>
<content type='text'>
These are patterned after the previously added (D41970)
strcmp tests, but are extended to check for various length
conditions.

Sponsored by:	The FreeBSD Foundation
Tested by:	developers@, exp-run
Approved by:	mjg
MFC after:	1 month
MFC to:		stable/14
PR:		275785
Differential Revision:	https://reviews.freebsd.org/D42122

(cherry picked from commit 459ddefcc9dcc010f6f7445285e61e2b6780379c)
</content>
</entry>
<entry>
<title>lib/libc/tests/string/strcspn_test.c: add test for correct match order</title>
<updated>2023-12-28T17:02:41Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-12-19T16:27:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=08ad297599ee6c40b4346699dac81d71f1933f18'/>
<id>urn:sha1:08ad297599ee6c40b4346699dac81d71f1933f18</id>
<content type='text'>
This new unit test verifies that if there are multiple
matches, the first match is returned, ignoring later
matches.

Approved by:	mjg (blanket, via IRC)
MFC after:	1 week
MFC to:		stable/14

(cherry picked from commit a0ecf2224ea35d029d33541878f0eee42f5fd84f)
</content>
</entry>
<entry>
<title>lib/libc/tests/string: expand memcmp test to bcmp, timingsafe_{b,mem}cmp</title>
<updated>2023-12-28T17:02:41Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-08-30T15:30:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c91cfb7f9e7de392ca47b3092e981bf7c2fca86b'/>
<id>urn:sha1:c91cfb7f9e7de392ca47b3092e981bf7c2fca86b</id>
<content type='text'>
The four functions more or less perform the same operation.
Reuse the same unit test with slight changes so we can cover
them all.  Constant-time operation is not verified for the
timingsafe_* functions.

Sponsored by:	The FreeBSD Foundation
Approved by:	ngie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41528

(cherry picked from commit c6cc06d465a98270ef734ffec7c9012ec3a1bd17)
</content>
</entry>
<entry>
<title>lib/libc/tests/string/memcmp_test.c: extend test to support custom memcmp function</title>
<updated>2023-12-28T17:02:41Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-07-14T11:56:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7aaa37fa1db603fe10143b03ed07f3a8db771484'/>
<id>urn:sha1:7aaa37fa1db603fe10143b03ed07f3a8db771484</id>
<content type='text'>
Extend the tests to permit loading an external memcmp function
and testing it over using the libc version. This was added by the
example of other tests in the test suite doing the same thing and
helped tremendously in development.

This change was originally part of D41442 but was taken out to
permit separate review as extrapolated from @ngie's request in
D41349.

Sponsored by:	FreeBSD Foundation
Approved by:	ngie
Differential Revision:	https://reviews.freebsd.org/D41528

(cherry picked from commit b166580681e3af173ec368656019d02ba1cc55ad)
</content>
</entry>
<entry>
<title>lib/libc/tests/string: add extended unit tests for strcmp()</title>
<updated>2023-12-28T17:02:40Z</updated>
<author>
<name>Robert Clausecker</name>
<email>fuz@FreeBSD.org</email>
</author>
<published>2023-09-22T20:42:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c35334b085616c8ad9a567a04cb1a5cbf6b76a80'/>
<id>urn:sha1:c35334b085616c8ad9a567a04cb1a5cbf6b76a80</id>
<content type='text'>
This changeset add a new set of tests that comprehensively test strcmp() on
various alignments of the input. This made it easy to smoke out many
exciting new bugs in the new SSE strcmp() implementation from D41971.

MFC after:	1 week
Reviewed by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41970

(cherry picked from commit b49596de2622a51e5673ba2c0b3718cd88a2aa41)
</content>
</entry>
</feed>
