From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4AEF920248 for ; Sun, 17 Mar 2019 12:39:49 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=PmtH0N19rJwvLYhQqsKgr0QcBLUu0OnjAc5M+YRIL5nA0hJIyYcSk 2wkcjIn5ioSWua68ojkd4NPy3AldNoFmS8SCxhDIlPmDdLCw5B5a4a34mm6n47PJ OT+/wRgfUzvXKm+n7QBBgYd5Gu3IALHsdCB3Wvr7puODKYrIs/u6DQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=bBJHS24D80e0UekdyOf5VtGxy0Q=; b=Pijz4wwPmGktAl6w7BzBSVEPsm0N av/U+M6vAi62I8OW0uvhy0LOBm+snUSgcZ1Vpwc2Pwg4UHpwKk7LfvjbNmpLtSRO AW/7KUzLAm+1JmQvWvR1Gq5YsiILxgqdzYE3Z76Sa+FEVyartJs42/fq8YqJmYqy CLQaFggt4fn8HWY= Received: (qmail 9547 invoked by alias); 17 Mar 2019 12:39:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 9538 invoked by uid 89); 17 Mar 2019 12:39:46 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: avasout04.plus.net X-CM-Score: 0.00 From: Mike Crowe To: libc-alpha@sourceware.org Cc: Mike Crowe Subject: [PATCH v2] nptl/tst-rwlock14: Test pthread_rwlock_timedwrlock correctly Date: Sun, 17 Mar 2019 12:39:30 +0000 Message-Id: <20190317123930.34689-1-mac@mcrowe.com> The tests for out-of-bounds timespecs first test pthread_rwlock_timedrdlock and then pthread_rwlock_timedwrlock. It appears that the second and third tests suffered from copy-and-paste errors and each test pthread_rwlock_timedrdlock twice in a row. Let's correct that so that pthread_rwlock_timedwrlock is tested too. * nptl/tst-rwlock14.c (do_test): Replace duplicate calls to pthread_rwlock_timedrdlock with calls to pthread_rwlock_timedwrlock to ensure that the latter is tested too. Use new function name in diagnostic messages too. --- ChangeLog | 7 +++++++ nptl/tst-rwlock14.c | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) This patch was originally sent as part of a larger series: https://sourceware.org/ml/libc-alpha/2019-02/msg00643.html diff --git a/ChangeLog b/ChangeLog index f7c9ee51ad..248bc05351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2019-03-17 Mike Crowe + + * nptl/tst-rwlock14.c (do_test): Replace duplicate calls to + pthread_rwlock_timedrdlock with calls to pthread_rwlock_timedwrlock to + ensure that the latter is tested too. Use new function name in diagnostic + messages too. + 2019-03-16 Samuel Thibault * hurd/hurd/signal.h (_hurd_critical_section_lock): Document how EINTR diff --git a/nptl/tst-rwlock14.c b/nptl/tst-rwlock14.c index f8c218395e..6f57169531 100644 --- a/nptl/tst-rwlock14.c +++ b/nptl/tst-rwlock14.c @@ -117,15 +117,15 @@ do_test (void) result = 1; } - e = pthread_rwlock_timedrdlock (&r, &ts); + e = pthread_rwlock_timedwrlock (&r, &ts); if (e == 0) { - puts ("second rwlock_timedrdlock did not fail"); + puts ("second rwlock_timedwrlock did not fail"); result = 1; } else if (e != EINVAL) { - puts ("second rwlock_timedrdlock did not return EINVAL"); + puts ("second rwlock_timedwrlock did not return EINVAL"); result = 1; } @@ -145,15 +145,15 @@ do_test (void) result = 1; } - e = pthread_rwlock_timedrdlock (&r, &ts); + e = pthread_rwlock_timedwrlock (&r, &ts); if (e == 0) { - puts ("third rwlock_timedrdlock did not fail"); + puts ("third rwlock_timedwrlock did not fail"); result = 1; } else if (e != EINVAL) { - puts ("third rwlock_timedrdlock did not return EINVAL"); + puts ("third rwlock_timedwrlock did not return EINVAL"); result = 1; } -- 2.11.0