[v3,0/3] string: Add tests for strdup and strndup (BZ #30266)

Message ID 20230404190040.2507343-1-josimmon@redhat.com
Headers
Series string: Add tests for strdup and strndup (BZ #30266) |

Message

Joe Simmons-Talbott April 4, 2023, 7 p.m. UTC
  Copy strcpy and strncpy tests to strdup and strndup repectively.  Remove
tests that checked the surrounding bytes of the result as they are not needed.

Changes to v2: Remove the rest of the ifunc bits.  Mark two variables as
unused so that we can use string/test-string.h for functions that aren't
ifuncs.

Changes to v1: Since strdup and strndup are not ifuncs and likely won't
be, call them directly.  Use TEST_COMPARE_BLOB() rather than memcmp().
Clear up wording in a comment.


Joe Simmons-Talbott (3):
  string: Allow use of test-string.h for non-ifunc implementations.
  string: Add tests for strdup (BZ #30266)
  Add tests for strndup (BZ #30266)

 string/Makefile       |   2 +
 string/test-strdup.c  | 201 +++++++++++++++++++++++++++++++++
 string/test-string.h  |   4 +-
 string/test-strndup.c | 250 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 455 insertions(+), 2 deletions(-)
 create mode 100644 string/test-strdup.c
 create mode 100644 string/test-strndup.c