Eric Blake <ebl...@redhat.com> writes: > On 07/27/2018 10:13 AM, Markus Armbruster wrote: >> qtest_qmp_discard_response(...) is shorthand for >> qobject_unref(qtest_qmp(...), except it's not actually shorter. >> Moreover, the presence of these functions encourage sloppy testing. >> Remove them. >> >> Signed-off-by: Markus Armbruster <arm...@redhat.com> >> --- > > Reviewed-by: Eric Blake <ebl...@redhat.com> > > >> +++ b/tests/ahci-test.c >> @@ -1607,14 +1607,14 @@ static void test_atapi_tray(void) >> atapi_wait_tray(true); >> /* Re-insert media */ >> - qmp_discard_response("{'execute': 'blockdev-add', " >> + qobject_unref(qmp("{'execute': 'blockdev-add', " >> "'arguments': {'node-name': 'node0', " >> "'driver': 'raw', " >> "'file': { 'driver': 'file', " >> - "'filename': %s }}}", >> iso); >> - qmp_discard_response("{'execute': 'blockdev-insert-medium'," >> + "'filename': %s }}}", iso)); > > Why did you fix indentation for some, but not all, of the lines here?
Editing accident, fixing. >> + qobject_unref(qmp("{'execute': 'blockdev-insert-medium'," >> "'arguments': { 'id': 'cd0', " >> - "'node-name': 'node0' }}"); >> + "'node-name': 'node0' }}")); > > Again, indentation looks odd. Likewise. >> +++ b/tests/fdc-test.c >> @@ -26,6 +26,7 @@ >> #include "libqtest.h" >> +#include "qapi/qmp/qdict.h" >> #include "qemu-common.h" >> #define TEST_IMAGE_SIZE 1440 * 1024 >> @@ -298,9 +299,9 @@ static void test_media_insert(void) >> /* Insert media in drive. DSKCHK should not be reset until a >> step pulse >> * is sent. */ >> - qmp_discard_response("{'execute':'blockdev-change-medium', >> 'arguments':{" >> + qobject_unref(qmp("{'execute':'blockdev-change-medium', 'arguments':{" >> " 'id':'floppy0', 'filename': %s, 'format': 'raw' >> }}", >> - test_image); >> + test_image)); > > Another place where indentation looks odd. Likewise. > Reviewed-by: Eric Blake <ebl...@redhat.com> Thanks!