diff test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab002/setjniftab002.cpp @ 53610:9cfc8b0c45fd

8214149: Move out assignments when not using NSK*VERIFY macros Summary: Move out the assignments from ifs Reviewed-by: sspitsyn, cjplummer
author jcbeyler
date Wed, 21 Nov 2018 10:46:45 -0800
parents cdfabab3413f
children
line wrap: on
line diff
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab002/setjniftab002.cpp	Wed Nov 21 18:44:11 2018 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab002/setjniftab002.cpp	Wed Nov 21 10:46:45 2018 -0800
@@ -45,8 +45,8 @@
         printf("\ntrying to overwrite the JNI function table expecting the error %s to be returned ...\n",
             TranslateError(exError));
 
-    if ((err = jvmti->SetJNIFunctionTable(NULL)) !=
-            exError) {
+    err = jvmti->SetJNIFunctionTable(NULL);
+    if (err != exError) {
         result = STATUS_FAILED;
         printf("(%s,%d): TEST FAILED: SetJNIFunctionTable() returns %s instead of %s as expected\n",
             __FILE__, __LINE__, TranslateError(err), TranslateError(exError));
@@ -78,7 +78,8 @@
        only since JDK 1.2 */
     if (verbose)
         printf("\nb) Checking the function with the detached thread ...\n\ndetaching the main thread ...\n");
-    if ((res = vm->DetachCurrentThread()) != JNI_OK) {
+    res = vm->DetachCurrentThread();
+    if (res != JNI_OK) {
         printf(
             "(%s,%d): Warning: DetachCurrentThread() returns: %d\n"
             "\tcheck with the detached main thread skipped\n",
@@ -88,7 +89,8 @@
 
         if (verbose)
             printf("\nattaching the main thread back ...\n");
-        if ((res = vm->AttachCurrentThread((void **) &nextEnv, (void *) 0)) != JNI_OK) {
+        res = vm->AttachCurrentThread((void **) &nextEnv, (void *) 0);
+        if (res != JNI_OK) {
             printf("(%s,%d): TEST FAILURE: waitingThread: AttachCurrentThread() returns: %d\n",
                 __FILE__, __LINE__, res);
             return STATUS_FAILED;