This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <config.h>
20
21 #include <langinfo.h>
22
23 #include "signature.h"
24 SIGNATURE_CHECK (nl_langinfo, char *, (nl_item));
25
26 #include <locale.h>
27 #include <stdlib.h>
28 #include <string.h>
29
30 #include "c-strcase.h"
31 #include "macros.h"
32
33
34
35
36 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
37 # pragma GCC diagnostic ignored "-Wtype-limits"
38 #endif
39
40 int
41 main (int argc, char *argv[])
42 {
43 int pass = atoi (argv[1]);
44
45
46
47
48
49
50 setlocale (LC_ALL, "");
51
52
53 ASSERT (strlen (nl_langinfo (CODESET)) > 0);
54 if (pass == 2)
55 {
56 const char *codeset = nl_langinfo (CODESET);
57 ASSERT (c_strcasecmp (codeset, "UTF-8") == 0 || c_strcasecmp (codeset, "UTF8") == 0);
58 }
59
60 ASSERT (strlen (nl_langinfo (RADIXCHAR)) > 0);
61 ASSERT (strlen (nl_langinfo (THOUSEP)) >= 0);
62
63 ASSERT (strlen (nl_langinfo (D_T_FMT)) > 0);
64 ASSERT (strlen (nl_langinfo (D_FMT)) > 0);
65 ASSERT (strlen (nl_langinfo (T_FMT)) > 0);
66 ASSERT (strlen (nl_langinfo (T_FMT_AMPM)) >= (pass == 0 ? 1 : 0));
67 ASSERT (strlen (nl_langinfo (AM_STR)) >= (pass == 0 ? 1 : 0));
68 ASSERT (strlen (nl_langinfo (PM_STR)) >= (pass == 0 ? 1 : 0));
69 ASSERT (strlen (nl_langinfo (DAY_1)) > 0);
70 ASSERT (strlen (nl_langinfo (DAY_2)) > 0);
71 ASSERT (strlen (nl_langinfo (DAY_3)) > 0);
72 ASSERT (strlen (nl_langinfo (DAY_4)) > 0);
73 ASSERT (strlen (nl_langinfo (DAY_5)) > 0);
74 ASSERT (strlen (nl_langinfo (DAY_6)) > 0);
75 ASSERT (strlen (nl_langinfo (DAY_7)) > 0);
76 ASSERT (strlen (nl_langinfo (ABDAY_1)) > 0);
77 ASSERT (strlen (nl_langinfo (ABDAY_2)) > 0);
78 ASSERT (strlen (nl_langinfo (ABDAY_3)) > 0);
79 ASSERT (strlen (nl_langinfo (ABDAY_4)) > 0);
80 ASSERT (strlen (nl_langinfo (ABDAY_5)) > 0);
81 ASSERT (strlen (nl_langinfo (ABDAY_6)) > 0);
82 ASSERT (strlen (nl_langinfo (ABDAY_7)) > 0);
83 ASSERT (strlen (nl_langinfo (MON_1)) > 0);
84 ASSERT (strlen (nl_langinfo (MON_2)) > 0);
85 ASSERT (strlen (nl_langinfo (MON_3)) > 0);
86 ASSERT (strlen (nl_langinfo (MON_4)) > 0);
87 ASSERT (strlen (nl_langinfo (MON_5)) > 0);
88 ASSERT (strlen (nl_langinfo (MON_6)) > 0);
89 ASSERT (strlen (nl_langinfo (MON_7)) > 0);
90 ASSERT (strlen (nl_langinfo (MON_8)) > 0);
91 ASSERT (strlen (nl_langinfo (MON_9)) > 0);
92 ASSERT (strlen (nl_langinfo (MON_10)) > 0);
93 ASSERT (strlen (nl_langinfo (MON_11)) > 0);
94 ASSERT (strlen (nl_langinfo (MON_12)) > 0);
95 ASSERT (strlen (nl_langinfo (ALTMON_1)) > 0);
96 ASSERT (strlen (nl_langinfo (ALTMON_2)) > 0);
97 ASSERT (strlen (nl_langinfo (ALTMON_3)) > 0);
98 ASSERT (strlen (nl_langinfo (ALTMON_4)) > 0);
99 ASSERT (strlen (nl_langinfo (ALTMON_5)) > 0);
100 ASSERT (strlen (nl_langinfo (ALTMON_6)) > 0);
101 ASSERT (strlen (nl_langinfo (ALTMON_7)) > 0);
102 ASSERT (strlen (nl_langinfo (ALTMON_8)) > 0);
103 ASSERT (strlen (nl_langinfo (ALTMON_9)) > 0);
104 ASSERT (strlen (nl_langinfo (ALTMON_10)) > 0);
105 ASSERT (strlen (nl_langinfo (ALTMON_11)) > 0);
106 ASSERT (strlen (nl_langinfo (ALTMON_12)) > 0);
107
108
109 ASSERT (strcmp (nl_langinfo (ALTMON_1), nl_langinfo (MON_1)) == 0);
110 ASSERT (strcmp (nl_langinfo (ALTMON_2), nl_langinfo (MON_2)) == 0);
111 ASSERT (strcmp (nl_langinfo (ALTMON_3), nl_langinfo (MON_3)) == 0);
112 ASSERT (strcmp (nl_langinfo (ALTMON_4), nl_langinfo (MON_4)) == 0);
113 ASSERT (strcmp (nl_langinfo (ALTMON_5), nl_langinfo (MON_5)) == 0);
114 ASSERT (strcmp (nl_langinfo (ALTMON_6), nl_langinfo (MON_6)) == 0);
115 ASSERT (strcmp (nl_langinfo (ALTMON_7), nl_langinfo (MON_7)) == 0);
116 ASSERT (strcmp (nl_langinfo (ALTMON_8), nl_langinfo (MON_8)) == 0);
117 ASSERT (strcmp (nl_langinfo (ALTMON_9), nl_langinfo (MON_9)) == 0);
118 ASSERT (strcmp (nl_langinfo (ALTMON_10), nl_langinfo (MON_10)) == 0);
119 ASSERT (strcmp (nl_langinfo (ALTMON_11), nl_langinfo (MON_11)) == 0);
120 ASSERT (strcmp (nl_langinfo (ALTMON_12), nl_langinfo (MON_12)) == 0);
121 ASSERT (strlen (nl_langinfo (ABMON_1)) > 0);
122 ASSERT (strlen (nl_langinfo (ABMON_2)) > 0);
123 ASSERT (strlen (nl_langinfo (ABMON_3)) > 0);
124 ASSERT (strlen (nl_langinfo (ABMON_4)) > 0);
125 ASSERT (strlen (nl_langinfo (ABMON_5)) > 0);
126 ASSERT (strlen (nl_langinfo (ABMON_6)) > 0);
127 ASSERT (strlen (nl_langinfo (ABMON_7)) > 0);
128 ASSERT (strlen (nl_langinfo (ABMON_8)) > 0);
129 ASSERT (strlen (nl_langinfo (ABMON_9)) > 0);
130 ASSERT (strlen (nl_langinfo (ABMON_10)) > 0);
131 ASSERT (strlen (nl_langinfo (ABMON_11)) > 0);
132 ASSERT (strlen (nl_langinfo (ABMON_12)) > 0);
133 ASSERT (strlen (nl_langinfo (ERA)) >= 0);
134 ASSERT (strlen (nl_langinfo (ERA_D_FMT)) >= 0);
135 ASSERT (strlen (nl_langinfo (ERA_D_T_FMT)) >= 0);
136 ASSERT (strlen (nl_langinfo (ERA_T_FMT)) >= 0);
137 ASSERT (nl_langinfo (ALT_DIGITS) != NULL);
138
139 {
140 const char *currency = nl_langinfo (CRNCYSTR);
141 ASSERT (strlen (currency) >= 0);
142 #if !defined __NetBSD__
143 if (pass > 0)
144 ASSERT (strlen (currency) >= 1);
145 #endif
146 }
147
148 ASSERT (strlen (nl_langinfo (YESEXPR)) > 0);
149 ASSERT (strlen (nl_langinfo (NOEXPR)) > 0);
150
151 return 0;
152 }