[libvirt] [PATCH 4/4] tests: Fix detection of expected error
Eric Blake
eblake at redhat.com
Mon Dec 6 20:53:07 UTC 2010
On 12/06/2010 05:03 AM, Jiri Denemark wrote:
> ---
> 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;
ACK.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101206/518710ea/attachment-0001.sig>
More information about the libvir-list
mailing list