annotate tests/test-inttypes.c @ 15681:c21e706c88b2

Tests for module 'shutdown'. * modules/shutdown-tests: New file. * tests/test-shutdown.c: New file.
author Bruno Haible <bruno@clisp.org>
date Tue, 20 Sep 2011 21:38:04 +0200
parents 97fc9a21a8fb
children 8151b33f4264
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8172
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of <inttypes.h> substitute.
14079
97fc9a21a8fb maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents: 12559
diff changeset
2 Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
8172
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8172
diff changeset
4 This program is free software: you can redistribute it and/or modify
8172
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8172
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8172
diff changeset
7 (at your option) any later version.
8172
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 8172
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8172
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #define __STDC_FORMAT_MACROS 1 /* to make it work also in C++ mode */
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #include <inttypes.h>
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <stddef.h>
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 /* Tests for macros supposed to be defined in inttypes.h. */
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 const char *k = /* implicit string concatenation */
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 #ifdef INT8_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 PRId8 PRIi8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 #ifdef UINT8_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 PRIo8 PRIu8 PRIx8 PRIX8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #ifdef INT16_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 PRId16 PRIi16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 #ifdef UINT16_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 PRIo16 PRIu16 PRIx16 PRIX16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 #ifdef INT32_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 PRId32 PRIi32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 #ifdef UINT32_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 PRIo32 PRIu32 PRIx32 PRIX32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 #ifdef INT64_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 PRId64 PRIi64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 #ifdef UINT64_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 PRIo64 PRIu64 PRIx64 PRIX64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 PRIdLEAST64 PRIiLEAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 PRIdFAST64 PRIiFAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 #ifdef INTPTR_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 PRIdPTR PRIiPTR
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 #ifdef UINTPTR_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 PRIoPTR PRIuPTR PRIxPTR PRIXPTR
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 ;
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 const char *l = /* implicit string concatenation */
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 #ifdef INT8_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 SCNd8 SCNi8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 #ifdef UINT8_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 SCNo8 SCNu8 SCNx8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 #ifdef INT16_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 SCNd16 SCNi16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 #ifdef UINT16_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 SCNo16 SCNu16 SCNx16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 #ifdef INT32_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 SCNd32 SCNi32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 #ifdef UINT32_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 SCNo32 SCNu32 SCNx32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 #ifdef INT64_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 SCNd64 SCNi64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 #ifdef UINT64_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 SCNo64 SCNu64 SCNx64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 SCNdLEAST64 SCNiLEAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 SCNoLEAST64 SCNuLEAST64 SCNxLEAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 SCNdFAST64 SCNiFAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107 SCNoFAST64 SCNuFAST64 SCNxFAST64
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 #ifdef INTPTR_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 SCNdPTR SCNiPTR
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 #ifdef UINTPTR_MAX
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 SCNoPTR SCNuPTR SCNxPTR
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 #endif
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 ;
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 int
12197
e45d9bb2233e tests: avoid several compiler warnings
Eric Blake <ebb9@byu.net>
parents: 9309
diff changeset
118 main (void)
8172
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 {
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 return 0;
04baaa616456 Tests for module 'inttypes'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 }