test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretbase/earlyretbase.cpp
equal
deleted
inserted
replaced
83 if (!caps.can_force_early_return || !caps.can_suspend) { |
83 if (!caps.can_force_early_return || !caps.can_suspend) { |
84 return PASSED; |
84 return PASSED; |
85 } |
85 } |
86 |
86 |
87 printf(">>>>>>>> Invoke SuspendThread()\n"); |
87 printf(">>>>>>>> Invoke SuspendThread()\n"); |
88 if ((err = (jvmti->SuspendThread(earlyretThr))) |
88 err = jvmti->SuspendThread(earlyretThr); |
89 != JVMTI_ERROR_NONE) { |
89 if (err != JVMTI_ERROR_NONE) { |
90 printf("%s: Failed to call SuspendThread(): error=%d: %s\n", |
90 printf("%s: Failed to call SuspendThread(): error=%d: %s\n", |
91 __FILE__, err, TranslateError(err)); |
91 __FILE__, err, TranslateError(err)); |
92 return JNI_ERR; |
92 return JNI_ERR; |
93 } |
93 } |
94 printf("<<<<<<<< SuspendThread() is successfully done\n"); |
94 printf("<<<<<<<< SuspendThread() is successfully done\n"); |
104 if (!caps.can_force_early_return || !caps.can_suspend) { |
104 if (!caps.can_force_early_return || !caps.can_suspend) { |
105 return PASSED; |
105 return PASSED; |
106 } |
106 } |
107 |
107 |
108 printf(">>>>>>>> Invoke ResumeThread()\n"); |
108 printf(">>>>>>>> Invoke ResumeThread()\n"); |
109 if ((err = (jvmti->ResumeThread(earlyretThr))) |
109 err = jvmti->ResumeThread(earlyretThr); |
110 != JVMTI_ERROR_NONE) { |
110 if (err != JVMTI_ERROR_NONE) { |
111 printf("%s: Failed to call ResumeThread(): error=%d: %s\n", |
111 printf("%s: Failed to call ResumeThread(): error=%d: %s\n", |
112 __FILE__, err, TranslateError(err)); |
112 __FILE__, err, TranslateError(err)); |
113 return JNI_ERR; |
113 return JNI_ERR; |
114 } |
114 } |
115 printf("<<<<<<<< ResumeThread() is successfully done\n"); |
115 printf("<<<<<<<< ResumeThread() is successfully done\n"); |
166 printf("Cannot find Method ID for method %s\n", name_exp); |
166 printf("Cannot find Method ID for method %s\n", name_exp); |
167 RETURN_FAILED; |
167 RETURN_FAILED; |
168 } |
168 } |
169 printf("After call to GetMethodID(%s, %s)\n", name_exp, sig_exp); |
169 printf("After call to GetMethodID(%s, %s)\n", name_exp, sig_exp); |
170 |
170 |
171 if ((err = (jvmti->ForceEarlyReturnLong(earlyretThr, valToRet))) |
171 err = jvmti->ForceEarlyReturnLong(earlyretThr, valToRet); |
172 != JVMTI_ERROR_NONE) { |
172 if (err != JVMTI_ERROR_NONE) { |
173 printf("TEST FAILED: the function ForceEarlyReturn()" |
173 printf("TEST FAILED: the function ForceEarlyReturn()" |
174 " returned the error %d: %s\n", |
174 " returned the error %d: %s\n", |
175 err, TranslateError(err)); |
175 err, TranslateError(err)); |
176 printf("\tFor more info about this error see the JVMTI spec.\n"); |
176 printf("\tFor more info about this error see the JVMTI spec.\n"); |
177 RETURN_FAILED; |
177 RETURN_FAILED; |