From eb918b903330693d6ad1b002ca4689df980b6e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 2 Apr 2019 16:06:52 +0200 Subject: [PATCH] testJSONFromString: regroup if blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle failure to parse the JSON in an else branch for readability. Signed-off-by: Ján Tomko --- tests/virjsontest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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);