Boot-to-ramdisk image generation scripts
[minix3.git] / tests / include / t_errno.c
blob763e5697aadf3a04825a469b1788895eb82d6218
1 /* $NetBSD: t_errno.c,v 1.1 2011/05/01 17:07:05 jruoho Exp $ */
3 /*-
4 * Copyright (c) 2011 The NetBSD Foundation, Inc.
5 * All rights reserved.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jukka Ruohonen.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
31 #include <sys/cdefs.h>
32 __RCSID("$NetBSD: t_errno.c,v 1.1 2011/05/01 17:07:05 jruoho Exp $");
34 #include <atf-c.h>
35 #include <errno.h>
37 ATF_TC(errno_constants);
38 ATF_TC_HEAD(errno_constants, tc)
40 atf_tc_set_md_var(tc, "descr", "Test POSIX constants in <errno.h>");
43 ATF_TC_BODY(errno_constants, tc)
45 bool fail;
48 * The following definitions should be available
49 * according to IEEE Std 1003.1-2008, issue 7.
51 atf_tc_expect_fail("PR standards/44921");
53 fail = true;
55 #ifdef E2BIG
56 fail = false;
57 #endif
58 if (fail != false)
59 atf_tc_fail_nonfatal("E2BIG not defined");
61 fail = true;
63 #ifdef EACCES
64 fail = false;
65 #endif
66 if (fail != false)
67 atf_tc_fail_nonfatal("EACCES not defined");
69 fail = true;
71 #ifdef EADDRINUSE
72 fail = false;
73 #endif
74 if (fail != false)
75 atf_tc_fail_nonfatal("EADDRINUSE not defined");
77 fail = true;
79 #ifdef EADDRNOTAVAIL
80 fail = false;
81 #endif
82 if (fail != false)
83 atf_tc_fail_nonfatal("EADDRNOTAVAIL not defined");
85 fail = true;
87 #ifdef EAFNOSUPPORT
88 fail = false;
89 #endif
90 if (fail != false)
91 atf_tc_fail_nonfatal("EAFNOSUPPORT not defined");
93 fail = true;
95 #ifdef EAGAIN
96 fail = false;
97 #endif
98 if (fail != false)
99 atf_tc_fail_nonfatal("EAGAIN not defined");
101 fail = true;
103 #ifdef EALREADY
104 fail = false;
105 #endif
106 if (fail != false)
107 atf_tc_fail_nonfatal("EALREADY not defined");
109 fail = true;
111 #ifdef EBADF
112 fail = false;
113 #endif
114 if (fail != false)
115 atf_tc_fail_nonfatal("EBADF not defined");
117 fail = true;
119 #ifdef EBADMSG
120 fail = false;
121 #endif
122 if (fail != false)
123 atf_tc_fail_nonfatal("EBADMSG not defined");
125 fail = true;
127 #ifdef EBUSY
128 fail = false;
129 #endif
130 if (fail != false)
131 atf_tc_fail_nonfatal("EBUSY not defined");
133 fail = true;
135 #ifdef ECANCELED
136 fail = false;
137 #endif
138 if (fail != false)
139 atf_tc_fail_nonfatal("ECANCELED not defined");
141 fail = true;
143 #ifdef ECHILD
144 fail = false;
145 #endif
146 if (fail != false)
147 atf_tc_fail_nonfatal("ECHILD not defined");
149 fail = true;
151 #ifdef ECONNABORTED
152 fail = false;
153 #endif
154 if (fail != false)
155 atf_tc_fail_nonfatal("ECONNABORTED not defined");
157 fail = true;
159 #ifdef ECONNREFUSED
160 fail = false;
161 #endif
162 if (fail != false)
163 atf_tc_fail_nonfatal("ECONNREFUSED not defined");
165 fail = true;
167 #ifdef ECONNRESET
168 fail = false;
169 #endif
170 if (fail != false)
171 atf_tc_fail_nonfatal("ECONNRESET not defined");
173 fail = true;
175 #ifdef EDEADLK
176 fail = false;
177 #endif
178 if (fail != false)
179 atf_tc_fail_nonfatal("EDEADLK not defined");
181 fail = true;
183 #ifdef EDESTADDRREQ
184 fail = false;
185 #endif
186 if (fail != false)
187 atf_tc_fail_nonfatal("EDESTADDRREQ not defined");
189 fail = true;
191 #ifdef EDOM
192 fail = false;
193 #endif
194 if (fail != false)
195 atf_tc_fail_nonfatal("EDOM not defined");
197 fail = true;
199 #ifdef EDQUOT
200 fail = false;
201 #endif
202 if (fail != false)
203 atf_tc_fail_nonfatal("EDQUOT not defined");
205 fail = true;
207 #ifdef EEXIST
208 fail = false;
209 #endif
210 if (fail != false)
211 atf_tc_fail_nonfatal("EEXIST not defined");
213 fail = true;
215 #ifdef EFAULT
216 fail = false;
217 #endif
218 if (fail != false)
219 atf_tc_fail_nonfatal("EFAULT not defined");
221 fail = true;
223 #ifdef EFBIG
224 fail = false;
225 #endif
226 if (fail != false)
227 atf_tc_fail_nonfatal("EFBIG not defined");
229 fail = true;
231 #ifdef EHOSTUNREACH
232 fail = false;
233 #endif
234 if (fail != false)
235 atf_tc_fail_nonfatal("EHOSTUNREACH not defined");
237 fail = true;
239 #ifdef EIDRM
240 fail = false;
241 #endif
242 if (fail != false)
243 atf_tc_fail_nonfatal("EIDRM not defined");
245 fail = true;
247 #ifdef EILSEQ
248 fail = false;
249 #endif
251 if (fail != false)
252 atf_tc_fail_nonfatal("EILSEQ not defined");
254 fail = true;
256 #ifdef EINPROGRESS
257 fail = false;
258 #endif
260 if (fail != false)
261 atf_tc_fail_nonfatal("EINPROGRESS not defined");
263 fail = true;
265 #ifdef EINTR
266 fail = false;
267 #endif
269 if (fail != false)
270 atf_tc_fail_nonfatal("EINTR not defined");
272 fail = true;
274 #ifdef EINVAL
275 fail = false;
276 #endif
278 if (fail != false)
279 atf_tc_fail_nonfatal("EINVAL not defined");
281 fail = true;
283 #ifdef EIO
284 fail = false;
285 #endif
287 if (fail != false)
288 atf_tc_fail_nonfatal("EIO not defined");
290 fail = true;
292 #ifdef EISCONN
293 fail = false;
294 #endif
296 if (fail != false)
297 atf_tc_fail_nonfatal("EISCONN not defined");
299 fail = true;
301 #ifdef EISDIR
302 fail = false;
303 #endif
305 if (fail != false)
306 atf_tc_fail_nonfatal("EISDIR not defined");
308 fail = true;
310 #ifdef ELOOP
311 fail = false;
312 #endif
314 if (fail != false)
315 atf_tc_fail_nonfatal("ELOOP not defined");
317 fail = true;
319 #ifdef EMFILE
320 fail = false;
321 #endif
323 if (fail != false)
324 atf_tc_fail_nonfatal("EMFILE not defined");
326 fail = true;
328 #ifdef EMLINK
329 fail = false;
330 #endif
332 if (fail != false)
333 atf_tc_fail_nonfatal("EMLINK not defined");
335 fail = true;
337 #ifdef EMSGSIZE
338 fail = false;
339 #endif
341 if (fail != false)
342 atf_tc_fail_nonfatal("EMSGSIZE not defined");
344 fail = true;
346 #ifdef EMULTIHOP
347 fail = false;
348 #endif
350 if (fail != false)
351 atf_tc_fail_nonfatal("EMULTIHOP not defined");
353 fail = true;
355 #ifdef ENAMETOOLONG
356 fail = false;
357 #endif
359 if (fail != false)
360 atf_tc_fail_nonfatal("ENAMETOOLONG not defined");
362 fail = true;
364 #ifdef ENETDOWN
365 fail = false;
366 #endif
368 if (fail != false)
369 atf_tc_fail_nonfatal("ENETDOWN not defined");
371 fail = true;
373 #ifdef ENETRESET
374 fail = false;
375 #endif
377 if (fail != false)
378 atf_tc_fail_nonfatal("ENETRESET not defined");
380 fail = true;
382 #ifdef ENETUNREACH
383 fail = false;
384 #endif
386 if (fail != false)
387 atf_tc_fail_nonfatal("ENETUNREACH not defined");
389 fail = true;
391 #ifdef ENFILE
392 fail = false;
393 #endif
395 if (fail != false)
396 atf_tc_fail_nonfatal("ENFILE not defined");
398 fail = true;
400 #ifdef ENOBUFS
401 fail = false;
402 #endif
404 if (fail != false)
405 atf_tc_fail_nonfatal("ENOBUFS not defined");
407 fail = true;
409 #ifdef ENODATA
410 fail = false;
411 #endif
413 if (fail != false)
414 atf_tc_fail_nonfatal("ENODATA not defined");
416 fail = true;
418 #ifdef ENODEV
419 fail = false;
420 #endif
422 if (fail != false)
423 atf_tc_fail_nonfatal("ENODEV not defined");
425 fail = true;
427 #ifdef ENOENT
428 fail = false;
429 #endif
431 if (fail != false)
432 atf_tc_fail_nonfatal("ENOENT not defined");
434 fail = true;
436 #ifdef ENOEXEC
437 fail = false;
438 #endif
440 if (fail != false)
441 atf_tc_fail_nonfatal("ENOEXEC not defined");
443 fail = true;
445 #ifdef ENOLCK
446 fail = false;
447 #endif
449 if (fail != false)
450 atf_tc_fail_nonfatal("ENOLCK not defined");
452 fail = true;
454 #ifdef ENOLINK
455 fail = false;
456 #endif
458 if (fail != false)
459 atf_tc_fail_nonfatal("ENOLINK not defined");
461 fail = true;
463 #ifdef ENOMEM
464 fail = false;
465 #endif
467 if (fail != false)
468 atf_tc_fail_nonfatal("ENOMEM not defined");
470 fail = true;
472 #ifdef ENOMSG
473 fail = false;
474 #endif
476 if (fail != false)
477 atf_tc_fail_nonfatal("ENOMSG not defined");
479 fail = true;
481 #ifdef ENOPROTOOPT
482 fail = false;
483 #endif
485 if (fail != false)
486 atf_tc_fail_nonfatal("ENOPROTOOPT not defined");
488 fail = true;
490 #ifdef ENOSPC
491 fail = false;
492 #endif
494 if (fail != false)
495 atf_tc_fail_nonfatal("ENOSPC not defined");
497 fail = true;
499 #ifdef ENOSR
500 fail = false;
501 #endif
503 if (fail != false)
504 atf_tc_fail_nonfatal("ENOSR not defined");
506 fail = true;
508 #ifdef ENOSTR
509 fail = false;
510 #endif
512 if (fail != false)
513 atf_tc_fail_nonfatal("ENOSTR not defined");
515 fail = true;
517 #ifdef ENOSYS
518 fail = false;
519 #endif
521 if (fail != false)
522 atf_tc_fail_nonfatal("ENOSYS not defined");
524 fail = true;
526 #ifdef ENOTCONN
527 fail = false;
528 #endif
530 if (fail != false)
531 atf_tc_fail_nonfatal("ENOTCONN not defined");
533 fail = true;
535 #ifdef ENOTDIR
536 fail = false;
537 #endif
539 if (fail != false)
540 atf_tc_fail_nonfatal("ENOTDIR not defined");
542 fail = true;
544 #ifdef ENOTEMPTY
545 fail = false;
546 #endif
548 if (fail != false)
549 atf_tc_fail_nonfatal("ENOTEMPTY not defined");
551 fail = true;
553 #ifdef ENOTRECOVERABLE
554 fail = false;
555 #endif
557 if (fail != false)
558 atf_tc_fail_nonfatal("ENOTRECOVERABLE not defined");
560 fail = true;
562 #ifdef ENOTSOCK
563 fail = false;
564 #endif
566 if (fail != false)
567 atf_tc_fail_nonfatal("ENOTSOCK not defined");
569 fail = true;
571 #ifdef ENOTSUP
572 fail = false;
573 #endif
575 if (fail != false)
576 atf_tc_fail_nonfatal("ENOTSUP not defined");
578 fail = true;
580 #ifdef ENOTTY
581 fail = false;
582 #endif
584 if (fail != false)
585 atf_tc_fail_nonfatal("ENOTTY not defined");
587 fail = true;
589 #ifdef ENXIO
590 fail = false;
591 #endif
593 if (fail != false)
594 atf_tc_fail_nonfatal("ENXIO not defined");
596 fail = true;
598 #ifdef EOPNOTSUPP
599 fail = false;
600 #endif
602 if (fail != false)
603 atf_tc_fail_nonfatal("EOPNOTSUPP not defined");
605 fail = true;
607 #ifdef EOVERFLOW
608 fail = false;
609 #endif
611 if (fail != false)
612 atf_tc_fail_nonfatal("EOVERFLOW not defined");
614 fail = true;
616 #ifdef EOWNERDEAD
617 fail = false;
618 #endif
620 if (fail != false)
621 atf_tc_fail_nonfatal("EOWNERDEAD not defined");
623 fail = true;
625 #ifdef EPERM
626 fail = false;
627 #endif
629 if (fail != false)
630 atf_tc_fail_nonfatal("EPERM not defined");
632 fail = true;
634 #ifdef EPIPE
635 fail = false;
636 #endif
638 if (fail != false)
639 atf_tc_fail_nonfatal("EPIPE not defined");
641 fail = true;
643 #ifdef EPROTO
644 fail = false;
645 #endif
647 if (fail != false)
648 atf_tc_fail_nonfatal("EPROTO not defined");
650 fail = true;
652 #ifdef EPROTONOSUPPORT
653 fail = false;
654 #endif
656 if (fail != false)
657 atf_tc_fail_nonfatal("EPROTONOSUPPORT not defined");
659 fail = true;
661 #ifdef EPROTOTYPE
662 fail = false;
663 #endif
665 if (fail != false)
666 atf_tc_fail_nonfatal("EPROTOTYPE not defined");
668 fail = true;
670 #ifdef ERANGE
671 fail = false;
672 #endif
674 if (fail != false)
675 atf_tc_fail_nonfatal("ERANGE not defined");
677 fail = true;
679 #ifdef EROFS
680 fail = false;
681 #endif
683 if (fail != false)
684 atf_tc_fail_nonfatal("EROFS not defined");
686 fail = true;
688 #ifdef ESPIPE
689 fail = false;
690 #endif
692 if (fail != false)
693 atf_tc_fail_nonfatal("ESPIPE not defined");
695 fail = true;
697 #ifdef ESRCH
698 fail = false;
699 #endif
701 if (fail != false)
702 atf_tc_fail_nonfatal("ESRCH not defined");
704 fail = true;
706 #ifdef ESTALE
707 fail = false;
708 #endif
710 if (fail != false)
711 atf_tc_fail_nonfatal("ESTALE not defined");
713 fail = true;
715 #ifdef ETIME
716 fail = false;
717 #endif
719 if (fail != false)
720 atf_tc_fail_nonfatal("ETIME not defined");
722 fail = true;
724 #ifdef ETIMEDOUT
725 fail = false;
726 #endif
728 if (fail != false)
729 atf_tc_fail_nonfatal("ETIMEDOUT not defined");
731 fail = true;
733 #ifdef ETXTBSY
734 fail = false;
735 #endif
737 if (fail != false)
738 atf_tc_fail_nonfatal("ETXTBSY not defined");
740 fail = true;
742 #ifdef EWOULDBLOCK
743 fail = false;
744 #endif
746 if (fail != false)
747 atf_tc_fail_nonfatal("EWOULDBLOCK not defined");
749 fail = true;
751 #ifdef EXDEV
752 fail = false;
753 #endif
755 if (fail != false)
756 atf_tc_fail_nonfatal("EXDEV not defined");
759 ATF_TP_ADD_TCS(tp)
762 ATF_TP_ADD_TC(tp, errno_constants);
764 return atf_no_error();