]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Fix detection of expected error
authorJiri Denemark <jdenemar@redhat.com>
Mon, 6 Dec 2010 11:58:56 +0000 (12:58 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 7 Dec 2010 16:11:25 +0000 (17:11 +0100)
tests/commandtest.c

index 9ccbcef82e50d005d9589a2d25d1c469320d4fbf..1b02b168e740cdaa67b81e189d01f07ad387dceb 100644 (file)
@@ -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 (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;