[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_res
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_response() & friends |
Date: |
Mon, 30 Jul 2018 08:32:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 07/27/2018 11:46 AM, Thomas Huth wrote:
>> On 07/27/2018 05:13 PM, Markus Armbruster wrote:
>>> qtest_qmp_discard_response(...) is shorthand for
>>> qobject_unref(qtest_qmp(...), except it's not actually shorter.
>>
>> But the latter is IMHO harder to read.
Doing things sloppily looks a bit uglier now. That's a feature.
> Maybe, but then it lends itself well to:
>
> QObject *rsp = qtest_qmp(...);
> qobject_unref(rsp);
>
> which is where you do insert tests for valid responses.
>
>> And it might be shorter in the compiled binary (one function call vs. two).
I'd be quite sympathetic to this argument...
> The size of the test binaries is not our biggest concern.
... outside tests/.
>>> Moreover, the presence of these functions encourage sloppy testing.
>>
>> Shouldn't we then rather fix the tests to check for valid responses
>> instead of replacing this function with harder-to-read code?
I'd welcome such patches, but this series is already pretty long.
> I think such fixes are now easier to make, but can be separate
> followup patches. The mechanical conversion is fine to me.
- Re: [Qemu-devel] [PATCH v2 22/23] libqtest: Replace qtest_startf() by qtest_initf(), (continued)
- [Qemu-devel] [PATCH v2 18/23] migration-test: Clean up string interpolation into QMP, part 2, Markus Armbruster, 2018/07/27
- [Qemu-devel] [PATCH v2 17/23] migration-test: Clean up string interpolation into QMP, part 1, Markus Armbruster, 2018/07/27
- [Qemu-devel] [PATCH v2 12/23] cpu-plug-test: Don't pass integers as strings to device_add, Markus Armbruster, 2018/07/27
- [Qemu-devel] [PATCH v2 20/23] libqtest: Enable compile-time format string checking, Markus Armbruster, 2018/07/27