[libvirt] [PATCH] tests: Fix misplaced parenthesis in qemumonitorjsontest
Ján Tomko
jtomko at redhat.com
Wed Dec 3 13:57:15 UTC 2014
On 12/03/2014 02:45 PM, Martin Kletzander wrote:
> When trying clang, it found out that we were comparing sizeof with 0
> even though we wanted to check the return value of memcmp.
>
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
> tests/qemumonitorjsontest.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
> index 5bfcd20..d3ae29a 100644
> --- a/tests/qemumonitorjsontest.c
> +++ b/tests/qemumonitorjsontest.c
> @@ -1879,7 +1879,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(const void *data)
> "drive-virtio-disk0", &info, false) < 0)
> goto cleanup;
>
> - if (memcmp(&info, &expectedInfo, sizeof(info) != 0)) {
> + if (memcmp(&info, &expectedInfo, sizeof(info)) != 0) {
> virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> "Invalid @info");
> goto cleanup;
>
The test fails after this change, because the options added by
commit d506a51aeb2a7a7b0c963f760e32b94376ea7173
qemu: Add bps_max and friends qemu driver
aren't filled in by the above qemuMonitorJSONSetBlockIoThrottle call.
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141203/1a0293e5/attachment-0001.sig>
More information about the libvir-list
mailing list