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

[libvirt] [PATCH 4/4] tests: Fix detection of expected error



---
 tests/commandtest.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tests/commandtest.c b/tests/commandtest.c
index e8decd3..fe7c08b 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -102,17 +102,15 @@ cleanup:
 static int test0(const void *unused ATTRIBUTE_UNUSED)
 {
     virCommandPtr cmd;
-    char *log;
     int ret = -1;
 
-    free(virtTestLogContentAndReset());
     cmd = virCommandNew(abs_builddir "/commandhelper-doesnotexist");
     if (!cmd || virCommandRun(cmd, NULL) == 0)
         goto cleanup;
-    if ((log = virtTestLogContentAndReset()) == NULL)
-        goto cleanup;
-    if (strstr(log, ": error :") == NULL)
+
+    if (virGetLastError() == NULL)
         goto cleanup;
+
     virResetLastError();
     ret = 0;
 
-- 
1.7.3.2


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