3 # Test checking of C format strings.
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
13 # Invalid: invalid msgstr
16 # Valid: same arguments
19 # Valid: same arguments, with different widths
22 # Invalid: too few arguments
25 # Invalid: too many arguments
28 # Valid: type compatibility
31 # Valid: type compatibility
34 # Valid: type compatibility
37 # Invalid: type incompatibility
40 # Invalid: type incompatibility
43 # Invalid: type incompatibility
46 # Invalid: type incompatibility
49 # Invalid: type incompatibility
52 # Invalid: type incompatibility
55 # Invalid: type incompatibility
58 # Invalid: type incompatibility
61 # Invalid: type incompatibility
64 # Invalid: type incompatibility
67 # Invalid: type incompatibility
70 # Invalid: type incompatibility
73 # Invalid: type incompatibility
76 # Invalid: type incompatibility
79 # Invalid: type incompatibility
82 # Invalid: type incompatibility
85 # Invalid: type incompatibility
88 # Invalid: type incompatibility
91 # Invalid: type incompatibility
94 # Invalid: type incompatibility
97 # Invalid: type incompatibility
100 # Invalid: type incompatibility
103 # Invalid: type incompatibility
106 # Invalid: type incompatibility
109 # Invalid: type incompatibility
112 # Invalid: type incompatibility
115 # Invalid: type incompatibility
118 # Invalid: type incompatibility
121 # Invalid: type incompatibility
124 # Invalid: type incompatibility
127 # Invalid: type incompatibility
130 # Invalid: type incompatibility
133 # Invalid: type incompatibility
136 # Invalid: type incompatibility
139 # Invalid: type incompatibility
142 # Invalid: type incompatibility
145 # Invalid: type incompatibility
148 # Invalid: type incompatibility
151 # Invalid: type incompatibility
154 # Invalid: type incompatibility
157 # Invalid: type incompatibility
160 # Invalid: type incompatibility
163 # Invalid: type incompatibility
166 # Invalid: type incompatibility
169 # Invalid: type incompatibility
172 # Invalid: type incompatibility
175 # Invalid: type incompatibility
178 # Invalid: type incompatibility
181 # Invalid: type incompatibility
184 # Invalid: type incompatibility
187 # Invalid: type incompatibility
190 # Invalid: type incompatibility
193 # Invalid: type incompatibility
196 # Invalid: type incompatibility
199 # Invalid: type incompatibility
202 # Invalid: type incompatibility
205 # Invalid: type incompatibility
208 # Invalid: type incompatibility
211 # Invalid: type incompatibility
214 # Invalid: type incompatibility
217 # Invalid: type incompatibility
220 # Invalid: type incompatibility
223 # Invalid: type incompatibility
226 # Invalid: type incompatibility
229 # Invalid: type incompatibility
232 # Invalid: type incompatibility
235 # Invalid: type incompatibility
238 # Invalid: type incompatibility
241 # Invalid: type incompatibility
244 # Invalid: type incompatibility
247 # Invalid: type incompatibility
250 # Invalid: type incompatibility
253 # Invalid: type incompatibility
256 # Invalid: type incompatibility
259 # Invalid: type incompatibility
262 # Invalid: type incompatibility
265 # Invalid: type incompatibility
268 # Invalid: type incompatibility
271 # Invalid: type incompatibility
274 # Invalid: type incompatibility
277 # Invalid: type incompatibility
280 # Invalid: type incompatibility
283 # Invalid: type incompatibility
286 # Invalid: type incompatibility
289 # Invalid: type incompatibility
292 # Invalid: type incompatibility
295 # Invalid: type incompatibility
298 # Invalid: type incompatibility
301 # Invalid: type incompatibility
304 # Invalid: type incompatibility
307 # Invalid: type incompatibility
310 # Invalid: type incompatibility
313 # Invalid: type incompatibility
316 # Invalid: type incompatibility
319 # Invalid: type incompatibility
322 # Invalid: type incompatibility
325 # Invalid: type incompatibility
328 # Invalid: type incompatibility
331 # Invalid: type incompatibility
334 # Invalid: type incompatibility
337 # Invalid: type incompatibility
340 # Invalid: type incompatibility
343 # Invalid: type incompatibility
346 # Invalid: type incompatibility
349 # Invalid: type incompatibility
352 # Invalid: type incompatibility
355 # Invalid: type incompatibility
358 # Invalid: type incompatibility
361 # Invalid: type incompatibility
364 # Invalid: type incompatibility
367 # Invalid: type incompatibility
370 # Invalid: type incompatibility
373 # Invalid: type incompatibility
376 # Invalid: type incompatibility
379 # Invalid: type incompatibility
382 # Invalid: type incompatibility
385 # Invalid: type incompatibility
388 # Invalid: type incompatibility
391 # Invalid: type incompatibility
394 # Invalid: type incompatibility
397 # Invalid: type incompatibility for width
404 while read comment
; do
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
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
422 ${MSGFMT} --check-format -o f-gi-2-
$n.mo f-gi-2-
$n.po
2> /dev
/null
429 if test -n "$fail"; then
430 echo "Format string checking error:" 1>&2
431 cat f-gi-2-
$n.po
1>&2
434 rm -f f-gi-2-
$n.po f-gi-2-
$n.mo