xref: /freebsd/contrib/netbsd-tests/lib/libc/gen/t_syslog.c (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1 /*	$NetBSD: t_syslog.c,v 1.2 2012/03/18 07:00:51 jruoho Exp $ */
2 
3 /*-
4  * Copyright (c) 2010 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in
14  *    the documentation and/or other materials provided with the
15  *    distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
23  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
27  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  */
30 
31 #include <sys/types.h>
32 
33 #include <atf-c.h>
34 #include <syslog.h>
35 
36 ATF_TC(syslog_pthread);
37 ATF_TC_HEAD(syslog_pthread, tc)
38 {
39 
40 	atf_tc_set_md_var(tc, "descr", "Test that syslog(3) "
41 	    "works when linked to pthread(3) (PR lib/44248)");
42 	atf_tc_set_md_var(tc, "timeout", "2");
43 }
44 
45 ATF_TC_BODY(syslog_pthread, tc)
46 {
47 	syslog(LOG_DEBUG, "from tests/lib/libc/gen/t_syslog");
48 }
49 
50 ATF_TP_ADD_TCS(tp)
51 {
52 
53 	ATF_TP_ADD_TC(tp, syslog_pthread);
54 
55 	return atf_no_error();
56 }
57