diff options
Diffstat (limited to 'qemu/tests/qapi-schema/flat-union-bad-discriminator.json')
-rw-r--r-- | qemu/tests/qapi-schema/flat-union-bad-discriminator.json | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/qemu/tests/qapi-schema/flat-union-bad-discriminator.json b/qemu/tests/qapi-schema/flat-union-bad-discriminator.json new file mode 100644 index 000000000..cd10b9d90 --- /dev/null +++ b/qemu/tests/qapi-schema/flat-union-bad-discriminator.json @@ -0,0 +1,15 @@ +# we require the discriminator to be a string naming a base-type member +# this tests the old syntax for anonymous unions before we added alternates +{ 'enum': 'TestEnum', + 'data': [ 'value1', 'value2' ] } +{ 'struct': 'TestBase', + 'data': { 'enum1': 'TestEnum', 'kind': 'str' } } +{ 'struct': 'TestTypeA', + 'data': { 'string': 'str' } } +{ 'struct': 'TestTypeB', + 'data': { 'integer': 'int' } } +{ 'union': 'TestUnion', + 'base': 'TestBase', + 'discriminator': {}, + 'data': { 'kind1': 'TestTypeA', + 'kind2': 'TestTypeB' } } |