mbox series

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

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

Message

Joe Simmons-Talbott April 11, 2023, 7:05 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 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  | 203 ++++++++++++++++++++++++++++++++++++++++++
 string/test-string.h  |   4 +-
 string/test-strndup.c | 200 +++++++++++++++++++++++++++++++++++++++++
 wcsmbs/Makefile       |   2 +-
 wcsmbs/test-wcsdup.c  |   2 +
 6 files changed, 410 insertions(+), 3 deletions(-)
 create mode 100644 string/test-strdup.c
 create mode 100644 string/test-strndup.c
 create mode 100644 wcsmbs/test-wcsdup.c

Comments

Joe Simmons-Talbott April 19, 2023, 2:24 p.m. UTC | #1
On Tue, Apr 11, 2023 at 03:05:22PM -0400, Joe Simmons-Talbott wrote:

Gentle ping.

Thanks,
Joe
> 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 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  | 203 ++++++++++++++++++++++++++++++++++++++++++
>  string/test-string.h  |   4 +-
>  string/test-strndup.c | 200 +++++++++++++++++++++++++++++++++++++++++
>  wcsmbs/Makefile       |   2 +-
>  wcsmbs/test-wcsdup.c  |   2 +
>  6 files changed, 410 insertions(+), 3 deletions(-)
>  create mode 100644 string/test-strdup.c
>  create mode 100644 string/test-strndup.c
>  create mode 100644 wcsmbs/test-wcsdup.c
> 
> -- 
> 2.39.2
>