* csu/Makefile ($(csu-dummies) target rule): Don't use a temp C file.
[glibc.git] / localedata / tests-mbwc / dat_strfmon.c
blob76c756374e4949f97effba62342034a63a430260
1 /*
2 * TEST SUITE FOR MB/WC FUNCTIONS IN CLIBRARY
4 * FILE: dat_strfmon.c
6 * STRFMON: size_t strfmon (char *buf, size_t nbyte, char *fmt, ... );
7 */
9 /*
10 * NOTE:
12 * The buffer size should be enough to contain a string including a
13 * null char.
14 * Returns the number of bytes of the string (NOT including a null char).
17 TST_STRFMON tst_strfmon_loc [] = {
19 { Tstrfmon, TST_LOC_de },
22 /* #01 */
23 /*inp*/ { 24, "%n %% %i", 123.00 },
24 /*exp*/ { 0,1,23, "123,00 EUR % 123,00 EUR" },
27 /* #02 */
28 /*inp*/ { 24, "%n %% %i", 123.00 },
29 /*exp*/ { 0,1,23, "123,00 EUR % 123,00 EUR" },
32 /* #03 */
33 /*inp*/ { 23, "%n %% %i", 123.00 },
34 /*exp*/ { E2BIG,1,-1, "" },
37 /* #04 */
38 /*inp*/ { 31, "%n|%i", 1234.561 },
39 /*exp*/ { 0,1,25, "1.234,56 EUR|1.234,56 EUR"},
42 /* #05 */
43 /*inp*/ { 33, "%n|%i", -1234.561 },
44 /*exp*/ { 0,1,27, "-1.234,56 EUR|-1.234,56 EUR"},
47 /* #06 */
48 /*inp*/ { 33, "%13n|%12i", 1234.561 },
49 /*exp*/ { 0,1,26, " 1.234,56 EUR|1.234,56 EUR"},
52 /* #07 */
53 /*inp*/ { 33, "%12n|%12i", -1234.561 },
54 /*exp*/ { 0,1,27, "-1.234,56 EUR|-1.234,56 EUR"},
57 /* #08 */
58 /*inp*/ { 33, "%#5n|%#5i", 1234.561 },
59 /*exp*/ { 0,1,29, " 1.234,56 EUR| 1.234,56 EUR"},
62 /* #09 */
63 /*inp*/ { 33, "%#5n|%#5i", -1234.561 },
64 /*exp*/ { 0,1,29, "- 1.234,56 EUR|- 1.234,56 EUR"},
67 /* #10 */
68 /*inp*/ { 33, "%=*#5n|%=*#5i", 1234.561 },
69 /*exp*/ { 0,1,29, " *1.234,56 EUR| *1.234,56 EUR"},
72 /* #11 */
73 /*inp*/ { 33, "%=0#5n|%=0#5i", -1234.561 },
74 /*exp*/ { 0,1,29, "-01.234,56 EUR|-01.234,56 EUR"},
77 /* #12 */
78 /*inp*/ { 33, "%^#5n|%^#5i", -1234.561 },
79 /*exp*/ { 0,1,27, "- 1234,56 EUR|- 1234,56 EUR"},
82 /* #13 */
83 /*inp*/ { 33, "%#5.0n|%#5.0i", 1234.444 },
84 /*exp*/ { 0,1,23, " 1.234 EUR| 1.234 EUR" },
87 /* #14 */
88 /*inp*/ { 33, "%#5.0n|%#5.4i", -1234.555 },
89 /*exp*/ { 0,1,28, "- 1.235 EUR|- 1.234,5550 EUR"},
92 /* #15 */
93 /*inp*/ { 33, "%(#5n|%!(#5i", -1234.561 },
94 /*exp*/ { 0,1,27, "( 1.234,56 EUR)|( 1.234,56)"},
96 { .is_last = 1 }
100 { Tstrfmon, TST_LOC_enUS },
103 /* #01 */
104 /*inp*/ { 22, "%n %% %i", 123.00 },
105 /*exp*/ { 0,1,20, "$123.00 % USD 123.00" },
108 /* #02 */
109 /*inp*/ { 21, "%n %% %i", 123.00 },
110 /*exp*/ { 0,1,20, "$123.00 % USD 123.00" },
113 /* #03 */
114 /*inp*/ { 20, "%n %% %i", 123.00 },
115 /*exp*/ { E2BIG,1,-1, "" },
118 /* #04 */
119 /*inp*/ { 30, "%n|%i", 1234.561 },
120 /*exp*/ { 0,1,22, "$1,234.56|USD 1,234.56" },
123 /* #05 */
124 /*inp*/ { 32, "%n|%i", -1234.561 },
125 /*exp*/ { 0,1,24, "-$1,234.56|-USD 1,234.56" },
128 /* #06 */
129 /*inp*/ { 30, "%12n|%12i", 1234.561 },
130 /*exp*/ { 0,1,25, " $1,234.56|USD 1,234.56"},
133 /* #07 */
134 /*inp*/ { 32, "%12n|%12i", -1234.561 },
135 /*exp*/ { 0,1,26, " -$1,234.56|-USD 1,234.56"},
138 /* #08 */
139 /*inp*/ { 32, "%#5n|%#5i", 1234.561 },
140 /*exp*/ { 0,1,26, " $ 1,234.56| USD 1,234.56"},
143 /* #09 */
144 /*inp*/ { 32, "%#5n|%#5i", -1234.561 },
145 /*exp*/ { 0,1,26, "-$ 1,234.56|-USD 1,234.56"},
148 /* #10 */
149 /*inp*/ { 32, "%=*#5n|%=*#5i", 1234.561 },
150 /*exp*/ { 0,1,26, " $*1,234.56| USD *1,234.56"},
153 /* #11 */
154 /*inp*/ { 32, "%=0#5n|%=0#5i", -1234.561 },
155 /*exp*/ { 0,1,26, "-$01,234.56|-USD 01,234.56"},
158 /* #12 */
159 /*inp*/ { 32, "%^#5n|%^#5i", -1234.561 },
160 /*exp*/ { 0,1,24, "-$ 1234.56|-USD 1234.56" },
163 /* #13 */
164 /*inp*/ { 32, "%#5.0n|%#5.0i", 1234.444 },
165 /*exp*/ { 0,1,20, " $ 1,234| USD 1,234" },
168 /* #14 */
169 /*inp*/ { 32, "%#5.0n|%#5.4i", -1234.555 },
170 /*exp*/ { 0,1,25, "-$ 1,235|-USD 1,234.5550"},
173 /* #15 */
174 /*inp*/ { 32, "%(#5n|%!(#5i", -1234.561 },
175 /*exp*/ { 0,1,24, "($ 1,234.56)|( 1,234.56)" },
177 { .is_last = 1 }
181 { Tstrfmon, TST_LOC_eucJP },
184 /* #01 */
185 /*inp*/ { 17, "%n %% %i", 123.00 },
186 /*exp*/ { 0,1,15, "\241\357123 % JPY 123" },
189 /* #02 */
190 /*inp*/ { 16, "%n %% %i", 123.00 },
191 /*exp*/ { 0,1,15, "\241\357123 % JPY 123" },
194 /* #03 */
195 /*inp*/ { 15, "%n %% %i", 123.00 },
196 /*exp*/ { E2BIG,1,-1, "" },
199 /* #04 */
200 /*inp*/ { 30, "%n|%i", 1234.561 },
201 /*exp*/ { 0,1,17, "\241\3571,235|JPY 1,235" },
204 /* #05 */
205 /*inp*/ { 32, "%n|%i", -1234.561 },
206 /*exp*/ { 0,1,19, "\241\357-1,235|JPY -1,235" },
209 /* #06 */
210 /*inp*/ { 32, "%12n|%12i", 1234.561 },
211 /*exp*/ { 0,1,25, " \241\3571,235| JPY 1,235" },
214 /* #07 */
215 /*inp*/ { 32, "%12n|%12i", -1234.561 },
216 /*exp*/ { 0,1,25, " \241\357-1,235| JPY -1,235" },
219 /* #08 */
220 /*inp*/ { 32, "%#5n|%#5i", 1234.561 },
221 /*exp*/ { 0,1,21, " \241\357 1,235| JPY 1,235" },
224 /* #09 */
225 /*inp*/ { 32, "%#5n|%#5i", -1234.561 },
226 /*exp*/ { 0,1,21, "\241\357- 1,235|JPY - 1,235" },
229 /* #10 */
230 /*inp*/ { 32, "%=*#5n|%=*#5i", 1234.561 },
231 /*exp*/ { 0,1,21, " \241\357*1,235| JPY *1,235" },
234 /* #11 */
235 /*inp*/ { 32, "%=0#5n|%=0#5i", -1234.561 },
236 /*exp*/ { 0,1,21, "\241\357-01,235|JPY -01,235" },
239 /* #12 */
240 /*inp*/ { 32, "%^#5n|%^#5i", -1234.561 },
241 /*exp*/ { 0,1,19, "\241\357- 1235|JPY - 1235" },
244 /* #13 */
245 /*inp*/ { 32, "%#5.0n|%#5.0i", 1234.444 },
246 /*exp*/ { 0,1,21, " \241\357 1,234| JPY 1,234" },
249 /* #14 */
250 /*inp*/ { 32, "%#5.0n|%#5.4i", -1234.555 },
251 /*exp*/ { 0,1,26, "\241\357- 1,235|JPY - 1,234.5550"},
254 /* #15 */
255 /*inp*/ { 32, "%(#5n|%!(#5i", -1234.561 },
256 /*exp*/ { 0,1,19, "(\241\357 1,235)|( 1,235)" },
258 { .is_last = 1 }
262 { Tstrfmon, TST_LOC_end }