testJSONFromString: regroup if blocks

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Ján Tomko 2019-04-02 16:06:52 +02:00
parent ee3e23a790
commit eb918b9033

View File

@ -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);