qemu-devel
[Top][All Lists]
Advanced

[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!




reply via email to

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