tizen 2.3.1 release
[framework/base/tizen-locale.git] / localedata / tst-rpmatch.sh
1 #! /bin/sh -f
2 #
3 # Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library and contains tests for
5 # the rpmatch(3)-implementation.
6 # contributed by Jochen Hein <jochen.hein@delphi.central.de>
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22 common_objpfx=$1
23 tst_rpmatch=$2
24
25 rc=0
26 while IFS=\& read locale string result dummy; do
27     if [ "$locale" != "#" ]; then
28         # If tst_rpmatch includes a cross-testing wrapper based on a
29         # program like ssh, it may steal input from the while loop, so
30         # redirect its stdin from /dev/null.
31         LOCPATH=${common_objpfx}localedata \
32         GCONV_PATH=${common_objpfx}/iconvdata \
33         ${tst_rpmatch} $locale $string $result < /dev/null \
34         || { echo "$locale $string $result  FAILED"; exit 1; }
35     fi
36 done <<EOF
37 #& These are the tests for rpmatch in glibc.  Each line contains one test,
38 #& comments start with #& in the first column.  The fields are separated
39 #& by ampersand signs and contain: the locale, the string, the expected
40 #& return value of rpmatch(3).  If the test fails, test-rpmatch prints
41 #& all these informations
42 C&Yes&1
43 C&yes&1
44 C&YES&1
45 C&YeS&1
46 C&YEs&1
47 C&yEs&1
48 C&yES&1
49 C&yeS&1
50 C&No&0
51 C&no&0
52 #& Uh, that's nonsense
53 C&nonsens&0
54 C&Error&-1
55 de_DE.ISO-8859-1&Yes&1
56 de_DE.ISO-8859-1&Ja&1
57 de_DE.ISO-8859-1&Jammerschade&1
58 de_DE.ISO-8859-1&dejavu&-1
59 de_DE.ISO-8859-1&Nein&0
60 de_DE.ISO-8859-1&Fehler&-1
61 de_DE.ISO-8859-1&jein&1
62 EOF