Message ID | 20230420165458.2096593-1-josimmon@redhat.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC6153858C20 for <patchwork@sourceware.org>; Thu, 20 Apr 2023 16:55:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC6153858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682009731; bh=Nzsu2rSiB1eW2PLATCiXzFaY4GDV+yMQWmaby+9cG3M=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=c1qp5ESkJ9jp4vGNilFIxusqH8zBcw5qzHy+5S34Yu95AwkB/LsHAV1aKRW3W1/on q98CDsW6Dou8X9lhCHFe88IgRDo8hX4wG4vxwsGDgRd2VriJGCEd36BcN27GsVfTbZ F5p3mne/vWPUQEoEpIgofhL6lyYmRmHIVQ2cA9OA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 515633858D37 for <libc-alpha@sourceware.org>; Thu, 20 Apr 2023 16:55:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 515633858D37 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-316-7kwwtjhvMvuPNpp3EWEPww-1; Thu, 20 Apr 2023 12:55:02 -0400 X-MC-Unique: 7kwwtjhvMvuPNpp3EWEPww-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-3ef388e1fd5so5896611cf.0 for <libc-alpha@sourceware.org>; Thu, 20 Apr 2023 09:55:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682009701; x=1684601701; 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=Nzsu2rSiB1eW2PLATCiXzFaY4GDV+yMQWmaby+9cG3M=; b=UerqMNQwsT04V6Lp7uEIMQkBgnDNwGLlOZtI8dybdquDj0BDC+qcSXGoeb/t5om49f ohBRZ8XdCwtALHz5b8ZB0b36rlaA8lnoG65U48q0uSDbQ2USL21D6EnVvtJjCPGl/cJ8 WyTfryNfSQcP7DvKCnkpkJlO0nhAWq1UY1D3xu6LfOpG/XEs1g0pv5w6KrE3o6BbDJYv MtjH6h/RstoFo0PR0tQLiysnNOOOqsEfmfhuytGiuD67o54qDeGMJMg2PZ93k+noxaYl Xn3dNXHuYPpjqCTHSMKvqfXcFQaaWNXrnIRHoeZz7XSzuX0iQbEbw6dzZtd6bQMpOg3u 0OTA== X-Gm-Message-State: AAQBX9d2QynKjEAIDBG7dZs14HjXJiUuVFDyfxop3RFCW3HC/ZOTl46z p4MSS7JGW64ZcmymVboG0hgtaSBF5XEi/4qBQgdhlsjqZHxiF9bdoRA0CzCgeYjhHKVZlemevba csNtcty++1ik+2Y9t0eGs63Y6LgCiPJgk8PPL5Z7qhG86HJEwheGJwwvoT5ccK5DbFVx3v41XwQ IWJEy2 X-Received: by 2002:a05:622a:18a9:b0:3e6:35ec:8a9f with SMTP id v41-20020a05622a18a900b003e635ec8a9fmr3425990qtc.59.1682009701680; Thu, 20 Apr 2023 09:55:01 -0700 (PDT) X-Google-Smtp-Source: AKy350awZaGyCz2b7TRQI8qcUvGjH6X9ZhFYwr8HXZQF8262vFkVRsBvBmauT80x6ohAuByMLEyC7w== X-Received: by 2002:a05:622a:18a9:b0:3e6:35ec:8a9f with SMTP id v41-20020a05622a18a900b003e635ec8a9fmr3425958qtc.59.1682009701359; Thu, 20 Apr 2023 09:55:01 -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 bq12-20020a05620a468c00b0074688c36facsm556496qkb.56.2023.04.20.09.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 09:55:00 -0700 (PDT) To: libc-alpha@sourceware.org Cc: Joe Simmons-Talbott <josimmon@redhat.com> Subject: [PATCH v6 0/4] string: Add tests for strdup and strndup (BZ #30266) Date: Thu, 20 Apr 2023 12:54:54 -0400 Message-Id: <20230420165458.2096593-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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Joe Simmons-Talbott via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Joe Simmons-Talbott <josimmon@redhat.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
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