• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9cat <<EOF > mf-6.po
10msgid ""
11msgstr ""
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"
20EOF
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).
27test $? = 1
28result=$?
29
30exit $result
31