xref: /netbsd-src/tests/include/t_stdint.c (revision 6cbeb05cb20f0676d73f66093fc3f76ca6232827)
1*6cbeb05cSjmmv /* $NetBSD: t_stdint.c,v 1.1 2010/07/17 19:26:27 jmmv Exp $ */
2*6cbeb05cSjmmv 
3*6cbeb05cSjmmv /*
4*6cbeb05cSjmmv  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
5*6cbeb05cSjmmv  * All rights reserved.
6*6cbeb05cSjmmv  *
7*6cbeb05cSjmmv  * Redistribution and use in source and binary forms, with or without
8*6cbeb05cSjmmv  * modification, are permitted provided that the following conditions
9*6cbeb05cSjmmv  * are met:
10*6cbeb05cSjmmv  * 1. Redistributions of source code must retain the above copyright
11*6cbeb05cSjmmv  *    notice, this list of conditions and the following disclaimer.
12*6cbeb05cSjmmv  * 2. Redistributions in binary form must reproduce the above copyright
13*6cbeb05cSjmmv  *    notice, this list of conditions and the following disclaimer in the
14*6cbeb05cSjmmv  *    documentation and/or other materials provided with the distribution.
15*6cbeb05cSjmmv  *
16*6cbeb05cSjmmv  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17*6cbeb05cSjmmv  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18*6cbeb05cSjmmv  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19*6cbeb05cSjmmv  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20*6cbeb05cSjmmv  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*6cbeb05cSjmmv  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*6cbeb05cSjmmv  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*6cbeb05cSjmmv  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*6cbeb05cSjmmv  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*6cbeb05cSjmmv  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*6cbeb05cSjmmv  * POSSIBILITY OF SUCH DAMAGE.
27*6cbeb05cSjmmv  */
28*6cbeb05cSjmmv 
29*6cbeb05cSjmmv #include <sys/cdefs.h>
30*6cbeb05cSjmmv __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
31*6cbeb05cSjmmv  The NetBSD Foundation, inc. All rights reserved.");
32*6cbeb05cSjmmv __RCSID("$NetBSD: t_stdint.c,v 1.1 2010/07/17 19:26:27 jmmv Exp $");
33*6cbeb05cSjmmv 
34*6cbeb05cSjmmv #include <stdint.h>
35*6cbeb05cSjmmv 
36*6cbeb05cSjmmv #include <atf-c.h>
37*6cbeb05cSjmmv 
38*6cbeb05cSjmmv ATF_TC_WITHOUT_HEAD(int8);
ATF_TC_BODY(int8,tc)39*6cbeb05cSjmmv ATF_TC_BODY(int8, tc)
40*6cbeb05cSjmmv {
41*6cbeb05cSjmmv 	ATF_CHECK(INT8_MIN < UINT8_MAX);
42*6cbeb05cSjmmv }
43*6cbeb05cSjmmv 
44*6cbeb05cSjmmv ATF_TC_WITHOUT_HEAD(int16);
ATF_TC_BODY(int16,tc)45*6cbeb05cSjmmv ATF_TC_BODY(int16, tc)
46*6cbeb05cSjmmv {
47*6cbeb05cSjmmv 	ATF_CHECK(INT16_MIN < UINT16_MAX);
48*6cbeb05cSjmmv }
49*6cbeb05cSjmmv 
ATF_TP_ADD_TCS(tp)50*6cbeb05cSjmmv ATF_TP_ADD_TCS(tp)
51*6cbeb05cSjmmv {
52*6cbeb05cSjmmv 
53*6cbeb05cSjmmv 	ATF_TP_ADD_TC(tp, int8);
54*6cbeb05cSjmmv 	ATF_TP_ADD_TC(tp, int16);
55*6cbeb05cSjmmv 
56*6cbeb05cSjmmv 	return atf_no_error();
57*6cbeb05cSjmmv }
58