diff options
author | Marc-André Lureau | 2018-12-13 13:37:15 +0100 |
---|---|---|
committer | Markus Armbruster | 2018-12-13 19:20:11 +0100 |
commit | ccadd6bcba3bef6c1954f533b10224fb3db7148e (patch) | |
tree | d59e97424ade573166cc819f24c5ed8303e6aa6d /tests/qapi-schema/flat-union-invalid-if-discriminator.json | |
parent | qapi: add a dictionary form for TYPE (diff) | |
download | qemu-ccadd6bcba3bef6c1954f533b10224fb3db7148e.tar.gz qemu-ccadd6bcba3bef6c1954f533b10224fb3db7148e.tar.xz qemu-ccadd6bcba3bef6c1954f533b10224fb3db7148e.zip |
qapi: Add 'if' to implicit struct members
The generated code is for now *unconditional*. Later patches generate
the conditionals.
Note that union discriminators may not have 'if' conditionals.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20181213123724.4866-14-marcandre.lureau@redhat.com>
Message-Id: <20181213123724.4866-15-marcandre.lureau@redhat.com>
[Patches squashed, commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/flat-union-invalid-if-discriminator.json')
-rw-r--r-- | tests/qapi-schema/flat-union-invalid-if-discriminator.json | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/qapi-schema/flat-union-invalid-if-discriminator.json b/tests/qapi-schema/flat-union-invalid-if-discriminator.json new file mode 100644 index 0000000000..618ec36396 --- /dev/null +++ b/tests/qapi-schema/flat-union-invalid-if-discriminator.json @@ -0,0 +1,17 @@ +{ 'enum': 'TestEnum', + 'data': [ 'value1', 'value2' ] } + +{ 'struct': 'TestBase', + 'data': { 'enum1': { 'type': 'TestEnum', 'if': 'FOO' } } } + +{ 'struct': 'TestTypeA', + 'data': { 'string': 'str' } } + +{ 'struct': 'TestTypeB', + 'data': { 'integer': 'int' } } + +{ 'union': 'TestUnion', + 'base': 'TestBase', + 'discriminator': 'enum1', + 'data': { 'value1': 'TestTypeA', + 'value2': 'TestTypeB' } } |