summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests
diff options
context:
space:
mode:
Diffstat (limited to 'gettext-tools/tests')
-rw-r--r--gettext-tools/tests/Makefile.am3
-rw-r--r--gettext-tools/tests/xg-c-21.cbin0 -> 140 bytes
-rwxr-xr-xgettext-tools/tests/xgettext-c-2149
3 files changed, 51 insertions, 1 deletions
diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am
index 1526d77..b102613 100644
--- a/gettext-tools/tests/Makefile.am
+++ b/gettext-tools/tests/Makefile.am
@@ -79,6 +79,7 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
xgettext-c-6 xgettext-c-7 xgettext-c-8 xgettext-c-9 xgettext-c-10 \
xgettext-c-11 xgettext-c-12 xgettext-c-13 xgettext-c-14 xgettext-c-15 \
xgettext-c-16 xgettext-c-17 xgettext-c-18 xgettext-c-19 xgettext-c-20 \
+ xgettext-c-21 \
xgettext-csharp-1 xgettext-csharp-2 xgettext-csharp-3 \
xgettext-csharp-4 xgettext-csharp-5 xgettext-csharp-6 \
xgettext-csharp-7 xgettext-csharp-8 \
@@ -160,7 +161,7 @@ EXTRA_DIST += init.sh init.cfg $(TESTS) \
gettext-6-1.po gettext-6-2.po gettext-7.po \
gettextpo-1.de.po \
xgettext-1 \
- xgettext-c-1 \
+ xgettext-c-1 xg-c-21.c \
common/supplemental/plurals.xml
XGETTEXT = ../src/xgettext
diff --git a/gettext-tools/tests/xg-c-21.c b/gettext-tools/tests/xg-c-21.c
new file mode 100644
index 0000000..d49b6f0
--- /dev/null
+++ b/gettext-tools/tests/xg-c-21.c
Binary files differ
diff --git a/gettext-tools/tests/xgettext-c-21 b/gettext-tools/tests/xgettext-c-21
new file mode 100755
index 0000000..966ae80
--- /dev/null
+++ b/gettext-tools/tests/xgettext-c-21
@@ -0,0 +1,49 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test C support: invalid NUL termination
+
+: ${XGETTEXT=xgettext}
+
+${XGETTEXT} --add-comments --no-location --no-wrap \
+ -o - xg-c-21.c | grep -v 'POT-Creation-Date' > xg-c-21.tmp.po \
+ || exit 1
+LC_ALL=C tr -d '\r' < xg-c-21.tmp.po > xg-c-21.po || exit 1
+
+cat <<\EOF > xg-c-21.ok
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "\n"
+msgstr ""
+
+msgid "\\u"
+msgstr ""
+
+msgid "\\U"
+msgstr ""
+
+msgid "\\u3"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-c-21.ok xg-c-21.po
+result=$?
+
+exit $result