From 29db3b90328498474388e9cfb2c8ef6d816c05c2 Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 3 Dec 2016 02:47:16 +0000 Subject: MFC r305358: Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox --- contrib/netbsd-tests/lib/libpthread/t_rwlock.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'contrib/netbsd-tests/lib/libpthread/t_rwlock.c') diff --git a/contrib/netbsd-tests/lib/libpthread/t_rwlock.c b/contrib/netbsd-tests/lib/libpthread/t_rwlock.c index b2a3d6f..81f8c58 100644 --- a/contrib/netbsd-tests/lib/libpthread/t_rwlock.c +++ b/contrib/netbsd-tests/lib/libpthread/t_rwlock.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_rwlock.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */ +/* $NetBSD: t_rwlock.c,v 1.2 2015/06/26 11:07:20 pooka Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_rwlock.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $"); +__RCSID("$NetBSD: t_rwlock.c,v 1.2 2015/06/26 11:07:20 pooka Exp $"); #include #include @@ -70,6 +70,8 @@ pthread_rwlock_t lk; struct timespec to; +static pthread_rwlock_t static_rwlock = PTHREAD_RWLOCK_INITIALIZER; + /* ARGSUSED */ static void * do_nothing(void *dummy) @@ -117,9 +119,23 @@ ATF_TC_BODY(rwlock1, tc) "%s", strerror(error)); } +ATF_TC(rwlock_static); +ATF_TC_HEAD(rwlock_static, tc) +{ + atf_tc_set_md_var(tc, "descr", "rwlock w/ static initializer"); +} +ATF_TC_BODY(rwlock_static, tc) +{ + + PTHREAD_REQUIRE(pthread_rwlock_rdlock(&static_rwlock)); + PTHREAD_REQUIRE(pthread_rwlock_unlock(&static_rwlock)); + PTHREAD_REQUIRE(pthread_rwlock_destroy(&static_rwlock)); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, rwlock1); + ATF_TP_ADD_TC(tp, rwlock_static); return atf_no_error(); } -- cgit v1.1