From patchwork Tue Apr 11 19:05:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Simmons-Talbott X-Patchwork-Id: 1767823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=y1x8SPGe; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PwwKW31nCz1yZY for ; Wed, 12 Apr 2023 05:05:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 615A23857357 for ; Tue, 11 Apr 2023 19:05:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 615A23857357 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681239949; bh=vs+OHN/AOeV6eFcKG8BgIfAbDVWTNkUMyWK1GXQCyCU=; 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=y1x8SPGemtLP2czfMHJ+S0KeGl6OMhurSzvS1MPEuCJ5Dby8bu7jeCFp6FUKQVpP7 MyTFtHeTBi4j8gvX1D3Aro4Oe1AENm5Rt/Pvh0Sdcs6JGPJgOnkF9qzk1uVFrI9kTq iRib7uHrL1xUSz33oAdtXnbkVD7Tzt7F1TJTMF6s= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id BBF3F3858D28 for ; Tue, 11 Apr 2023 19:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BBF3F3858D28 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-77-oUufN71KM_GEQyuI74u6AQ-1; Tue, 11 Apr 2023 15:05:32 -0400 X-MC-Unique: oUufN71KM_GEQyuI74u6AQ-1 Received: by mail-qv1-f69.google.com with SMTP id px18-20020a056214051200b005bb308e7c12so4820293qvb.19 for ; Tue, 11 Apr 2023 12:05:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681239931; x=1683831931; 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=vs+OHN/AOeV6eFcKG8BgIfAbDVWTNkUMyWK1GXQCyCU=; b=avSpwdEnRW26AyTywkY65QTQAX6TXA04M8cbJ678pN1nKJ9P4VuZJuG9sEV2YeF7Ts DzA0QtWnY7ZqsEbH8MX6ndPneVyND1mn+/fB1nOtcglr7bWeB4dx6osAA+N8CAG075Gl szBGA707MjISLzth6WitP6H4gUI7nJftUdzgZ6jy8+VERNGnt4pxqy9Jn69pB4duGSt7 Nnh05nYlVQF3sO4HlG7t/3u4pHoIfeuxK1gMC/jlErql3473cjswi7aUi/d6ZORfVzeR mRe01VOQtWAzR1E5/hnDfrc8HSNpURPXMWSugg2THQyfvd7bmIzQgME2Hgsj/iLfQVKb k/wg== X-Gm-Message-State: AAQBX9eetUvRiI+wfJC8fSODHzUzHNhmTaMnhZO/qgZD4GnTaD09Jygj 5heuKlhE/cx/4fCey23dX5iANgQCRseLiCyB9P/79Mu6t5xqBGkch1HQ+UW5nb2/VnHfd5e3ODK KEWYD58boElkMZiPI8lBWCgmtC/q/jNwdCla/7gmWUNu0/tXpjQKAp9Iq4E0tXanbf9RF5MV1Ao e4AJmM X-Received: by 2002:a05:622a:11c7:b0:3e1:78b5:7198 with SMTP id n7-20020a05622a11c700b003e178b57198mr381409qtk.8.1681239931250; Tue, 11 Apr 2023 12:05:31 -0700 (PDT) X-Google-Smtp-Source: AKy350YT2EB5c2Ffo3otvSgTg5biJHJY+tjumQehUQPAGe5hcFRus6jIARTq/H8DFXYD871E+sjh1A== X-Received: by 2002:a05:622a:11c7:b0:3e1:78b5:7198 with SMTP id n7-20020a05622a11c700b003e178b57198mr381361qtk.8.1681239930835; Tue, 11 Apr 2023 12:05:30 -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 x1-20020ac85381000000b003e014845d9esm3760434qtp.74.2023.04.11.12.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 12:05:30 -0700 (PDT) To: libc-alpha@sourceware.org Cc: Joe Simmons-Talbott Subject: [PATCH v5 0/4] string: Add tests for strdup and strndup (BZ #30266) Date: Tue, 11 Apr 2023 15:05:22 -0400 Message-Id: <20230411190526.2469122-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 X-Spam-Status: No, score=-6.0 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Joe Simmons-Talbott via Libc-alpha From: Joe Simmons-Talbott Reply-To: Joe Simmons-Talbott Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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