Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgfmt-12
1 #! /bin/sh
2
3 # Test ISO C 99 <inttypes.h> format string directives.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles mf-12.po"
9 cat <<\EOF > mf-12.po
10 msgid ""
11 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
12
13 #, c-format
14 msgid "File size is: %<PRId64>"
15 msgstr "Dateigröße ist: %<PRId64>"
16
17 #, c-format
18 msgid "File age is %10<PRIdMAX> microseconds"
19 msgstr "Datei ist %10<PRIdMAX> Mikrosekunden alt."
20
21 msgid "<PRIXFAST16> errors"
22 msgstr "<PRIXFAST16> Fehler"
23 EOF
24
25 tmpfiles="$tmpfiles mf-12.mo"
26 : ${MSGFMT=msgfmt}
27 ${MSGFMT} -o mf-12.mo mf-12.po
28 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
29
30 tmpfiles="$tmpfiles mf-12.tmp mf-12.out"
31 : ${MSGUNFMT=msgunfmt}
32 ${MSGUNFMT} -o mf-12.tmp mf-12.mo
33 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
34 LC_ALL=C tr -d '\r' < mf-12.tmp > mf-12.out
35 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
36
37 tmpfiles="$tmpfiles mf-12.ok"
38 cat <<\EOF > mf-12.ok
39 msgid ""
40 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
41
42 msgid "<PRIXFAST16> errors"
43 msgstr "<PRIXFAST16> Fehler"
44
45 #, c-format
46 msgid "File size is: %<PRId64>"
47 msgstr "Dateigröße ist: %<PRId64>"
48
49 #, c-format
50 msgid "File age is %10<PRIdMAX> microseconds"
51 msgstr "Datei ist %10<PRIdMAX> Mikrosekunden alt."
52 EOF
53
54 : ${DIFF=diff}
55 ${DIFF} mf-12.ok mf-12.out
56 result=$?
57
58 rm -fr $tmpfiles
59
60 exit $result