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

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

Message

Joe Simmons-Talbott April 20, 2023, 4:54 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 v5:
  * string/test-strdup.c - Don't use UCHAR and avoid the casts.
  * string/test-strndup.c - Don't use unsigned char and avoid the casts.
    Minor style cleanup.

Changes to v4:
  * string/test-strndup.c - Remove no longer needed defines.  Remove
    unneeded comments.  Minor style cleanup.

Changes to v3:
  * string/test-strdup.c - Style cleanup.  Make sure we're using CHAR
    rather than char for wide character support.
  * string/test-strndup.c - Remove unneeded wide character support since
    there is no wcsndup().  Use TEST_COMPARE_BLOB rather than memcmp().
  * wcsmbs - Enable wcsdup() testcases.

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 (4):
  string: Allow use of test-string.h for non-ifunc implementations.
  string: Add tests for strdup (BZ #30266)
  string: Add tests for strndup (BZ #30266)
  wcsmbs: Add wcsdup() tests. (BZ #30266)

 string/Makefile       |   2 +
 string/test-strdup.c  | 201 ++++++++++++++++++++++++++++++++++++++++++
 string/test-string.h  |   4 +-
 string/test-strndup.c | 200 +++++++++++++++++++++++++++++++++++++++++
 wcsmbs/Makefile       |   2 +-
 wcsmbs/test-wcsdup.c  |   2 +
 6 files changed, 408 insertions(+), 3 deletions(-)
 create mode 100644 string/test-strdup.c
 create mode 100644 string/test-strndup.c
 create mode 100644 wcsmbs/test-wcsdup.c