Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgfmt-6
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test catching of division by zero in plural expression.
5
6 # Note: On AIX 3 with xlc, this test fails. To make it work, add "-qcheck"
7 # to the CFLAGS, or use gcc.
8
9 cat <<EOF > mf-6.po
10 msgid ""
11 msgstr ""
12 "Project-Id-Version: msgfmt test 4\n"
13 "PO-Revision-Date: 2001-09-23 15:03+0200\n"
14 "Last-Translator: Bruno Haible <haible@clisp.cons.org>\n"
15 "Language-Team: test <test@li.org>\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=ASCII\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=3; plural=(1 + (1 / (n - 257)));\n"
20 EOF
21
22 : ${MSGFMT=msgfmt}
23 ${MSGFMT} --check -o mf-6.mo mf-6.po 2>/dev/null
24 # Exit code must be 1.
25 # If the division by zero didn't get noticed, it would be 0.
26 # If it produced a core dump, it would be 136 (= 128 + SIGFPE).
27 test $? = 1
28 result=$?
29
30 exit $result