From: Jiri Denemark Date: Mon, 6 Dec 2010 11:58:56 +0000 (+0100) Subject: tests: Fix detection of expected error X-Git-Tag: v0.8.7~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1c1ff7e47f92a1d05619650bd7fb357aa689efb;p=thirdparty%2Flibvirt.git tests: Fix detection of expected error --- diff --git a/tests/commandtest.c b/tests/commandtest.c index 9ccbcef82e..1b02b168e7 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 (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;