[PATCH] tests: Fix dispatching internal error reports

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

 



Without this fix, the test suite doesn't print error messages when a libvirt
function fails.

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 tests/testutils.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/testutils.c b/tests/testutils.c
index 96181b2..8a3439d 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -126,12 +126,18 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const
 
         if (ts)
             GETTIMEOFDAY(&before);
+
         virResetLastError();
-        if ((ret = body(data)) != 0)
-            break;
+        ret = body(data);
         virErrorPtr err = virGetLastError();
-        if (err)
+        if (err) {
             virDispatchError(NULL);
+        }
+
+        if (ret != 0) {
+            break;
+        }
+
         if (ts)	{
             GETTIMEOFDAY(&after);
             ts[i] = DIFF_MSEC(&after, &before);
-- 
1.7.3.2

--
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]