Handle failure to parse the JSON in an else branch for readability.

Signed-off-by: Ján Tomko <jto...@redhat.com>
---
 tests/virjsontest.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/virjsontest.c b/tests/virjsontest.c
index 429eb58704..3c4bb4141a 100644
--- a/tests/virjsontest.c
+++ b/tests/virjsontest.c
@@ -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);
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to