summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-10-05 11:19:23 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:52 +0200
commitd1bb3f4a4fcbf43056587fb32104f4eb7eec56f8 (patch)
tree60fcbfe3383194d50a788874af867e62fe7bf7f4
parent1bb50c194b072ce6af593c8756007eab3a837e85 (diff)
downloadexternal_gettext-d1bb3f4a4fcbf43056587fb32104f4eb7eec56f8.zip
external_gettext-d1bb3f4a4fcbf43056587fb32104f4eb7eec56f8.tar.gz
external_gettext-d1bb3f4a4fcbf43056587fb32104f4eb7eec56f8.tar.bz2
New test against a crash when msgids change through charset conversion.
-rw-r--r--gettext-tools/tests/ChangeLog5
-rw-r--r--gettext-tools/tests/Makefile.am2
-rwxr-xr-xgettext-tools/tests/msgcat-1255
3 files changed, 61 insertions, 1 deletions
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog
index e11488b..c42d00e 100644
--- a/gettext-tools/tests/ChangeLog
+++ b/gettext-tools/tests/ChangeLog
@@ -1,5 +1,10 @@
2005-10-01 Bruno Haible <bruno@clisp.org>
+ * msgcat-12: New file.
+ * Makefie.am (TESTS): Add it.
+
+2005-10-01 Bruno Haible <bruno@clisp.org>
+
* msgcat-stringtable-1: Update 2005-07-16 patch after the error message
changed.
diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am
index 6ac70a2..1cd2744 100644
--- a/gettext-tools/tests/Makefile.am
+++ b/gettext-tools/tests/Makefile.am
@@ -26,7 +26,7 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
msgattrib-11 msgattrib-12 msgattrib-13 msgattrib-14 \
msgattrib-properties-1 \
msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 msgcat-7 \
- msgcat-8 msgcat-9 msgcat-10 msgcat-11 \
+ msgcat-8 msgcat-9 msgcat-10 msgcat-11 msgcat-12 \
msgcat-properties-1 msgcat-properties-2 \
msgcat-stringtable-1 \
msgcmp-1 msgcmp-2 msgcmp-3 \
diff --git a/gettext-tools/tests/msgcat-12 b/gettext-tools/tests/msgcat-12
new file mode 100755
index 0000000..cb0c039
--- /dev/null
+++ b/gettext-tools/tests/msgcat-12
@@ -0,0 +1,55 @@
+#! /bin/sh
+
+# Verify that msgcat complains when it would need to change msgids.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mcat-test12.in1 mcat-test12.in2"
+cat <<\EOF > mcat-test12.in1
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Denote a lock's state
+msgid "Open"
+msgstr "Ouverte"
+
+#. Denote a lock's state
+msgid "Closed"
+msgstr "Fermée"
+EOF
+
+cat <<\EOF > mcat-test12.in2
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Denote a lock's state
+msgid "Open"
+msgstr "Ouvert"
+
+#. Denote a lock's state
+msgid "Closed"
+msgstr "Fermé"
+
+#. A product
+msgid "Audi car"
+msgstr "voiture Audi"
+
+#. A product
+msgid "Océ copier"
+msgstr "photocopieur Océ"
+EOF
+
+tmpfiles="$tmpfiles mcat-test12.out"
+rm -f mcat-test12.out
+: ${MSGCAT=msgcat}
+${MSGCAT} -o mcat-test12.out mcat-test12.in1 mcat-test12.in2 2>/dev/null
+test $? = 1 || { rm -fr $tmpfiles; exit 1; }
+
+rm -fr $tmpfiles
+
+exit 0