]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: bhyve: remove unnecessary labels
authorJán Tomko <jtomko@redhat.com>
Tue, 28 Jul 2020 00:58:58 +0000 (02:58 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 3 Aug 2020 05:23:46 +0000 (07:23 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
tests/bhyveargv2xmltest.c
tests/bhyvexml2argvtest.c

index e7ec3ae020a36dcb9f3851b4fc171c71220c59f2..2a497f48e854d3825e4a9d6c1eb6ca518e2ecf74 100644 (file)
@@ -31,11 +31,10 @@ testCompareXMLToArgvFiles(const char *xmlfile,
     g_autofree char *actualxml = NULL;
     g_autofree char *cmd = NULL;
     g_autofree char *log = NULL;
-    int ret = -1;
     g_autoptr(virDomainDef) vmdef = NULL;
 
     if (virTestLoadFile(cmdfile, &cmd) < 0)
-        goto fail;
+        return -1;
 
     if (!(vmdef = bhyveParseCommandLineString(cmd, driver.bhyvecaps,
                                               driver.xmlopt))) {
@@ -43,16 +42,16 @@ testCompareXMLToArgvFiles(const char *xmlfile,
             VIR_TEST_DEBUG("Got expected failure from "
                            "bhyveParseCommandLineString.");
         } else {
-            goto fail;
+            return -1;
         }
     } else if ((flags & FLAG_EXPECT_FAILURE)) {
         VIR_TEST_DEBUG("Did not get expected failure from "
                        "bhyveParseCommandLineString.");
-        goto fail;
+        return -1;
     }
 
     if ((log = virTestLogContentAndReset()) == NULL)
-        goto fail;
+        return -1;
     if (flags & FLAG_EXPECT_WARNING) {
         if (*log) {
             VIR_TEST_DEBUG("Got expected warning from "
@@ -61,32 +60,29 @@ testCompareXMLToArgvFiles(const char *xmlfile,
         } else {
             VIR_TEST_DEBUG("bhyveParseCommandLineString "
                            "should have logged a warning");
-            goto fail;
+            return -1;
         }
     } else { /* didn't expect a warning */
         if (*log) {
             VIR_TEST_DEBUG("Got unexpected warning from "
                            "bhyveParseCommandLineString:\n%s",
                            log);
-            goto fail;
+            return -1;
         }
     }
 
     if (vmdef && !virDomainDefCheckABIStability(vmdef, vmdef, driver.xmlopt)) {
         VIR_TEST_DEBUG("ABI stability check failed on %s", xmlfile);
-        goto fail;
+        return -1;
     }
 
     if (vmdef && !(actualxml = virDomainDefFormat(vmdef, driver.xmlopt, 0)))
-        goto fail;
+        return -1;
 
     if (vmdef && virTestCompareToFile(actualxml, xmlfile) < 0)
-        goto fail;
+        return -1;
 
-    ret = 0;
-
- fail:
-    return ret;
+    return 0;
 }
 
 struct testInfo {
@@ -97,7 +93,6 @@ struct testInfo {
 static int
 testCompareXMLToArgvHelper(const void *data)
 {
-    int result = -1;
     const struct testInfo *info = data;
     g_autofree char *xml = NULL;
     g_autofree char *args = NULL;
@@ -107,8 +102,7 @@ testCompareXMLToArgvHelper(const void *data)
     args = g_strdup_printf("%s/bhyveargv2xmldata/bhyveargv2xml-%s.args",
                            abs_srcdir, info->name);
 
-    result = testCompareXMLToArgvFiles(xml, args, info->flags);
-    return result;
+    return testCompareXMLToArgvFiles(xml, args, info->flags);
 }
 
 static int
index 33e7ac5772d893a15c451c1cf72d704cc2212ff2..7ce4dc6e58ab67f127672ebad968ad7458790793 100644 (file)
@@ -110,7 +110,6 @@ struct testInfo {
 static int
 testCompareXMLToArgvHelper(const void *data)
 {
-    int ret = -1;
     const struct testInfo *info = data;
     g_autofree char *xml = NULL;
     g_autofree char *args = NULL;
@@ -126,9 +125,7 @@ testCompareXMLToArgvHelper(const void *data)
     dmargs = g_strdup_printf("%s/bhyvexml2argvdata/bhyvexml2argv-%s.devmap",
                              abs_srcdir, info->name);
 
-    ret = testCompareXMLToArgvFiles(xml, args, ldargs, dmargs, info->flags);
-
-    return ret;
+    return testCompareXMLToArgvFiles(xml, args, ldargs, dmargs, info->flags);
 }
 
 static int