From 583a561a4f2aec353f99e3f870d758a910e77ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Sat, 4 Sep 2021 22:39:27 +0200 Subject: [PATCH] tests: vmx: remove pointless labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ján Tomko Reviewed-by: Laine Stump --- tests/vmx2xmltest.c | 23 +++++++++-------------- tests/xml2vmxtest.c | 15 +++++---------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index b7f232eb77..98b34c9f67 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -68,7 +68,6 @@ testCapsInit(void) static int testCompareFiles(const char *vmx, const char *xml, bool should_fail_parse) { - int ret = -1; g_autofree char *vmxData = NULL; g_autofree char *formatted = NULL; g_autoptr(virDomainDef) def = NULL; @@ -79,31 +78,27 @@ testCompareFiles(const char *vmx, const char *xml, bool should_fail_parse) def = virVMXParseConfig(&ctx, xmlopt, caps, vmxData); if (should_fail_parse) { if (!def) - ret = 0; - else - VIR_TEST_DEBUG("passed instead of expected failure"); - goto cleanup; + return 0; + + VIR_TEST_DEBUG("passed instead of expected failure"); + return -1; } if (!def) - goto cleanup; + return -1; if (!virDomainDefCheckABIStability(def, def, xmlopt)) { fprintf(stderr, "ABI stability check failed on %s", vmx); - goto cleanup; + return -1; } if (!(formatted = virDomainDefFormat(def, xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE))) - goto cleanup; + return -1; if (virTestCompareToFile(formatted, xml) < 0) - goto cleanup; + return -1; - ret = 0; - - cleanup: - - return ret; + return 0; } struct testInfo { diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index 8a03237b16..60185746a8 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -70,7 +70,6 @@ testCapsInit(void) static int testCompareFiles(const char *xml, const char *vmx, int virtualHW_version) { - int result = -1; g_autofree char *formatted = NULL; g_autoptr(virDomainDef) def = NULL; @@ -78,25 +77,21 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version) VIR_DOMAIN_DEF_PARSE_INACTIVE); if (def == NULL) - goto failure; + return -1; if (!virDomainDefCheckABIStability(def, def, xmlopt)) { fprintf(stderr, "ABI stability check failed on %s", xml); - goto failure; + return -1; } formatted = virVMXFormatConfig(&ctx, xmlopt, def, virtualHW_version); if (formatted == NULL) - goto failure; + return -1; if (virTestCompareToFile(formatted, vmx) < 0) - goto failure; + return -1; - result = 0; - - failure: - - return result; + return 0; } struct testInfo {