Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test that an out-of-range Unicode character doesn't lead to a crash.
      4  1.1  christos 
      5  1.1  christos tmpfiles=""
      6  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      7  1.1  christos 
      8  1.1  christos tmpfiles="$tmpfiles mf-test13.po"
      9  1.1  christos cat <<\EOF >mf-test13.po
     10  1.1  christos # SOME DESCRIPTIVE TITLE.
     11  1.1  christos # Copyright (C) YEAR Free Software Foundation, Inc.
     12  1.1  christos # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
     13  1.1  christos #
     14  1.1  christos msgid ""
     15  1.1  christos msgstr ""
     16  1.1  christos "Project-Id-Version: minicom 2.1\n"
     17  1.1  christos "POT-Creation-Date: 2003-05-16 22:33+0200\n"
     18  1.1  christos "PO-Revision-Date: 2003-09-11 14:10+0200\n"
     19  1.1  christos "Last-Translator: Jochen Hein <jochen (at] jochen.org>\n"
     20  1.1  christos "Language-Team: german <de (at] li.org>\n"
     21  1.1  christos "MIME-Version: 1.0\n"
     22  1.1  christos "Content-Type: text/plain; charset=utf-8\n"
     23  1.1  christos "Content-Transfer-Encoding: 8bit\n"
     24  1.1  christos 
     25  1.1  christos #: src/file.c:60
     26  1.1  christos msgid " [Goto]  [Prev]  [Show]  [Tag]  [Untag]  [Okay] "
     27  1.1  christos msgstr " [Gehe zu]  [Zurck]  [Anzeigen]  [Markieren]  [Markierung len]  [Okay] "
     28  1.1  christos 
     29  1.1  christos EOF
     30  1.1  christos 
     31  1.1  christos tmpfiles="$tmpfiles mf-test13.mo"
     32  1.1  christos : ${MSGFMT=msgfmt}
     33  1.1  christos ${MSGFMT} mf-test13.po -o mf-test13.mo 2>/dev/null
     34  1.1  christos # Exit code must be 1.
     35  1.1  christos # If the invalid sequence didn't get noticed, it would be 0.
     36  1.1  christos # If it produced a core dump, it would be 134 (= 128 + SIGABRT).
     37  1.1  christos test $? = 1
     38  1.1  christos result=$?
     39  1.1  christos 
     40  1.1  christos rm -fr $tmpfiles
     41  1.1  christos 
     42  1.1  christos exit $result
     43