From patchwork Sun Mar 17 12:39:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Crowe X-Patchwork-Id: 31873 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 Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 9538 invoked by uid 89); 17 Mar 2019 12:39:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=H*MI:mac, outofbounds, out-of-bounds, suffered 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; }