[PATCH 05/23] Don't clobber 'ret' in LXC XML test case

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The testCompareXMLToXMLHelper method clobbered the 'ret' variable
in several places leading to a failure to report OOM errors from
the test suite.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 tests/lxcxml2xmltest.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c
index ca05d29..aeb3940 100644
--- a/tests/lxcxml2xmltest.c
+++ b/tests/lxcxml2xmltest.c
@@ -79,18 +79,23 @@ testCompareXMLToXMLHelper(const void *data)
         goto cleanup;
 
     if (info->different) {
-        ret = testCompareXMLToXMLFiles(xml_in, xml_out, false);
+        if (testCompareXMLToXMLFiles(xml_in, xml_out, false) < 0)
+            goto cleanup;
     } else {
-        ret = testCompareXMLToXMLFiles(xml_in, xml_in, false);
+        if (testCompareXMLToXMLFiles(xml_in, xml_in, false) < 0)
+            goto cleanup;
     }
     if (!info->inactive_only) {
         if (info->different) {
-            ret = testCompareXMLToXMLFiles(xml_in, xml_out, true);
+            if (testCompareXMLToXMLFiles(xml_in, xml_out, true) < 0)
+                goto cleanup;
         } else {
-            ret = testCompareXMLToXMLFiles(xml_in, xml_in, true);
+            if (testCompareXMLToXMLFiles(xml_in, xml_in, true) < 0)
+                goto cleanup;
         }
     }
 
+    ret = 0;
 cleanup:
     VIR_FREE(xml_in);
     VIR_FREE(xml_out);
-- 
1.8.3.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]