author | jcbeyler |
Wed, 17 Oct 2018 21:28:11 -0700 | |
changeset 52184 | 672bc2213cef |
parent 51774 | 79dc492c00ab |
permissions | -rw-r--r-- |
50260
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
1 |
/* |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
2 |
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
4 |
* |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
8 |
* |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
13 |
* accompanied this code). |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
14 |
* |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
18 |
* |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
21 |
* questions. |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
22 |
*/ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
23 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
24 |
#include <stdlib.h> |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
25 |
#include <string.h> |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
26 |
#include "jni_tools.h" |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
27 |
#include "agent_common.h" |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
28 |
#include "jvmti_tools.h" |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
29 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
30 |
#define PASSED 0 |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
31 |
#define STATUS_FAILED 2 |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
32 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
33 |
extern "C" { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
34 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
35 |
/* ========================================================================== */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
36 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
37 |
/* scaffold objects */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
38 |
static jlong timeout = 0; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
39 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
40 |
/* test objects */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
41 |
static int VMInitEventsCount = 0; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
42 |
static int VMInitEventsExpected = 1; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
43 |
static int VMDeathEventsCount = 0; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
44 |
static int VMDeathEventsExpected = 1; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
45 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
46 |
/* ========================================================================== */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
47 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
48 |
/** callback functions **/ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
49 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
50 |
void JNICALL VMInit(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thr) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
51 |
NSK_DISPLAY0("VMInit event\n"); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
52 |
VMInitEventsCount++; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
53 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
54 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
55 |
void JNICALL |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
56 |
VMDeath(jvmtiEnv *jvmti_env, JNIEnv *env) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
57 |
NSK_DISPLAY0("VMDeath event\n"); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
58 |
VMDeathEventsCount++; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
59 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
60 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
61 |
/* ========================================================================== */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
62 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
63 |
/** Agent algorithm. */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
64 |
static void JNICALL |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
65 |
agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
66 |
if (!nsk_jvmti_waitForSync(timeout)) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
67 |
return; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
68 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
69 |
if (VMInitEventsCount != VMInitEventsExpected) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
70 |
NSK_COMPLAIN2("Wrong number of VM init events: %d, expected: %d\n", |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
71 |
VMInitEventsCount, VMInitEventsExpected); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
72 |
nsk_jvmti_setFailStatus(); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
73 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
74 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
75 |
if (!nsk_jvmti_resumeSync()) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
76 |
return; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
77 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
78 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
79 |
/* ========================================================================== */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
80 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
81 |
/** Agent library initialization. */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
82 |
#ifdef STATIC_BUILD |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
83 |
JNIEXPORT jint JNICALL Agent_OnLoad_ma02t001(JavaVM *jvm, char *options, void *reserved) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
84 |
return Agent_Initialize(jvm, options, reserved); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
85 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
86 |
JNIEXPORT jint JNICALL Agent_OnAttach_ma02t001(JavaVM *jvm, char *options, void *reserved) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
87 |
return Agent_Initialize(jvm, options, reserved); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
88 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
89 |
JNIEXPORT jint JNI_OnLoad_ma02t001(JavaVM *jvm, char *options, void *reserved) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
90 |
return JNI_VERSION_1_8; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
91 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
92 |
#endif |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
93 |
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
94 |
jvmtiEnv* jvmti = NULL; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
95 |
jvmtiEventCallbacks callbacks; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
96 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
97 |
NSK_DISPLAY0("Agent_OnLoad\n"); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
98 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
99 |
if (!NSK_VERIFY(nsk_jvmti_parseOptions(options))) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
100 |
return JNI_ERR; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
101 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
102 |
timeout = nsk_jvmti_getWaitTime() * 60 * 1000; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
103 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
104 |
if (!NSK_VERIFY((jvmti = |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
105 |
nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
106 |
return JNI_ERR; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
107 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
108 |
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL))) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
109 |
return JNI_ERR; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
110 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
111 |
memset(&callbacks, 0, sizeof(callbacks)); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
112 |
callbacks.VMInit = &VMInit; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
113 |
callbacks.VMDeath = &VMDeath; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
114 |
if (!NSK_VERIFY(nsk_jvmti_init_MA(&callbacks))) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
115 |
return JNI_ERR; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
116 |
|
52184
672bc2213cef
8211899: Remove the NSK_CPP_STUB macros from vmTestbase for jvmti/scenarios/[E-M]
jcbeyler
parents:
51774
diff
changeset
|
117 |
if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL))) |
50260
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
118 |
return JNI_ERR; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
119 |
|
52184
672bc2213cef
8211899: Remove the NSK_CPP_STUB macros from vmTestbase for jvmti/scenarios/[E-M]
jcbeyler
parents:
51774
diff
changeset
|
120 |
if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL))) |
50260
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
121 |
return JNI_ERR; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
122 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
123 |
return JNI_OK; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
124 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
125 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
126 |
/* ========================================================================== */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
127 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
128 |
/* agent library shutdown */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
129 |
JNIEXPORT void JNICALL |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
130 |
#ifdef STATIC_BUILD |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
131 |
Agent_OnUnload_ma02t001(JavaVM *jvm) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
132 |
#else |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
133 |
Agent_OnUnload(JavaVM *jvm) |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
134 |
#endif |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
135 |
{ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
136 |
const char* KEY_PHRASE = "Agent_OnUnload() of the 1st agent"; |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
137 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
138 |
fprintf(stdout, "%s\n", KEY_PHRASE); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
139 |
fflush(stdout); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
140 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
141 |
if (VMDeathEventsCount != VMDeathEventsExpected) { |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
142 |
NSK_COMPLAIN2("Wrong number of VM death events: %d, expected: %d\n", |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
143 |
VMDeathEventsCount, VMDeathEventsExpected); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
144 |
exit(97); |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
145 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
146 |
} |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
147 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
148 |
/* ========================================================================== */ |
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
149 |
|
46c67f5e27c2
8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff
changeset
|
150 |
} |