test/java/lang/StringCoding/CheckEncodings.sh

Print this page




  32 case "$OS" in
  33   SunOS | Linux | Darwin) ;;
  34   Windows* | CYGWIN* )
  35     echo "Passed"; exit 0 ;;
  36   * ) echo "Unrecognized system!" ;  exit 1 ;;
  37 esac
  38 
  39 expectPass() {
  40   if [ $1 -eq 0 ]
  41   then echo "--- passed as expected"
  42   else
  43     echo "--- failed"
  44     exit $1
  45   fi
  46 }
  47 
  48 runTest() {
  49   echo "Testing:" ${1}
  50   set LC_ALL="${1}"; export LC_ALL
  51   locale
  52   ${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>&1
  53   expectPass $?
  54 }
  55 
  56 
  57 locale -a > machine_locales.txt
  58 
  59 # ${TESTSRC}/locales.txt contains the list of "fully supported" locales
  60 # as defined by the i18n doc for 1.4
  61 cat ${TESTSRC}/locales.txt machine_locales.txt | sort | uniq > locale_union.txt
  62 
  63 for i in `xargs < locale_union.txt` ; do
  64   runTest ${i}
  65 done
  66 
  67 # random strings
  68 for i in FOO 1234 ZZ; do
  69   runTest ${i}
  70 done


  32 case "$OS" in
  33   SunOS | Linux | Darwin) ;;
  34   Windows* | CYGWIN* )
  35     echo "Passed"; exit 0 ;;
  36   * ) echo "Unrecognized system!" ;  exit 1 ;;
  37 esac
  38 
  39 expectPass() {
  40   if [ $1 -eq 0 ]
  41   then echo "--- passed as expected"
  42   else
  43     echo "--- failed"
  44     exit $1
  45   fi
  46 }
  47 
  48 runTest() {
  49   echo "Testing:" ${1}
  50   set LC_ALL="${1}"; export LC_ALL
  51   locale
  52   ${TESTJAVA}/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} -version 2>&1
  53   expectPass $?
  54 }
  55 
  56 
  57 locale -a > machine_locales.txt
  58 
  59 # ${TESTSRC}/locales.txt contains the list of "fully supported" locales
  60 # as defined by the i18n doc for 1.4
  61 cat ${TESTSRC}/locales.txt machine_locales.txt | sort | uniq > locale_union.txt
  62 
  63 for i in `xargs < locale_union.txt` ; do
  64   runTest ${i}
  65 done
  66 
  67 # random strings
  68 for i in FOO 1234 ZZ; do
  69   runTest ${i}
  70 done