Module Name:    src
Committed By:   pooka
Date:           Fri Dec 17 19:12:30 UTC 2010

Modified Files:
        src/tests/lib/libc/gen: Makefile
Added Files:
        src/tests/lib/libc/gen: t_syslog_pthread.c

Log Message:
Add an isolated test case for PR lib/44248.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/gen/t_syslog_pthread.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.1 src/tests/lib/libc/gen/Makefile:1.2
--- src/tests/lib/libc/gen/Makefile:1.1	Mon Sep  6 14:41:21 2010
+++ src/tests/lib/libc/gen/Makefile	Fri Dec 17 19:12:30 2010
@@ -1,9 +1,12 @@
-# $NetBSD: Makefile,v 1.1 2010/09/06 14:41:21 christos Exp $
+# $NetBSD: Makefile,v 1.2 2010/12/17 19:12:30 pooka Exp $
 
 .include <bsd.own.mk>
 
 TESTSDIR=	${TESTSBASE}/lib/libc/gen
 
 TESTS_C+=	t_glob_star
+TESTS_C+=	t_syslog_pthread
+
+LDADD.t_syslog_pthread+=-lpthread
 
 .include <bsd.test.mk>

Added files:

Index: src/tests/lib/libc/gen/t_syslog_pthread.c
diff -u /dev/null src/tests/lib/libc/gen/t_syslog_pthread.c:1.1
--- /dev/null	Fri Dec 17 19:12:30 2010
+++ src/tests/lib/libc/gen/t_syslog_pthread.c	Fri Dec 17 19:12:30 2010
@@ -0,0 +1,56 @@
+/*	$NetBSD: t_syslog_pthread.c,v 1.1 2010/12/17 19:12:30 pooka 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 COPYRIGHT HOLDERS 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
+ * COPYRIGHT HOLDERS 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/types.h>
+
+#include <atf-c.h>
+#include <syslog.h>
+
+ATF_TC(basic);
+ATF_TC_HEAD(basic, tc)
+{
+
+	atf_tc_set_md_var(tc, "descr", "Test that syslog works at all");
+	atf_tc_set_md_var(tc, "timeout", "2");
+}
+
+ATF_TC_BODY(basic, tc)
+{
+
+	atf_tc_expect_timeout("PR lib/44248");
+	syslog(LOG_DEBUG, "from tests/lib/libc/gen/t_syslog_pthread");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+	ATF_TP_ADD_TC(tp, basic);
+
+	return atf_no_error();
+}

Reply via email to