[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/22] test-qobject-input-visitor: Wean off UserDefListUnion
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 12/22] test-qobject-input-visitor: Wean off UserDefListUnion |
Date: |
Tue, 14 Sep 2021 07:50:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Eric Blake <eblake@redhat.com> writes:
> On Mon, Sep 13, 2021 at 02:39:22PM +0200, Markus Armbruster wrote:
>> The test_visitor_in_list_union_FOO() use simple union UserDefListUnion
>> to cover lists of builtin types. Rewrite as
>> test_visitor_in_list_struct(), using struct ArrayStruct and a lot less
>> code.
>>
>> test_visitor_in_fail_union_list() uses UserDefListUnion to cover
>> "variant members don't match the discriminator value". Cover that in
>> test_visitor_in_fail_union_flat() instead, and drop
>> test_visitor_in_fail_union_list(). Appropriating the former for this
>> purpose is okay, because it actually failed due to missing
>> discriminator, which is still covered by
>> test_visitor_in_fail_union_flat_no_discrim().
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>> tests/unit/test-qobject-input-visitor.c | 460 ++++++++----------------
>> 1 file changed, 148 insertions(+), 312 deletions(-)
>>
>> @@ -1206,7 +1066,7 @@ static void
>> test_visitor_in_fail_union_flat(TestInputVisitorData *data,
>> Error *err = NULL;
>> Visitor *v;
>>
>> - v = visitor_input_test_init(data, "{ 'string': 'c', 'integer': 41,
>> 'boolean': true }");
>> + v = visitor_input_test_init(data, "{ 'enum1': 'value2', 'string': 'c',
>> 'integer': 41, 'boolean': true }");
>
> Long line; do we care?
We have loads of similar lines in unit tests, and I've given up on
them.
> Reviewed-by: Eric Blake <eblake@redhat.com>
Thanks!
- [PATCH 10/22] qapi: Convert simple union TransactionAction to flat one, (continued)
- [PATCH 10/22] qapi: Convert simple union TransactionAction to flat one, Markus Armbruster, 2021/09/13
- [PATCH 05/22] qapi: Convert simple union TpmTypeOptions to flat one, Markus Armbruster, 2021/09/13
- [PATCH 04/22] qapi: Convert simple union InputEvent to flat one, Markus Armbruster, 2021/09/13
- [PATCH 12/22] test-qobject-input-visitor: Wean off UserDefListUnion, Markus Armbruster, 2021/09/13
- [PATCH 11/22] tests/qapi-schema: Prepare for simple union UserDefListUnion removal, Markus Armbruster, 2021/09/13
- [PATCH 16/22] tests/qapi-schema: Simple union UserDefListUnion is now unused, drop, Markus Armbruster, 2021/09/13
- [PATCH 14/22] test-clone-visitor: Wean off UserDefListUnion, Markus Armbruster, 2021/09/13
- [PATCH 15/22] tests/qapi-schema: Wean off UserDefListUnion, Markus Armbruster, 2021/09/13
- [PATCH 22/22] test-clone-visitor: Correct an accidental rename, Markus Armbruster, 2021/09/13