diff options
author | Markus Armbruster <armbru@redhat.com> | 2019-09-14 17:34:50 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2019-09-24 14:07:22 +0200 |
commit | cd346bdc46eb2046d7f744135a7e3d740490d166 (patch) | |
tree | 568af81e8465c7b59f2b118553f97a9a03d693b0 /tests/Makefile.include | |
parent | 352ada9ad46a2e67283e8201d8056c27e57c0447 (diff) |
tests/qapi-schema: Demonstrate misleading optional tag error
Test flat-union-optional-discriminator declares its union tag as
'*switch': 'Enum', and points to it with 'discriminator': '*switch'.
This gets rejected as "discriminator of flat union 'MyUnion' uses
invalid name '*switch'". Correct; member 'discriminator' doesn't
accept a '*' prefix.
However, this merely tests name validity checking, which we already
cover elsewhere. More interesting is testing the valid name 'switch'.
This reports "discriminator 'switch' is not a member of base struct
'Base'", which is misleading.
Copy the existing 'discriminator': '*switch' test to
flat-union-discriminator-bad-name, and rewrite its comment. Change
flat-union-optional-discriminator to test 'discriminator': 'switch',
and mark it FIXME.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190914153506.2151-4-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/Makefile.include')
-rw-r--r-- | tests/Makefile.include | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include index 0c862dbc42..7553616069 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -388,6 +388,7 @@ qapi-schema += flat-union-bad-discriminator.json qapi-schema += flat-union-base-any.json qapi-schema += flat-union-base-union.json qapi-schema += flat-union-clash-member.json +qapi-schema += flat-union-discriminator-bad-name.json qapi-schema += flat-union-empty.json qapi-schema += flat-union-inline.json qapi-schema += flat-union-inline-invalid-dict.json |