]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: invert the return logic in storagepoolcapstest
authorPavel Hrdina <phrdina@redhat.com>
Wed, 6 Mar 2019 18:14:16 +0000 (19:14 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 7 Mar 2019 11:01:09 +0000 (12:01 +0100)
This way if the first test "full" fails we will run the second test as
well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
tests/storagepoolcapstest.c

index c59069ff7c0e5a0810cfd1d37e383c37fca5e6bf..f8b560c2f025fd2401d70a26d72697383d781c23 100644 (file)
@@ -84,7 +84,7 @@ test_virStoragePoolCapsFormat(const void *opaque)
 static int
 mymain(void)
 {
-    int ret = -1;
+    int ret = 0;
     virCapsPtr fullCaps = NULL;
     virCapsPtr fsCaps = NULL;
 
@@ -93,12 +93,14 @@ mymain(void)
         struct test_virStoragePoolCapsFormatData data = \
             {.filename = Filename, .driverCaps = DriverCaps }; \
         if (virTestRun(Filename, test_virStoragePoolCapsFormat, &data) < 0) \
-            goto cleanup; \
+            ret = -1; \
     } while (0)
 
     if (!(fullCaps = virCapabilitiesNew(VIR_ARCH_NONE, false, false)) ||
-        !(fsCaps = virCapabilitiesNew(VIR_ARCH_NONE, false, false)))
+        !(fsCaps = virCapabilitiesNew(VIR_ARCH_NONE, false, false))) {
+        ret = -1;
         goto cleanup;
+    }
 
     test_virCapabilitiesAddFullStoragePool(fullCaps);
     test_virCapabilitiesAddFSStoragePool(fsCaps);
@@ -106,8 +108,6 @@ mymain(void)
     DO_TEST("full", fullCaps);
     DO_TEST("fs", fsCaps);
 
-    ret = 0;
-
  cleanup:
     virObjectUnref(fullCaps);
     virObjectUnref(fsCaps);