Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src As per PR lib/44818, remove 'lib/libpthread/t_status'. It ta...



details:   https://anonhg.NetBSD.org/src/rev/42b960529cb2
branches:  trunk
changeset: 763906:42b960529cb2
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Apr 06 16:04:16 2011 +0000

description:
As per PR lib/44818, remove 'lib/libpthread/t_status'. It takes two minutes
to rewrite this properly if someone misses this.

diffstat:

 distrib/sets/lists/tests/mi     |    6 +-
 tests/lib/libpthread/Makefile   |    3 +-
 tests/lib/libpthread/t_status.c |  124 ----------------------------------------
 3 files changed, 4 insertions(+), 129 deletions(-)

diffs (172 lines):

diff -r 41e2fe7503af -r 42b960529cb2 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Wed Apr 06 15:31:08 2011 +0000
+++ b/distrib/sets/lists/tests/mi       Wed Apr 06 16:04:16 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.296 2011/04/06 09:35:49 jruoho Exp $
+# $NetBSD: mi,v 1.297 2011/04/06 16:04:16 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -488,7 +488,7 @@
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_sigsuspend.debug                tests-lib-tests         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_siglongjmp.debug                tests-lib-tests         debug,atf
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_sleep.debug             tests-lib-tests         debug,atf
-./usr/libdata/debug/usr/tests/lib/libpthread/t_status.debug            tests-lib-tests         debug,atf
+./usr/libdata/debug/usr/tests/lib/libpthread/t_status.debug            tests-obsolete          obsolete
 ./usr/libdata/debug/usr/tests/lib/librt                                        tests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/librt/t_sched.debug                  tests-lib-debug         debug,atf
 ./usr/libdata/debug/usr/tests/lib/librt/t_sem.debug                    tests-lib-debug         debug,atf
@@ -1974,7 +1974,7 @@
 ./usr/tests/lib/libpthread/t_sigsuspend                tests-lib-tests         atf
 ./usr/tests/lib/libpthread/t_siglongjmp                tests-lib-tests         atf
 ./usr/tests/lib/libpthread/t_sleep             tests-lib-tests         atf
-./usr/tests/lib/libpthread/t_status            tests-lib-tests         atf
+./usr/tests/lib/libpthread/t_status            tests-obsolete          obsolete
 ./usr/tests/lib/librt                          tests-lib-tests         atf
 ./usr/tests/lib/librt/Atffile                  tests-lib-tests         atf
 ./usr/tests/lib/librt/t_sched                  tests-lib-tests         atf
diff -r 41e2fe7503af -r 42b960529cb2 tests/lib/libpthread/Makefile
--- a/tests/lib/libpthread/Makefile     Wed Apr 06 15:31:08 2011 +0000
+++ b/tests/lib/libpthread/Makefile     Wed Apr 06 16:04:16 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2011/03/24 13:52:04 jruoho Exp $
+# $NetBSD: Makefile,v 1.7 2011/04/06 16:04:16 jruoho Exp $
 
 NOMAN=         # defined
 
@@ -35,7 +35,6 @@
 TESTS_C+=      t_sigsuspend
 TESTS_C+=      t_siglongjmp
 TESTS_C+=      t_sleep
-TESTS_C+=      t_status
 
 LDADD.t_sem+=  -lrt
 
diff -r 41e2fe7503af -r 42b960529cb2 tests/lib/libpthread/t_status.c
--- a/tests/lib/libpthread/t_status.c   Wed Apr 06 15:31:08 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/* $NetBSD: t_status.c,v 1.2 2010/11/03 16:10:22 christos Exp $ */
-
-/*
- * Copyright (c) 2010 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__COPYRIGHT("@(#) Copyright (c) 2010\
- The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_status.c,v 1.2 2010/11/03 16:10:22 christos Exp $");
-
-#include <sys/resource.h>
-#include <sys/wait.h>
-
-#include <err.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <atf-c.h>
-
-#define NUM 100
-
-static void *
-threadfunc(void *arg)
-{
-
-       sleep(1000);
-       return 0;
-}
-
-static int
-child(const int seed)
-{
-       pthread_t thr[NUM];
-       int i, j, res, errors;
-       char nam[20];
-       struct rlimit sl;
-
-       srandom(seed);
-       getrlimit(RLIMIT_STACK, &sl);
-
-       errors = 0;
-       for (i = 0; i < NUM; i++) {
-               res = pthread_create(&thr[i], 0, threadfunc, 0);
-               if (res)
-                       errx(1, "pthread_create iter %d: %s", i, strerror(res));
-               for (j = 0; j <= i; j++) {
-                       res = pthread_getname_np(thr[j], nam, sizeof(nam));
-                       if (res) {
-                               warnx("getname(%d/%d): %s\n", i, j,
-                                   strerror(res));
-                               errors++;
-                       }
-               }
-               if (errors)
-                       break;
-               malloc((random() & 7) * sl.rlim_cur);
-       }
-       if (errors)
-               printf("%d errors; seed was %d\n", errors, seed);
-       return errors > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
-}
-
-static void
-do_test(const int seed)
-{
-       pid_t pid = fork();
-       ATF_REQUIRE(pid != -1);
-       if (pid == 0) {
-               exit(child(seed));
-       } else {
-               int status;
-               ATF_CHECK_EQ(pid, waitpid(pid, &status, 0));
-               if (!(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS))
-                       atf_tc_fail_nonfatal("Check with seed %d failed", seed);
-       }
-}
-
-ATF_TC(findthreads);
-ATF_TC_HEAD(findthreads, tc)
-{
-       atf_tc_set_md_var(tc, "descr", "Tests libpthread's ability to remember "
-           "the tests it has created");
-}
-ATF_TC_BODY(findthreads, tc)
-{
-       int i;
-
-       for (i = 0; i < 100; i++)
-               do_test(i);
-}
-
-ATF_TP_ADD_TCS(tp)
-{
-
-       ATF_TP_ADD_TC(tp, findthreads);
-
-       return atf_no_error();
-}



Home | Main Index | Thread Index | Old Index