[PATCH 2/3] tests: invert the return logic in storagepoolcapstest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This way if the first test "full" fails we will run the second test as
well.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 tests/storagepoolcapstest.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/storagepoolcapstest.c b/tests/storagepoolcapstest.c
index ade586bcdd..da21bca546 100644
--- a/tests/storagepoolcapstest.c
+++ b/tests/storagepoolcapstest.c
@@ -85,7 +85,7 @@ test_virStoragePoolCapsFormat(const void *opaque)
 static int
 mymain(void)
 {
-    int ret = -1;
+    int ret = 0;
     virCapsPtr fullCaps = NULL;
     virCapsPtr fsCaps = NULL;
 
@@ -94,12 +94,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);
@@ -107,8 +109,6 @@ mymain(void)
     DO_TEST("full", fullCaps);
     DO_TEST("fs", fsCaps);
 
-    ret = 0;
-
  cleanup:
     virObjectUnref(fullCaps);
     virObjectUnref(fsCaps);
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux