No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / format-gcc-internal-2
bloba4b7d5d058de2a9c4385fa4cd408fb3304f2cd7d
1 #! /bin/sh
3 # Test checking of C format strings.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles f-gi-2.data"
9 cat <<\EOF > f-gi-2.data
10 # Valid: %% doesn't count
11 msgid "abc%%def"
12 msgstr "xyz"
13 # Invalid: invalid msgstr
14 msgid "abc%%def"
15 msgstr "xyz%"
16 # Valid: same arguments
17 msgid "abc%s%Hdef"
18 msgstr "xyz%s%H"
19 # Valid: same arguments, with different widths
20 msgid "abc%.*sdef"
21 msgstr "xyz%i%s"
22 # Invalid: too few arguments
23 msgid "abc%sdef%u"
24 msgstr "xyz%s"
25 # Invalid: too many arguments
26 msgid "abc%udef"
27 msgstr "xyz%uvw%c"
28 # Valid: type compatibility
29 msgid "abc%i"
30 msgstr "xyz%d"
31 # Valid: type compatibility
32 msgid "abc%o"
33 msgstr "xyz%u"
34 # Valid: type compatibility
35 msgid "abc%u"
36 msgstr "xyz%x"
37 # Invalid: type incompatibility
38 msgid "abc%c"
39 msgstr "xyz%s"
40 # Invalid: type incompatibility
41 msgid "abc%c"
42 msgstr "xyz%i"
43 # Invalid: type incompatibility
44 msgid "abc%c"
45 msgstr "xyz%u"
46 # Invalid: type incompatibility
47 msgid "abc%c"
48 msgstr "xyz%H"
49 # Invalid: type incompatibility
50 msgid "abc%c"
51 msgstr "xyz%D"
52 # Invalid: type incompatibility
53 msgid "abc%c"
54 msgstr "xyz%F"
55 # Invalid: type incompatibility
56 msgid "abc%c"
57 msgstr "xyz%T"
58 # Invalid: type incompatibility
59 msgid "abc%c"
60 msgstr "xyz%A"
61 # Invalid: type incompatibility
62 msgid "abc%c"
63 msgstr "xyz%C"
64 # Invalid: type incompatibility
65 msgid "abc%c"
66 msgstr "xyz%E"
67 # Invalid: type incompatibility
68 msgid "abc%c"
69 msgstr "xyz%L"
70 # Invalid: type incompatibility
71 msgid "abc%c"
72 msgstr "xyz%O"
73 # Invalid: type incompatibility
74 msgid "abc%c"
75 msgstr "xyz%P"
76 # Invalid: type incompatibility
77 msgid "abc%c"
78 msgstr "xyz%Q"
79 # Invalid: type incompatibility
80 msgid "abc%c"
81 msgstr "xyz%V"
82 # Invalid: type incompatibility
83 msgid "abc%s"
84 msgstr "xyz%i"
85 # Invalid: type incompatibility
86 msgid "abc%s"
87 msgstr "xyz%u"
88 # Invalid: type incompatibility
89 msgid "abc%s"
90 msgstr "xyz%H"
91 # Invalid: type incompatibility
92 msgid "abc%s"
93 msgstr "xyz%D"
94 # Invalid: type incompatibility
95 msgid "abc%s"
96 msgstr "xyz%F"
97 # Invalid: type incompatibility
98 msgid "abc%s"
99 msgstr "xyz%T"
100 # Invalid: type incompatibility
101 msgid "abc%s"
102 msgstr "xyz%A"
103 # Invalid: type incompatibility
104 msgid "abc%s"
105 msgstr "xyz%C"
106 # Invalid: type incompatibility
107 msgid "abc%s"
108 msgstr "xyz%E"
109 # Invalid: type incompatibility
110 msgid "abc%s"
111 msgstr "xyz%L"
112 # Invalid: type incompatibility
113 msgid "abc%s"
114 msgstr "xyz%O"
115 # Invalid: type incompatibility
116 msgid "abc%s"
117 msgstr "xyz%P"
118 # Invalid: type incompatibility
119 msgid "abc%s"
120 msgstr "xyz%Q"
121 # Invalid: type incompatibility
122 msgid "abc%s"
123 msgstr "xyz%V"
124 # Invalid: type incompatibility
125 msgid "abc%i"
126 msgstr "xyz%u"
127 # Invalid: type incompatibility
128 msgid "abc%i"
129 msgstr "xyz%H"
130 # Invalid: type incompatibility
131 msgid "abc%i"
132 msgstr "xyz%D"
133 # Invalid: type incompatibility
134 msgid "abc%i"
135 msgstr "xyz%F"
136 # Invalid: type incompatibility
137 msgid "abc%i"
138 msgstr "xyz%T"
139 # Invalid: type incompatibility
140 msgid "abc%i"
141 msgstr "xyz%A"
142 # Invalid: type incompatibility
143 msgid "abc%i"
144 msgstr "xyz%C"
145 # Invalid: type incompatibility
146 msgid "abc%i"
147 msgstr "xyz%E"
148 # Invalid: type incompatibility
149 msgid "abc%i"
150 msgstr "xyz%L"
151 # Invalid: type incompatibility
152 msgid "abc%i"
153 msgstr "xyz%O"
154 # Invalid: type incompatibility
155 msgid "abc%i"
156 msgstr "xyz%P"
157 # Invalid: type incompatibility
158 msgid "abc%i"
159 msgstr "xyz%Q"
160 # Invalid: type incompatibility
161 msgid "abc%i"
162 msgstr "xyz%V"
163 # Invalid: type incompatibility
164 msgid "abc%u"
165 msgstr "xyz%H"
166 # Invalid: type incompatibility
167 msgid "abc%u"
168 msgstr "xyz%D"
169 # Invalid: type incompatibility
170 msgid "abc%u"
171 msgstr "xyz%F"
172 # Invalid: type incompatibility
173 msgid "abc%u"
174 msgstr "xyz%T"
175 # Invalid: type incompatibility
176 msgid "abc%u"
177 msgstr "xyz%A"
178 # Invalid: type incompatibility
179 msgid "abc%u"
180 msgstr "xyz%C"
181 # Invalid: type incompatibility
182 msgid "abc%u"
183 msgstr "xyz%E"
184 # Invalid: type incompatibility
185 msgid "abc%u"
186 msgstr "xyz%L"
187 # Invalid: type incompatibility
188 msgid "abc%u"
189 msgstr "xyz%O"
190 # Invalid: type incompatibility
191 msgid "abc%u"
192 msgstr "xyz%P"
193 # Invalid: type incompatibility
194 msgid "abc%u"
195 msgstr "xyz%Q"
196 # Invalid: type incompatibility
197 msgid "abc%u"
198 msgstr "xyz%V"
199 # Invalid: type incompatibility
200 msgid "abc%H"
201 msgstr "xyz%D"
202 # Invalid: type incompatibility
203 msgid "abc%H"
204 msgstr "xyz%F"
205 # Invalid: type incompatibility
206 msgid "abc%H"
207 msgstr "xyz%T"
208 # Invalid: type incompatibility
209 msgid "abc%H"
210 msgstr "xyz%A"
211 # Invalid: type incompatibility
212 msgid "abc%H"
213 msgstr "xyz%C"
214 # Invalid: type incompatibility
215 msgid "abc%H"
216 msgstr "xyz%E"
217 # Invalid: type incompatibility
218 msgid "abc%H"
219 msgstr "xyz%L"
220 # Invalid: type incompatibility
221 msgid "abc%H"
222 msgstr "xyz%O"
223 # Invalid: type incompatibility
224 msgid "abc%H"
225 msgstr "xyz%P"
226 # Invalid: type incompatibility
227 msgid "abc%H"
228 msgstr "xyz%Q"
229 # Invalid: type incompatibility
230 msgid "abc%H"
231 msgstr "xyz%V"
232 # Invalid: type incompatibility
233 msgid "abc%D"
234 msgstr "xyz%F"
235 # Invalid: type incompatibility
236 msgid "abc%D"
237 msgstr "xyz%T"
238 # Invalid: type incompatibility
239 msgid "abc%D"
240 msgstr "xyz%A"
241 # Invalid: type incompatibility
242 msgid "abc%D"
243 msgstr "xyz%C"
244 # Invalid: type incompatibility
245 msgid "abc%D"
246 msgstr "xyz%E"
247 # Invalid: type incompatibility
248 msgid "abc%D"
249 msgstr "xyz%L"
250 # Invalid: type incompatibility
251 msgid "abc%D"
252 msgstr "xyz%O"
253 # Invalid: type incompatibility
254 msgid "abc%D"
255 msgstr "xyz%P"
256 # Invalid: type incompatibility
257 msgid "abc%D"
258 msgstr "xyz%Q"
259 # Invalid: type incompatibility
260 msgid "abc%D"
261 msgstr "xyz%V"
262 # Invalid: type incompatibility
263 msgid "abc%F"
264 msgstr "xyz%T"
265 # Invalid: type incompatibility
266 msgid "abc%F"
267 msgstr "xyz%A"
268 # Invalid: type incompatibility
269 msgid "abc%F"
270 msgstr "xyz%C"
271 # Invalid: type incompatibility
272 msgid "abc%F"
273 msgstr "xyz%E"
274 # Invalid: type incompatibility
275 msgid "abc%F"
276 msgstr "xyz%L"
277 # Invalid: type incompatibility
278 msgid "abc%F"
279 msgstr "xyz%O"
280 # Invalid: type incompatibility
281 msgid "abc%F"
282 msgstr "xyz%P"
283 # Invalid: type incompatibility
284 msgid "abc%F"
285 msgstr "xyz%Q"
286 # Invalid: type incompatibility
287 msgid "abc%F"
288 msgstr "xyz%V"
289 # Invalid: type incompatibility
290 msgid "abc%T"
291 msgstr "xyz%A"
292 # Invalid: type incompatibility
293 msgid "abc%T"
294 msgstr "xyz%C"
295 # Invalid: type incompatibility
296 msgid "abc%T"
297 msgstr "xyz%E"
298 # Invalid: type incompatibility
299 msgid "abc%T"
300 msgstr "xyz%L"
301 # Invalid: type incompatibility
302 msgid "abc%T"
303 msgstr "xyz%O"
304 # Invalid: type incompatibility
305 msgid "abc%T"
306 msgstr "xyz%P"
307 # Invalid: type incompatibility
308 msgid "abc%T"
309 msgstr "xyz%Q"
310 # Invalid: type incompatibility
311 msgid "abc%T"
312 msgstr "xyz%V"
313 # Invalid: type incompatibility
314 msgid "abc%A"
315 msgstr "xyz%C"
316 # Invalid: type incompatibility
317 msgid "abc%A"
318 msgstr "xyz%E"
319 # Invalid: type incompatibility
320 msgid "abc%A"
321 msgstr "xyz%L"
322 # Invalid: type incompatibility
323 msgid "abc%A"
324 msgstr "xyz%O"
325 # Invalid: type incompatibility
326 msgid "abc%A"
327 msgstr "xyz%P"
328 # Invalid: type incompatibility
329 msgid "abc%A"
330 msgstr "xyz%Q"
331 # Invalid: type incompatibility
332 msgid "abc%A"
333 msgstr "xyz%V"
334 # Invalid: type incompatibility
335 msgid "abc%C"
336 msgstr "xyz%E"
337 # Invalid: type incompatibility
338 msgid "abc%C"
339 msgstr "xyz%L"
340 # Invalid: type incompatibility
341 msgid "abc%C"
342 msgstr "xyz%O"
343 # Invalid: type incompatibility
344 msgid "abc%C"
345 msgstr "xyz%P"
346 # Invalid: type incompatibility
347 msgid "abc%C"
348 msgstr "xyz%Q"
349 # Invalid: type incompatibility
350 msgid "abc%C"
351 msgstr "xyz%V"
352 # Invalid: type incompatibility
353 msgid "abc%E"
354 msgstr "xyz%L"
355 # Invalid: type incompatibility
356 msgid "abc%E"
357 msgstr "xyz%O"
358 # Invalid: type incompatibility
359 msgid "abc%E"
360 msgstr "xyz%P"
361 # Invalid: type incompatibility
362 msgid "abc%E"
363 msgstr "xyz%Q"
364 # Invalid: type incompatibility
365 msgid "abc%E"
366 msgstr "xyz%V"
367 # Invalid: type incompatibility
368 msgid "abc%L"
369 msgstr "xyz%O"
370 # Invalid: type incompatibility
371 msgid "abc%L"
372 msgstr "xyz%P"
373 # Invalid: type incompatibility
374 msgid "abc%L"
375 msgstr "xyz%Q"
376 # Invalid: type incompatibility
377 msgid "abc%L"
378 msgstr "xyz%V"
379 # Invalid: type incompatibility
380 msgid "abc%O"
381 msgstr "xyz%P"
382 # Invalid: type incompatibility
383 msgid "abc%O"
384 msgstr "xyz%Q"
385 # Invalid: type incompatibility
386 msgid "abc%O"
387 msgstr "xyz%V"
388 # Invalid: type incompatibility
389 msgid "abc%P"
390 msgstr "xyz%Q"
391 # Invalid: type incompatibility
392 msgid "abc%P"
393 msgstr "xyz%V"
394 # Invalid: type incompatibility
395 msgid "abc%Q"
396 msgstr "xyz%V"
397 # Invalid: type incompatibility for width
398 msgid "abc%.*s"
399 msgstr "xyz%u%s"
402 : ${MSGFMT=msgfmt}
404 while read comment; do
405 read msgid_line
406 read msgstr_line
407 n=`expr $n + 1`
408 tmpfiles="$tmpfiles f-gi-2-$n.po f-gi-2-$n.mo"
409 cat <<EOF > f-gi-2-$n.po
410 #, gcc-internal-format
411 ${msgid_line}
412 ${msgstr_line}
414 fail=
415 if echo "$comment" | grep 'Valid:' > /dev/null; then
416 if ${MSGFMT} --check-format -o f-gi-2-$n.mo f-gi-2-$n.po; then
418 else
419 fail=yes
421 else
422 ${MSGFMT} --check-format -o f-gi-2-$n.mo f-gi-2-$n.po 2> /dev/null
423 if test $? = 1; then
425 else
426 fail=yes
429 if test -n "$fail"; then
430 echo "Format string checking error:" 1>&2
431 cat f-gi-2-$n.po 1>&2
432 exit 1
434 rm -f f-gi-2-$n.po f-gi-2-$n.mo
435 done < f-gi-2.data
437 rm -fr $tmpfiles
439 exit 0