From: Ján Tomko Date: Tue, 2 Apr 2019 14:06:52 +0000 (+0200) Subject: testJSONFromString: regroup if blocks X-Git-Tag: v5.3.0-rc1~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb918b903330693d6ad1b002ca4689df980b6e1c;p=thirdparty%2Flibvirt.git testJSONFromString: regroup if blocks Handle failure to parse the JSON in an else branch for readability. Signed-off-by: Ján Tomko --- diff --git a/tests/virjsontest.c b/tests/virjsontest.c index f369c069ea..8481460e92 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);