Eric Blake <ebl...@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 <arm...@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 <ebl...@redhat.com> Thanks!