diff options
author | Markus Armbruster | 2019-09-14 17:34:50 +0200 |
---|---|---|
committer | Markus Armbruster | 2019-09-24 14:07:22 +0200 |
commit | cd346bdc46eb2046d7f744135a7e3d740490d166 (patch) | |
tree | 568af81e8465c7b59f2b118553f97a9a03d693b0 /scripts/qapi/visit.py | |
parent | tests/qapi-schema: Delete two redundant tests (diff) | |
download | qemu-cd346bdc46eb2046d7f744135a7e3d740490d166.tar.gz qemu-cd346bdc46eb2046d7f744135a7e3d740490d166.tar.xz qemu-cd346bdc46eb2046d7f744135a7e3d740490d166.zip |
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 'scripts/qapi/visit.py')
0 files changed, 0 insertions, 0 deletions