qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/6] tests/qtest: replace qmp_discard_response with qtest_


From: Juan Quintela
Subject: Re: [PATCH v2 1/6] tests/qtest: replace qmp_discard_response with qtest_qmp_assert_success
Date: Fri, 21 Apr 2023 23:52:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Daniel P. Berrangé <berrange@redhat.com> wrote:
> The qmp_discard_response method simply ignores the result of the QMP
> command, merely unref'ing the object. This is a bad idea for tests
> as it leaves no trace if the QMP command unexpectedly failed. The
> qtest_qmp_assert_success method will validate that the QMP command
> returned without error, and if errors occur, it will print a message
> on the console aiding debugging.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  tests/qtest/ahci-test.c              | 31 ++++++++++++++--------------
>  tests/qtest/boot-order-test.c        |  5 +----
>  tests/qtest/fdc-test.c               | 15 +++++++-------
>  tests/qtest/ide-test.c               |  5 +----
>  tests/qtest/migration-test.c         |  5 +----
>  tests/qtest/test-filter-mirror.c     |  5 +----
>  tests/qtest/test-filter-redirector.c |  7 ++-----
>  tests/qtest/virtio-blk-test.c        | 24 ++++++++++-----------
>  8 files changed, 40 insertions(+), 57 deletions(-)

Reviewed-by: Juan Quintela <quintela@redhat.com>

> -/* TODO actually test the results and get rid of this */
> -#define qmp_discard_response(s, ...) qobject_unref(qtest_qmp(s, __VA_ARGS__))

As it couldn't be otherwise, all bad patterns are copied.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]