[PATCHv2 02/14] testJSONFromString: regroup if blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux