blob: 43dfebe9a61cb6030ba895577ef8c55576c3d7cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test recognition of ISO C 99 <inttypes.h> format string directives.
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles xg-c-8.c"
cat <<EOF > xg-c-8.c
void foo ()
{
printf (_("File size is: %" PRId64), size);
printf (_("File age is %10" PRIdMAX " microseconds"), age);
printf (_(PRIXFAST16 " errors"), nerrs);
printf (_(PRIXFAT16 " mistakes"), nerrs);
}
EOF
tmpfiles="$tmpfiles xg-c-8.tmp xg-c-8.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -k_ -o xg-c-8.tmp xg-c-8.c
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
LC_ALL=C tr -d '\r' < xg-c-8.tmp > xg-c-8.po
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tmpfiles="$tmpfiles xg-c-8.ok"
cat <<EOF > xg-c-8.ok
#, c-format
msgid "File size is: %<PRId64>"
msgstr ""
#, c-format
msgid "File age is %10<PRIdMAX> microseconds"
msgstr ""
#, c-format
msgid "<PRIXFAST16> errors"
msgstr ""
#, c-format
msgid " mistakes"
msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-c-8.ok xg-c-8.po
result=$?
rm -fr $tmpfiles
exit $result
|