1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/4846262/Test.sh Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,80 @@ 1.4 +#!/bin/sh -f 1.5 + 1.6 +# 1.7 +# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. 1.8 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 +# 1.10 +# This code is free software; you can redistribute it and/or modify it 1.11 +# under the terms of the GNU General Public License version 2 only, as 1.12 +# published by the Free Software Foundation. 1.13 +# 1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 +# version 2 for more details (a copy is included in the LICENSE file that 1.18 +# accompanied this code). 1.19 +# 1.20 +# You should have received a copy of the GNU General Public License version 1.21 +# 2 along with this work; if not, write to the Free Software Foundation, 1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 +# 1.24 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.25 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.26 +# have any questions. 1.27 +# 1.28 + 1.29 +# 1.30 +# @test 1.31 +# @bug 4846262 1.32 +# @summary check that javac operates correctly in EBCDIC locale 1.33 + 1.34 + 1.35 +if [ "${TESTSRC}" = "" ] 1.36 +then 1.37 + echo "TESTSRC not set. Test cannot execute. Failed." 1.38 + exit 1 1.39 +fi 1.40 +echo "TESTSRC=${TESTSRC}" 1.41 +if [ "${TESTJAVA}" = "" ] 1.42 +then 1.43 + echo "TESTJAVA not set. Test cannot execute. Failed." 1.44 + exit 1 1.45 +fi 1.46 + 1.47 +# set platform-dependent variables 1.48 +OS=`uname -s` 1.49 +case "$OS" in 1.50 + SunOS | Linux ) 1.51 + NULL=/dev/null 1.52 + PS=":" 1.53 + FS="/" 1.54 + ;; 1.55 + Windows* ) 1.56 + NULL=NUL 1.57 + PS=";" 1.58 + FS="\\" 1.59 + ;; 1.60 + * ) 1.61 + echo "Unrecognized system!" 1.62 + exit 1; 1.63 + ;; 1.64 +esac 1.65 + 1.66 +rm -f Test.java Test.out 1.67 + 1.68 +"${TESTJAVA}${FS}bin${FS}native2ascii" ${TESTTOOLVMOPTS} -reverse -encoding IBM1047 ${TESTSRC}${FS}Test.java Test.java 1.69 + 1.70 +"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -J-Duser.language=en -J-Duser.region=US -J-Dfile.encoding=IBM1047 Test.java 2>Test.tmp 1.71 + 1.72 +"${TESTJAVA}${FS}bin${FS}native2ascii" ${TESTTOOLVMOPTS} -encoding IBM1047 Test.tmp Test.out 1.73 + 1.74 +diff -c "${TESTSRC}${FS}Test.out" Test.out 1.75 +result=$? 1.76 + 1.77 +if [ $result -eq o ] 1.78 +then 1.79 + echo "Passed" 1.80 +else 1.81 + echo "Failed" 1.82 +fi 1.83 +exit $result