Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgunfmt-2
1 #! /bin/sh
2
3 # Test ISO C 99 <inttypes.h> format string directives.
4 # Verify that msgunfmt, applied to a .mo file of major revision 1 (with
5 # system-dependent strings), yields a PO file with c-format annotation, so that
6 # msgfmt applied to it will again produce a .mo file of major revision 1.
7
8 tmpfiles=""
9 trap 'rm -fr $tmpfiles' 1 2 3 15
10
11 tmpfiles="$tmpfiles mu-2.in"
12 cat <<EOF > mu-2.in
13 #, c-format
14 msgid "truncating at %<PRIuMAX> bytes in output file %s"
15 msgstr "schneide bei %<PRIuMAX> Bytes in Ausgabedatei %s ab"
16 EOF
17
18 tmpfiles="$tmpfiles mu-2.mo"
19 : ${MSGFMT=msgfmt}
20 ${MSGFMT} -o mu-2.mo mu-2.in
21 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
22
23 tmpfiles="$tmpfiles mu-2.tmp mu-2.out"
24 : ${MSGUNFMT=msgunfmt}
25 ${MSGUNFMT} -o mu-2.tmp mu-2.mo
26 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
27 LC_ALL=C tr -d '\r' < mu-2.tmp > mu-2.out
28 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
29
30 : ${DIFF=diff}
31 ${DIFF} mu-2.in mu-2.out
32 result=$?
33
34 rm -fr $tmpfiles
35
36 exit $result