summaryrefslogtreecommitdiff
path: root/tests/qapi-schema/qapi-schema-test.json
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-02-17 23:48:18 -0700
committerMarkus Armbruster <armbru@redhat.com>2016-02-19 11:08:57 +0100
commit68d078395d8233ca8455a95f05e5c23e367777c2 (patch)
treef1e769c6df0b7d5e1d93828a634ae31db5276c2e /tests/qapi-schema/qapi-schema-test.json
parent46534309e667fd860720f983c2c9aefe0354340d (diff)
downloadqemu-68d078395d8233ca8455a95f05e5c23e367777c2.tar.gz
qapi: Add tests of complex objects within alternate
Upcoming patches will adjust how we visit an object branch of an alternate; but we were completely lacking testsuite coverage. Rectify this, so that the future patches will be able to highlight the changes and still prove that we avoided regressions. In particular, the use of a flat union UserDefFlatUnion rather than a simple struct UserDefA as the branch will give us coverage of an object with variants. And visiting an alternate as both the top level and as a nested member gives confidence in correct memory allocation handling, especially if the test is run under valgrind. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1455778109-6278-5-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.json4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index 353a34eee4..632964a6ec 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -85,8 +85,10 @@
'data': { 'value1' : 'UserDefC', # intentional forward reference
'value2' : 'UserDefB' } }
+{ 'struct': 'WrapAlternate',
+ 'data': { 'alt': 'UserDefAlternate' } }
{ 'alternate': 'UserDefAlternate',
- 'data': { 'uda': 'UserDefA', 's': 'str', 'i': 'int' } }
+ 'data': { 'udfu': 'UserDefFlatUnion', 's': 'str', 'i': 'int' } }
{ 'struct': 'UserDefC',
'data': { 'string1': 'str', 'string2': 'str' } }