Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/nio/charset/Charset/default.sh
38821 views
#!/bin/sh12#3# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5#6# This code is free software; you can redistribute it and/or modify it7# under the terms of the GNU General Public License version 2 only, as8# published by the Free Software Foundation.9#10# This code is distributed in the hope that it will be useful, but WITHOUT11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13# version 2 for more details (a copy is included in the LICENSE file that14# accompanied this code).15#16# You should have received a copy of the GNU General Public License version17# 2 along with this work; if not, write to the Free Software Foundation,18# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19#20# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21# or visit www.oracle.com if you need additional information or have any22# questions.23#2425# @test26# @bug 477285727# @summary Unit test for Charset.defaultCharset28#29# @build Default30# @run shell default.sh31#3233# Command-line usage: sh default.sh [/path/to/build]3435if [ -z "$TESTJAVA" ]; then36if [ $# -lt 1 ]; then exit 1; fi37TESTJAVA=$1; shift38TESTSRC=`pwd`39TESTCLASSES=`pwd`40fi4142s="`uname -s`"43if [ "$s" != Linux -a "$s" != SunOS ]; then44echo "$s: locale command not supported on this system, skipping..."45exit 046fi4748JAVA=$TESTJAVA/bin/java4950tolower() {51echo "$1" | tr '[A-Z]' '[a-z]'52}5354go() {5556L="$1"57shift58if [ "x`locale -a | grep \^$L\$`" != "x$L" ]; then59echo "$L: Locale not supported, skipping..."60return61fi6263ecs="$1"; shift6465echo -n "$L: "66cs="`LC_ALL=$L $JAVA ${TESTVMOPTS} -cp $TESTCLASSES Default`"67if [ $? != 0 ]; then68exit 169elif [ "`tolower $cs`" != "`tolower $ecs`" ]; then70echo "$cs, expected $ecs -- ERROR"71exit 172else73echo "$cs, as expected"74fi7576}7778go en_US iso-8859-179go ja_JP.utf8 utf-880go tr_TR iso-8859-981go C us-ascii8283if [ "$s" = Linux ]; then84go ja_JP x-euc-jp-linux85go ja_JP.eucjp x-euc-jp-linux86go ja_JP.ujis x-euc-jp-linux87go ja_JP.utf8 utf-888fi8990# Solaris91if [ "$s" = SunOS ]; then92go ja x-eucjp-open93go ja_JP.eucJP x-eucjp-open94go ja_JP.PCK x-PCK95go ja_JP.UTF-8 utf-896fi979899