ChangeDataModel.sh revision 2078
0N/A# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A# This code is free software; you can redistribute it and/or modify it 0N/A# under the terms of the GNU General Public License version 2 only, as 0N/A# published by the Free Software Foundation. 0N/A# This code is distributed in the hope that it will be useful, but WITHOUT 0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A# version 2 for more details (a copy is included in the LICENSE file that 0N/A# accompanied this code). 0N/A# You should have received a copy of the GNU General Public License version 0N/A# 2 along with this work; if not, write to the Free Software Foundation, 0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A# CA 95054 USA or visit www.sun.com if you need additional information or 0N/A# have any questions. 0N/A# @bug 4894330 4810347 6277269 0N/A# @summary Verify -d32 and -d64 options are accepted(rejected) on all platforms 0N/A# @author Joseph D. Darcy 2078N/A# To remove CR from output, needed for java apps in CYGWIN, harmless otherwise 0N/A# Verify directory context variables are set 0N/Aif [
"${TESTJAVA}" =
"" ]
0N/A echo "TESTJAVA not set. Test cannot execute. Failed." 0N/Aif [
"${TESTSRC}" =
"" ]
0N/A echo "TESTSRC not set. Test cannot execute. Failed." 0N/Aif [
"${TESTCLASSES}" =
"" ]
0N/A echo "TESTCLASSES not set. Test cannot execute. Failed." 0N/A# Construct paths to default Java executables 0N/A# Create our little Java test on the fly 0N/A printf " public static void main(String argv[]) {" 0N/A# All preconditions are met; run the tests. 0N/A# Verify data model flag for default data model is accepted 0N/A if [
"${DM2}" !=
"32" ]
0N/A echo "Data model flag -d32 not accepted or had improper effect." 0N/A if [
"${DM2}" !=
"64" ]
0N/A echo "Data model flag -d64 not accepted or had improper effect." 0N/A echo "Unrecognized data model: $DM" 0N/A# Determine if platform might be dual-mode capable. 0N/A # ARCH should be sparc or i386 0N/A # ARCH should be ia64, x86_64, or i*86 0N/A echo "Warning: unknown environment." 0N/Aif [
"${DUALMODE}" =
"true" ]
0N/A # Construct path to 64-bit Java executable, might not exist 0N/A JAVA64=
"${JAVA64FILE} -classpath ${TESTCLASSES}${PATHSEP}." 0N/A # Verify that, at least on Solaris, only one exec is 0N/A # used to change data models 0N/A if [
"${OS}" =
"SunOS" ]
0N/A if [
"${execCount}" -
gt 2 ]
0N/A if [
"${execCount}" -
gt 2 ]
0N/A if [
"${DM2}" !=
"64" ]
0N/A echo "Data model flag -d64 not accepted or had improper effect." 0N/A if [
"${DM2}" !=
"64" ]
0N/A echo "Improper data model returned." 0N/A if [
"${DM2}" !=
"64" ]
0N/A echo "Data model flag -d64 not accepted or had improper effect." 0N/A if [
"${DM2}" !=
"32" ]
0N/A echo "Data model flag -d32 not accepted or had improper effect." 0N/A echo "Warning: no 64-bit components found; only one data model tested." 0N/A# Negative tests for non-dual mode platforms to ensure the other data model is 0N/A if [
"x${DM2}" !=
"x" ]
0N/A echo "Data model flag -d64 was accepted." 0N/A if [
"x${DM2}" !=
"x" ]
0N/A echo "Data model flag -d32 was accepted." 0N/A echo "Unrecognized data model: $DM"