Re: [PATCH 09/14] tests/qapi-schema: Improve union discriminator coverage

2023-03-16 Thread Markus Armbruster
Eric Blake writes: > On Thu, Mar 16, 2023 at 08:13:20AM +0100, Markus Armbruster wrote: >> A union's 'discriminator' must name a one of the common members. > > s/ a// Yes. >> QAPISchemaVariants.check() looks it up by its c_name(), then checks >> the name matches exactly (because c_name() is not

Re: [PATCH 09/14] tests/qapi-schema: Improve union discriminator coverage

2023-03-16 Thread Eric Blake
On Thu, Mar 16, 2023 at 08:13:20AM +0100, Markus Armbruster wrote: > A union's 'discriminator' must name a one of the common members. s/ a// > QAPISchemaVariants.check() looks it up by its c_name(), then checks > the name matches exactly (because c_name() is not injective). > > Tests union-base-

[PATCH 09/14] tests/qapi-schema: Improve union discriminator coverage

2023-03-16 Thread Markus Armbruster
A union's 'discriminator' must name a one of the common members. QAPISchemaVariants.check() looks it up by its c_name(), then checks the name matches exactly (because c_name() is not injective). Tests union-base-empty and union-invalid-discriminator both cover the case where lookup fails. Repurpo