summaryrefslogtreecommitdiff
path: root/tests/qapi-schema/qapi-schema-test.json
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-02-16 16:39:25 -0700
committerMarkus Armbruster <armbru@redhat.com>2016-02-19 11:08:56 +0100
commit9d3524b39e1fe5f3bb7a990ad7841e469e954a3b (patch)
tree69b1e62876d7f4d04a831c7b0634f1912ca23640 /tests/qapi-schema/qapi-schema-test.json
parentdd5e38b19d7cb07d317e1285941d8245c01da540 (diff)
downloadqemu-9d3524b39e1fe5f3bb7a990ad7841e469e954a3b.tar.gz
qapi-visit: Honor prefix of discriminator enum
When we added support for a user-specified prefix for an enum type (commit 351d36e), we forgot to teach the qapi-visit code to honor that prefix in the case of using a prefixed enum as the discriminator for a flat union. While there is still some on-list debate on whether we want to keep prefixes, we should at least make it work as long as it is still part of the code base. Reported-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1455665965-27638-1-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/qapi-schema-test.json')
-rw-r--r--tests/qapi-schema/qapi-schema-test.json9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index 4b895275c7..353a34eee4 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -73,14 +73,17 @@
'base': 'UserDefZero',
'data': { 'string': 'str', 'enum1': 'EnumOne' } }
+{ 'struct': 'UserDefUnionBase2',
+ 'base': 'UserDefZero',
+ 'data': { 'string': 'str', 'enum1': 'QEnumTwo' } }
+
# this variant of UserDefFlatUnion defaults to a union that uses fields with
# allocated types to test corner cases in the cleanup/dealloc visitor
{ 'union': 'UserDefFlatUnion2',
- 'base': 'UserDefUnionBase',
+ 'base': 'UserDefUnionBase2',
'discriminator': 'enum1',
'data': { 'value1' : 'UserDefC', # intentional forward reference
- 'value2' : 'UserDefB',
- 'value3' : 'UserDefA' } }
+ 'value2' : 'UserDefB' } }
{ 'alternate': 'UserDefAlternate',
'data': { 'uda': 'UserDefA', 's': 'str', 'i': 'int' } }