aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/run-iconv-test.sh
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-12 20:26:40 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-12 20:26:40 +0000
commitb721a2c03c079f8939fae82823b6f75ef5b6639b (patch)
treecf46fabfc0a8aabeeb23a13c2eeb4b862fda99d0 /iconvdata/run-iconv-test.sh
parent9dd7309ceee055ed98039f29982dc773bfc63bef (diff)
downloadglibc-b721a2c03c079f8939fae82823b6f75ef5b6639b.tar
glibc-b721a2c03c079f8939fae82823b6f75ef5b6639b.tar.gz
glibc-b721a2c03c079f8939fae82823b6f75ef5b6639b.tar.bz2
glibc-b721a2c03c079f8939fae82823b6f75ef5b6639b.zip
Update.
2001-04-12 Bruno Haible <haible@clisp.cons.org> * iconvdata/TESTS2: New file. * iconvdata/run-iconv-test.sh: Also run tests from TESTS2. * iconvdata/testdata/alfabeta..UTF-8: New file. * iconvdata/testdata/alfabeta..UTF-16.BE: New file. * iconvdata/testdata/alfabeta..UTF-16.LE: New file. * iconvdata/testdata/alfabeta..UTF-32.BE: New file. * iconvdata/testdata/alfabeta..UTF-32.LE: New file. 2001-04-11 Bruno Haible <haible@clisp.cons.org> * iconvdata/utf-32.c: New file. * iconvdata/gconv-modules: Add entries for UTF-32, UTF-32LE, UTF-32BE. * iconvdata/Makefile (modules): Add UTF-32. (distribute): Add utf-32.c. 2001-04-11 Bruno Haible <haible@clisp.cons.org> * iconvdata/utf-16.c (PREPARE_LOOP): Initialize 'swap' after possibly changing it in the state. After incrementing 'inptr', store it back. * iconvdata/unicode.c (PREPARE_LOOP): After incrementing 'inptr', store it back. 2001-04-11 Bruno Haible <haible@clisp.cons.org> * iconvdata/utf-16.c (gconv_init): Use MAX_NEEDED_FROM, not MIN_NEEDED_FROM.
Diffstat (limited to 'iconvdata/run-iconv-test.sh')
-rwxr-xr-xiconvdata/run-iconv-test.sh45
1 files changed, 44 insertions, 1 deletions
diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh
index 3388e80074..0d307a3d95 100755
--- a/iconvdata/run-iconv-test.sh
+++ b/iconvdata/run-iconv-test.sh
@@ -127,7 +127,7 @@ while read from to subset targets; do
fi
if test "$subset" != Y; then
- echo $ac_n " suntzu: ASCII -> $to -> ASCII $ac_c"
+ echo $ac_n " suntzu: ASCII -> $to -> ASCII $ac_c"
$PROG -f ASCII -t $to testdata/suntzus |
$PROG -f $to -t ASCII > $temp1 ||
{ if test $? -gt 128; then exit 1; fi
@@ -139,6 +139,49 @@ while read from to subset targets; do
fi
done < TESTS
+# We read the file named TESTS2. All non-empty lines not starting with
+# `#' are interpreted as commands.
+while read utf8 from filename; do
+ # Ignore empty and comment lines.
+ if test -z "$filename" || test "$utf8" = '#'; then continue; fi
+
+ # Expand the variables now.
+ PROG=`eval echo $ICONV`
+
+ # Test conversion to the endianness dependent encoding.
+ echo $ac_n "test encoder: $utf8 -> $from $ac_c"
+ $PROG -f $utf8 -t $from < testdata/${filename}..${utf8} > $temp1
+ cmp $temp1 testdata/${filename}..${from}.BE > /dev/null 2>&1 ||
+ cmp $temp1 testdata/${filename}..${from}.LE > /dev/null 2>&1 ||
+ { echo "/FAILED"; failed=1; continue; }
+ echo "OK"
+
+ # Test conversion from the endianness dependent encoding.
+ echo $ac_n "test decoder: $from -> $utf8 $ac_c"
+ $PROG -f $from -t $utf8 < testdata/${filename}..${from}.BE > $temp1
+ cmp $temp1 testdata/${filename}..${utf8} > /dev/null 2>&1 ||
+ { echo "/FAILED"; failed=1; continue; }
+ $PROG -f $from -t $utf8 < testdata/${filename}..${from}.LE > $temp1
+ cmp $temp1 testdata/${filename}..${utf8} > /dev/null 2>&1 ||
+ { echo "/FAILED"; failed=1; continue; }
+ echo "OK"
+
+ # Test byte swapping behaviour.
+ echo $ac_n "test non-BOM: ${from}BE -> ${from}LE $ac_c"
+ $PROG -f ${from}BE -t ${from}LE < testdata/${filename}..${from}.BE > $temp1
+ cmp $temp1 testdata/${filename}..${from}.LE > /dev/null 2>&1 ||
+ { echo "/FAILED"; failed=1; continue; }
+ echo "OK"
+
+ # Test byte swapping behaviour.
+ echo $ac_n "test non-BOM: ${from}LE -> ${from}BE $ac_c"
+ $PROG -f ${from}LE -t ${from}BE < testdata/${filename}..${from}.LE > $temp1
+ cmp $temp1 testdata/${filename}..${from}.BE > /dev/null 2>&1 ||
+ { echo "/FAILED"; failed=1; continue; }
+ echo "OK"
+
+done < TESTS2
+
exit $failed
# Local Variables:
# mode:shell-script