Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-21
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test C support: invalid NUL termination
5
6 : ${XGETTEXT=xgettext}
7
8 ${XGETTEXT} --add-comments --no-location --no-wrap \
9             -o - "$abs_srcdir"/xg-c-21.c \
10   | grep -v 'POT-Creation-Date' > xg-c-21.tmp.po || exit 1
11 LC_ALL=C tr -d '\r' < xg-c-21.tmp.po > xg-c-21.po || exit 1
12
13 cat <<\EOF > xg-c-21.ok
14 # SOME DESCRIPTIVE TITLE.
15 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
16 # This file is distributed under the same license as the PACKAGE package.
17 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
18 #
19 #, fuzzy
20 msgid ""
21 msgstr ""
22 "Project-Id-Version: PACKAGE VERSION\n"
23 "Report-Msgid-Bugs-To: \n"
24 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
25 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
26 "Language-Team: LANGUAGE <LL@li.org>\n"
27 "Language: \n"
28 "MIME-Version: 1.0\n"
29 "Content-Type: text/plain; charset=CHARSET\n"
30 "Content-Transfer-Encoding: 8bit\n"
31
32 msgid "\n"
33 msgstr ""
34
35 msgid "\\u"
36 msgstr ""
37
38 msgid "\\U"
39 msgstr ""
40
41 msgid "\\u3"
42 msgstr ""
43 EOF
44
45 : ${DIFF=diff}
46 ${DIFF} xg-c-21.ok xg-c-21.po
47 result=$?
48
49 exit $result