]> xenbits.xensource.com Git - libvirt.git/commitdiff
Don't clobber 'ret' in LXC XML test case
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 08:35:29 +0000 (09:35 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 17:12:08 +0000 (18:12 +0100)
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@redhat.com>
tests/lxcxml2xmltest.c

index ca05d291f755d4e79595995f7dffad1eb7e40ce3..aeb394085c8999fb6c31690e8a887f72c35d0a0e 100644 (file)
@@ -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);