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.129.124]) by sourceware.org (Postfix) with ESMTPS id 3576A3858C52 for ; Mon, 10 Apr 2023 15:59:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3576A3858C52 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=1681142381; 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=FPdyerRlY345K20JSrigz8HuXvW2Cr6LFlL852k0So0=; b=BUsVcsai64OtCBFx7qntawcvp1+FqcV8n8VZXAWrb4dOvjdQ/81XOr8AD0Ym8sYSjxVCO4 QWkhens+QHTLl80ri8+hVmri9iZ3f+0oa5fO3dDDGe3jNMjvo1lWZJz056hGmC+RBJ5LqY aL2UVEjZTPg6EJ4waQiQkLYbQpj8NKk= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-145-_vTDVUeWNCOqAHFVm5w-0A-1; Mon, 10 Apr 2023 11:59:40 -0400 X-MC-Unique: _vTDVUeWNCOqAHFVm5w-0A-1 Received: by mail-qt1-f200.google.com with SMTP id bp42-20020a05622a1baa00b003e6748b05edso11192873qtb.2 for ; Mon, 10 Apr 2023 08:59:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681142380; x=1683734380; 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=FPdyerRlY345K20JSrigz8HuXvW2Cr6LFlL852k0So0=; b=7T81Pt2CiUI+354KFkstPhRr2VEuEPtIbHdBSitCXDewqOL/+cxBKKblhcCVt6U8t2 P4Id3iKAu7TfcF6v1RuOovt6OY118TSfwZh4vIPxLcIqjBqZst3PLQIW7/OFztwZw/co HUAnf3ChA4pBA1+9TRG9b0Pi7F6L10/D+NQjnQxkA9r4v8AwWKhvoBRZdifDEcR7xTqK yBqvOCLE178h/TZjcCkQAhcgN3MXecV4EfBZSoytdRMeSMYCJCgnm1Tjvy1ifx/mvY6W Lnn5t314bhIgSP2pDHOgQi6CigGnapquWSImR96YQ/jVqk7MT5861mcDL7m9/WidCELQ 0Anw== X-Gm-Message-State: AAQBX9fhy/uK/ANWy3egikXGFVwY/0t4O7kqvyfHFqLJr3CfvNX0h6mo xe8KnZ7y20MjBjKCsMRmDn5dB9h+zsNiph0ucTTl7wWS+gfVCurvZwBqxyBi2LoO8pB98ue4gPA RX84ueN4+nFoJWntlE56iUu/uTZvNN1GsuAQiGqOWtj+ItOKjCSzZrOp8XM0RiB3Zq/g5F/GvFA bEBLkb X-Received: by 2002:a05:6214:2627:b0:5c8:dc85:ea0d with SMTP id gv7-20020a056214262700b005c8dc85ea0dmr22940633qvb.26.1681142379805; Mon, 10 Apr 2023 08:59:39 -0700 (PDT) X-Google-Smtp-Source: AKy350ZLu5jbFLF5TNGUGVJLHjvtjvc9caWtt/OLoDudg6jgws7QseoRzehEtGjr/IePAKsPuI6tQw== X-Received: by 2002:a05:6214:2627:b0:5c8:dc85:ea0d with SMTP id gv7-20020a056214262700b005c8dc85ea0dmr22940595qvb.26.1681142379460; Mon, 10 Apr 2023 08:59:39 -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 h2-20020ad45442000000b005dd8b9345e0sm3470413qvt.120.2023.04.10.08.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 08:59:38 -0700 (PDT) From: Joe Simmons-Talbott To: libc-alpha@sourceware.org Cc: Joe Simmons-Talbott Subject: [PATCH v4 0/4] string: Add tests for strdup and strndup (BZ #30266) Date: Mon, 10 Apr 2023 11:59:30 -0400 Message-Id: <20230410155934.3503627-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 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. 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 (3): 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) string/Makefile | 2 + string/test-strdup.c | 203 ++++++++++++++++++++++++++++++++++++++ string/test-string.h | 4 +- string/test-strndup.c | 222 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 429 insertions(+), 2 deletions(-) create mode 100644 string/test-strdup.c create mode 100644 string/test-strndup.c -- 2.39.2