[libvirt] [PATCHv2 02/14] testJSONFromString: regroup if blocks
Ján Tomko
jtomko at redhat.com
Tue Apr 2 15:41:41 UTC 2019
Handle failure to parse the JSON in an else branch for readability.
Signed-off-by: Ján Tomko <jtomko at 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
More information about the libvir-list
mailing list