mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
tests: Fix detection of expected error
This commit is contained in:
parent
49c612b39e
commit
c1c1ff7e47
@ -102,17 +102,15 @@ cleanup:
|
|||||||
static int test0(const void *unused ATTRIBUTE_UNUSED)
|
static int test0(const void *unused ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
virCommandPtr cmd;
|
virCommandPtr cmd;
|
||||||
char *log;
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
free(virtTestLogContentAndReset());
|
|
||||||
cmd = virCommandNew(abs_builddir "/commandhelper-doesnotexist");
|
cmd = virCommandNew(abs_builddir "/commandhelper-doesnotexist");
|
||||||
if (virCommandRun(cmd, NULL) == 0)
|
if (virCommandRun(cmd, NULL) == 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if ((log = virtTestLogContentAndReset()) == NULL)
|
|
||||||
goto cleanup;
|
if (virGetLastError() == NULL)
|
||||||
if (strstr(log, ": error :") == NULL)
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user