Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/lib/libc The nsdispatch test has been atf-ified.
details: https://anonhg.NetBSD.org/src/rev/b78af9f117a2
branches: trunk
changeset: 760477:b78af9f117a2
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Jan 05 21:20:25 2011 +0000
description:
The nsdispatch test has been atf-ified.
diffstat:
regress/lib/libc/Makefile | 5 +-
regress/lib/libc/nsdispatch/Makefile | 5 -
regress/lib/libc/nsdispatch/recurse/Makefile | 18 ------
regress/lib/libc/nsdispatch/recurse/expected | 6 --
regress/lib/libc/nsdispatch/recurse/recurse.c | 78 ---------------------------
5 files changed, 2 insertions(+), 110 deletions(-)
diffs (136 lines):
diff -r d4dff9ea89f5 -r b78af9f117a2 regress/lib/libc/Makefile
--- a/regress/lib/libc/Makefile Wed Jan 05 21:18:29 2011 +0000
+++ b/regress/lib/libc/Makefile Wed Jan 05 21:20:25 2011 +0000
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.72 2011/01/04 14:22:06 pgoyette Exp $
+# $NetBSD: Makefile,v 1.73 2011/01/05 21:20:25 pgoyette Exp $
-SUBDIR+= citrus db divrem getaddrinfo int_fmtio locale \
- nsdispatch regex rpc sys time
+SUBDIR+= citrus db divrem getaddrinfo int_fmtio locale regex rpc sys time
.include <bsd.own.mk>
.include <bsd.sys.mk>
diff -r d4dff9ea89f5 -r b78af9f117a2 regress/lib/libc/nsdispatch/Makefile
--- a/regress/lib/libc/nsdispatch/Makefile Wed Jan 05 21:18:29 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2004/08/02 00:16:25 thorpej Exp $
-
-SUBDIR= recurse
-
-.include <bsd.subdir.mk>
diff -r d4dff9ea89f5 -r b78af9f117a2 regress/lib/libc/nsdispatch/recurse/Makefile
--- a/regress/lib/libc/nsdispatch/recurse/Makefile Wed Jan 05 21:18:29 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2004/08/02 00:16:25 thorpej Exp $
-
-NOMAN= # defined
-PROG= recurse
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
-
-CLEANFILES+= output
-
-regress: ${PROG}
- ./${PROG} > output
- if cmp ${.CURDIR}/expected output; then \
- echo PASSED; \
- else \
- echo FAILED; exit 1; \
- fi
-
-.include <bsd.prog.mk>
diff -r d4dff9ea89f5 -r b78af9f117a2 regress/lib/libc/nsdispatch/recurse/expected
--- a/regress/lib/libc/nsdispatch/recurse/expected Wed Jan 05 21:18:29 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-func1: enter
-func2: enter
-func3: enter
-func3: exit
-func2: exit
-func1: exit
diff -r d4dff9ea89f5 -r b78af9f117a2 regress/lib/libc/nsdispatch/recurse/recurse.c
--- a/regress/lib/libc/nsdispatch/recurse/recurse.c Wed Jan 05 21:18:29 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/* $NetBSD: recurse.c,v 1.3 2006/05/10 19:07:22 mrg Exp $ */
-
-/*
- * Written by Jason R. Thorpe, August 1, 2004.
- * Public domain.
- */
-
-#define _REENTRANT
-
-#include <assert.h>
-#include <nsswitch.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <stdio.h>
-
-static const ns_src testsrc[] = {
- { "test", NS_SUCCESS },
- { 0 }
-};
-
-static int
-func3(void *rv, void *cb_data, va_list ap)
-{
-
- printf("func3: enter\n");
- printf("func3: exit\n");
- return (NS_SUCCESS);
-}
-
-static int
-func2(void *rv, void *cb_data, va_list ap)
-{
- static const ns_dtab dtab[] = {
- { "test", func3, NULL },
- { 0 }
- };
- int r;
-
- printf("func2: enter\n");
- r = nsdispatch(NULL, dtab, "test", "test", testsrc);
- printf("func2: exit\n");
- return (r);
-}
-
-static int
-func1(void)
-{
- static const ns_dtab dtab[] = {
- { "test", func2, NULL },
- { 0 }
- };
- int r;
-
- printf("func1: enter\n");
- r = nsdispatch(NULL, dtab, "test", "test", testsrc);
- printf("func1: exit\n");
- return (r);
-}
-
-static void *
-thrfunc(void *arg)
-{
-
- pthread_exit(NULL);
-}
-
-int
-main(int argc, char *argv[])
-{
- pthread_t thr;
- void *threval;
-
- assert(pthread_create(&thr, NULL, thrfunc, NULL) == 0);
- assert(func1() == NS_SUCCESS);
- assert(pthread_join(thr, &threval) == 0);
- exit(0);
-}
Home |
Main Index |
Thread Index |
Old Index