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