]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testJSONFromString: regroup if blocks
authorJán Tomko <jtomko@redhat.com>
Tue, 2 Apr 2019 14:06:52 +0000 (16:06 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 3 Apr 2019 12:41:07 +0000 (14:41 +0200)
Handle failure to parse the JSON in an else branch for readability.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
tests/virjsontest.c

index f369c069ea3b3bebc1eda467d171a2b1324fa9f2..8481460e92a476318e59a11ddc6c4e790ea0ded0 100644 (file)
@@ -36,11 +36,11 @@ testJSONFromString(const void *data)
             ret = 0;
             goto cleanup;
         }
-    }
-
-    if (!info->pass) {
-        VIR_TEST_VERBOSE("Should not have parsed %s\n", info->doc);
-        goto cleanup;
+    } else {
+        if (!info->pass) {
+            VIR_TEST_VERBOSE("Should not have parsed %s\n", info->name);
+            goto cleanup;
+        }
     }
 
     VIR_TEST_DEBUG("Parsed %s\n", info->doc);