From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 620E0385773C for ; Fri, 21 Apr 2023 13:24:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 620E0385773C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682083471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yJbLocLBX5lPBOP8gndbJ4mgj13RJvsubsPGgLuzO2Q=; b=QyxUMpY8UccC5iF4CIJonr6ccv5290ZQwGD/qlhsKkTGnNhRt/z85Sa+73ypaUUjL/QbQU XS75IxVdGHep4pth2A2bEvVqoCZXBEbdfCizNUjftBCs3thUobap0UmzmlzbJINy9E0mfO qdWweIJ+d9uk9wAW7Bv5rjBUP8SBcjQ= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-Okyd3NdtOVicRY8yuW6z7g-1; Fri, 21 Apr 2023 09:24:29 -0400 X-MC-Unique: Okyd3NdtOVicRY8yuW6z7g-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-74e1cdf9cbeso764307785a.0 for ; Fri, 21 Apr 2023 06:24:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682083469; x=1684675469; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yJbLocLBX5lPBOP8gndbJ4mgj13RJvsubsPGgLuzO2Q=; b=Nf478rXDYA/qHgikWspenGvyg1+kEdqJHlWHD0Qluz0g9xBImIjo6xvVGY1J/oJptS nXl2BhinjT2LZL6CPCkZex5sUF8/wB8yqt8QtXsnIcnG2eSJ88FV3B+JX/x2RvzRoMfV 1sEou/uz1/om60Yrg6zJQGN/rx0zRFuSOsXus1kqAUVpoNLkCuLQm7fHHCwupWOuxXWm ZLykUFuY+OMclWAwyp7oz6jjGPbT/TewyKGUzTK+UhC+JdsezIC+nu5KV4rb28cy1Hin deeVNqoPAhqVR2gwJ+Sun/RUgn2i3VXKWMr4MQAPtaJjCIXB4h1ER0OzJtOW5sLur8a3 bXzQ== X-Gm-Message-State: AAQBX9eZ9WkLxWaGwArueqyyHNDEmbF1nTRkgcY0TAtH55JyOORdLDNo mV2FgDmZteWvNpM1v30wIVbjxqq2B3PTvw7Ewknis7BsLrgMkIbwU7FV5L41t7Ahzjn001hscOl FVVhsKCdEWlyRz7ChoRvwXSVTBPnYfVs1SR1kE2LUOkwcqhVHta0fJv7LkG6cBCxDL1GQDASHgm pNEoSZ X-Received: by 2002:a05:622a:1348:b0:3ef:3c45:b659 with SMTP id w8-20020a05622a134800b003ef3c45b659mr8142743qtk.17.1682083468899; Fri, 21 Apr 2023 06:24:28 -0700 (PDT) X-Google-Smtp-Source: AKy350Y3BB6rcnh1aTmdzxPAjtbdCQwAbBUnrGwpr4WRndr/8CvH1gH+Mbb7qvKYHqlpG8/5xn2AHQ== X-Received: by 2002:a05:622a:1348:b0:3ef:3c45:b659 with SMTP id w8-20020a05622a134800b003ef3c45b659mr8142715qtk.17.1682083468567; Fri, 21 Apr 2023 06:24:28 -0700 (PDT) Received: from oak.redhat.com (c-71-206-142-238.hsd1.va.comcast.net. [71.206.142.238]) by smtp.gmail.com with ESMTPSA id w23-20020ac843d7000000b003d7e923736asm1328458qtn.6.2023.04.21.06.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 06:24:27 -0700 (PDT) From: Joe Simmons-Talbott To: libc-alpha@sourceware.org Cc: Joe Simmons-Talbott Subject: [PATCH v7 0/4] string: Add tests for strdup and strndup (BZ #30266) Date: Fri, 21 Apr 2023 09:24:21 -0400 Message-Id: <20230421132425.2178020-1-josimmon@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329150500.2886135-1-josimmon@redhat.com> References: <20230329150500.2886135-1-josimmon@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 -- 2.39.2