summaryrefslogtreecommitdiffstats
path: root/tests/qapi-schema/flat-union-invalid-if-discriminator.json
diff options
context:
space:
mode:
authorPeter Maydell2018-12-15 22:19:06 +0100
committerPeter Maydell2018-12-15 22:19:06 +0100
commit81781be3c99235a59c8efee6aecb3d81b500e838 (patch)
treee605a8e00d78bbe653ad4a09a373df3591f8ba9c /tests/qapi-schema/flat-union-invalid-if-discriminator.json
parentMerge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (diff)
parentqapi: add conditions to REPLICATION type/commands on the schema (diff)
downloadqemu-81781be3c99235a59c8efee6aecb3d81b500e838.tar.gz
qemu-81781be3c99235a59c8efee6aecb3d81b500e838.tar.xz
qemu-81781be3c99235a59c8efee6aecb3d81b500e838.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2018-12-13-v2' into staging
QAPI patches for 2018-12-13 # gpg: Signature made Fri 14 Dec 2018 05:53:51 GMT # gpg: using RSA key 3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2018-12-13-v2: (32 commits) qapi: add conditions to REPLICATION type/commands on the schema qapi: add more conditions to SPICE qapi: add condition to variants documentation qapi: add 'If:' condition to struct members documentation qapi: add 'If:' condition to enum values documentation qapi: Add #if conditions to generated code members qapi: add 'if' to alternate members qapi: add 'if' to union members qapi: Add 'if' to implicit struct members qapi: add a dictionary form for TYPE qapi-events: add 'if' condition to implicit event enum qapi: add 'if' to enum members qapi: add a dictionary form with 'name' key for enum members qapi: improve reporting of unknown or missing keys qapi: factor out checking for keys tests: print enum type members more like object type members qapi: change enum visitor and gen_enum* to take QAPISchemaMember qapi: Do not define enumeration value explicitly qapi: break long lines at 'data' member qapi: rename QAPISchemaEnumType.values to .members ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/qapi-schema/flat-union-invalid-if-discriminator.json')
-rw-r--r--tests/qapi-schema/flat-union-invalid-if-discriminator.json17
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' } }