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

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

Message

Joe Simmons-Talbott April 21, 2023, 1:24 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.

Chnages to v6:
  * string/test-strndup.c - Include the changes for v6 which were
    inadvertently left out.

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 | 198 +++++++++++++++++++++++++++++++++++++++++
 wcsmbs/Makefile       |   2 +-
 wcsmbs/test-wcsdup.c  |   2 +
 6 files changed, 406 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

Adhemerval Zanella Netto April 21, 2023, 2:07 p.m. UTC | #1
On 21/04/23 10:24, Joe Simmons-Talbott via Libc-alpha wrote:
> 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.

Hi Joe,

I appreciate you are working on this and I am aware you are a new 
contributor. However, the way this thread is being unrolled is becoming 
confusing and time consuming.  So some tips:

  - Please use a proper tool to send patches.  For more than one patch, 
    just use git send-email (as suggested by 'Contribution Checklist' [1])
    with --cover-letter and --annotate options (so you can double-check if
    something is off with the patches).  This avoid messing with 
    'in-reply-to', as you seems to have done in v7.

  - Avoid replying to an old thread with a new version.  It leads to some
    confusion depending of the email reader on how to organize the reply.

  - Always rebase and check the patchset against master. Both you v6 and
    v7 do not fully apply [2] due a recent wcsmbs/Makefile change from
    Florian.

  - Also, always address all the comments before send a new version.  
    For instance, you forgot some remarks on my v5 review [3].
    
I have fixed both last two bullet points on a personal branch [4], just
to avoid dragging this thread with another version. If you are ok with
this I can install it.

[1] https://sourceware.org/glibc/wiki/Contribution%20checklist
[2] https://patchwork.sourceware.org/project/glibc/patch/20230421132425.2178020-5-josimmon@redhat.com/
[3] https://sourceware.org/pipermail/libc-alpha/2023-April/147474.html
[4] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/bz30266
  
Joe Simmons-Talbott April 21, 2023, 2:43 p.m. UTC | #2
On Fri, Apr 21, 2023 at 11:07:54AM -0300, Adhemerval Zanella Netto wrote:
> 
> 
> On 21/04/23 10:24, Joe Simmons-Talbott via Libc-alpha wrote:
> > 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.
> 
> Hi Joe,
> 
> I appreciate you are working on this and I am aware you are a new 
> contributor. However, the way this thread is being unrolled is becoming 
> confusing and time consuming.  So some tips:

Hi Adhemerval,

Thank you for your thoughful reviews and feedback.  I'm sorry for making
this harder on you than needed.

> 
>   - Please use a proper tool to send patches.  For more than one patch, 
>     just use git send-email (as suggested by 'Contribution Checklist' [1])
>     with --cover-letter and --annotate options (so you can double-check if
>     something is off with the patches).  This avoid messing with 
>     'in-reply-to', as you seems to have done in v7.

I'm currently using 'git format-patch' to generate the patches and 'git
send-email' to send them.  I only pass '--cover-letter' to format-patch
and did indeed use --in-reply-to for subsequent versions.  I'll stop
doing that.

> 
>   - Avoid replying to an old thread with a new version.  It leads to some
>     confusion depending of the email reader on how to organize the reply.

Thanks for this tip.  I'll stop doing that.

> 
>   - Always rebase and check the patchset against master. Both you v6 and
>     v7 do not fully apply [2] due a recent wcsmbs/Makefile change from
>     Florian.

Sorry, I'll make sure to do this in the future.

> 
>   - Also, always address all the comments before send a new version.  
>     For instance, you forgot some remarks on my v5 review [3].

I neglected to 'git add' my changes before doing 'git commit --amend'
for v6 which was the reason for my v7.

>     
> I have fixed both last two bullet points on a personal branch [4], just
> to avoid dragging this thread with another version. If you are ok with
> this I can install it.

I'm okay with this.  Thank you again for all of your help on this
patchset.

Thanks,
Joe

> 
> [1] https://sourceware.org/glibc/wiki/Contribution%20checklist
> [2] https://patchwork.sourceware.org/project/glibc/patch/20230421132425.2178020-5-josimmon@redhat.com/
> [3] https://sourceware.org/pipermail/libc-alpha/2023-April/147474.html
> [4] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/bz30266
>