jdk/test/java/lang/instrument/StressGetObjectSizeTest.sh
author chegar
Tue, 09 Aug 2011 16:39:04 +0100
changeset 10150 dee4cb73adc3
parent 5506 202f599c92aa
child 30376 2ccf2cf7ea48
permissions -rw-r--r--
7073295: TEST_BUG: test/java/lang/instrument/ManifestTest.sh causing havoc (win) Reviewed-by: mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
282
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     1
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 282
diff changeset
     2
# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
282
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     4
#
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     7
# published by the Free Software Foundation.
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     8
#
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    13
# accompanied this code).
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    14
#
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    18
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 282
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 282
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 282
diff changeset
    21
# questions.
282
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    22
#
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    23
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    24
# @test
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    25
# @bug 6572160
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    26
# @summary stress getObjectSize() API
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    27
# @author Daniel D. Daugherty as modified from the code of fischman@google.com
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    28
#
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    29
# @run build StressGetObjectSizeApp
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    30
# @run shell MakeJAR.sh basicAgent
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    31
# @run shell StressGetObjectSizeTest.sh
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    32
#
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    33
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    34
if [ "${TESTJAVA}" = "" ]
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    35
then
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    36
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    37
  exit 1
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    38
fi
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    39
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    40
if [ "${TESTSRC}" = "" ]
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    41
then
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    42
  echo "TESTSRC not set.  Test cannot execute.  Failed."
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    43
  exit 1
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    44
fi
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    45
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    46
if [ "${TESTCLASSES}" = "" ]
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    47
then
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    48
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    49
  exit 1
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    50
fi
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    51
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    52
JAVA="${TESTJAVA}"/bin/java
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    53
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    54
"${JAVA}" ${TESTVMOPTS} -javaagent:basicAgent.jar \
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    55
    -classpath "${TESTCLASSES}" StressGetObjectSizeApp StressGetObjectSizeApp \
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    56
    > output.log 2>&1
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    57
cat output.log
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    58
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    59
MESG="ASSERTION FAILED"
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    60
grep "$MESG" output.log
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    61
result=$?
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    62
if [ "$result" = 0 ]; then
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    63
    echo "FAIL: found '$MESG' in the test output"
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    64
    result=1
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    65
else
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    66
    echo "PASS: did NOT find '$MESG' in the test output"
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    67
    result=0
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    68
fi
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    69
bca3e5a71df1 6572160: 3/3 Instrumentation.getObjectSize triggers JVM crash in JPLISAssert in shutdown
dcubed
parents:
diff changeset
    70
exit $result