qapi: Add tests of complex objects within alternate
commit68d078395d8233ca8455a95f05e5c23e367777c2
authorEric Blake <eblake@redhat.com>
Thu, 18 Feb 2016 06:48:18 +0000 (17 23:48 -0700)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 19 Feb 2016 10:08:57 +0000 (19 11:08 +0100)
treef1e769c6df0b7d5e1d93828a634ae31db5276c2e
parent46534309e667fd860720f983c2c9aefe0354340d
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>
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/test-qmp-input-visitor.c
tests/test-qmp-output-visitor.c