qapi: Add some type check tests
commit0d8b9fb5f296a96723d98a45a6a00bfd4e45e1b9
authorEric Blake <eblake@redhat.com>
Mon, 4 May 2015 15:05:20 +0000 (4 09:05 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2015 16:39:01 +0000 (5 18:39 +0200)
tree23069277c1b7f5b14582eda0417632d8b15b21d8
parentd708cdbe8792a55f53e90c1c787e871d527e8d4b
qapi: Add some type check tests

Demonstrate that the qapi generator silently parses confusing
types, which may cause other errors later on. Later patches
will update the expected results as the generator is made stricter.

Most of the new tests focus on blatant errors.  But
returns-whitelist is a case where we have historically allowed
returning something other than a JSON object from particular
commands; we have to keep that behavior to avoid breaking clients,
but it would be nicer to avoid adding such commands in the future,
because any return that is not an (array of) object cannot be
easily extended if future qemu wants to return additional
information.  The QMP protocol already documents that clients
should ignore unknown dictionary keys, but does not require
clients to have to handle more than one type of JSON object.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
61 files changed:
tests/Makefile
tests/qapi-schema/bad-data.err [new file with mode: 0644]
tests/qapi-schema/bad-data.exit [new file with mode: 0644]
tests/qapi-schema/bad-data.json [new file with mode: 0644]
tests/qapi-schema/bad-data.out [new file with mode: 0644]
tests/qapi-schema/data-array-empty.err [new file with mode: 0644]
tests/qapi-schema/data-array-empty.exit [new file with mode: 0644]
tests/qapi-schema/data-array-empty.json [new file with mode: 0644]
tests/qapi-schema/data-array-empty.out [new file with mode: 0644]
tests/qapi-schema/data-array-unknown.err [new file with mode: 0644]
tests/qapi-schema/data-array-unknown.exit [new file with mode: 0644]
tests/qapi-schema/data-array-unknown.json [new file with mode: 0644]
tests/qapi-schema/data-array-unknown.out [new file with mode: 0644]
tests/qapi-schema/data-int.err [new file with mode: 0644]
tests/qapi-schema/data-int.exit [new file with mode: 0644]
tests/qapi-schema/data-int.json [new file with mode: 0644]
tests/qapi-schema/data-int.out [new file with mode: 0644]
tests/qapi-schema/data-member-array-bad.err [new file with mode: 0644]
tests/qapi-schema/data-member-array-bad.exit [new file with mode: 0644]
tests/qapi-schema/data-member-array-bad.json [new file with mode: 0644]
tests/qapi-schema/data-member-array-bad.out [new file with mode: 0644]
tests/qapi-schema/data-member-array.err [new file with mode: 0644]
tests/qapi-schema/data-member-array.exit [new file with mode: 0644]
tests/qapi-schema/data-member-array.json [new file with mode: 0644]
tests/qapi-schema/data-member-array.out [new file with mode: 0644]
tests/qapi-schema/data-member-unknown.err [new file with mode: 0644]
tests/qapi-schema/data-member-unknown.exit [new file with mode: 0644]
tests/qapi-schema/data-member-unknown.json [new file with mode: 0644]
tests/qapi-schema/data-member-unknown.out [new file with mode: 0644]
tests/qapi-schema/data-unknown.err [new file with mode: 0644]
tests/qapi-schema/data-unknown.exit [new file with mode: 0644]
tests/qapi-schema/data-unknown.json [new file with mode: 0644]
tests/qapi-schema/data-unknown.out [new file with mode: 0644]
tests/qapi-schema/nested-struct-data.err [new file with mode: 0644]
tests/qapi-schema/nested-struct-data.exit [new file with mode: 0644]
tests/qapi-schema/nested-struct-data.json [new file with mode: 0644]
tests/qapi-schema/nested-struct-data.out [new file with mode: 0644]
tests/qapi-schema/nested-struct-returns.err [new file with mode: 0644]
tests/qapi-schema/nested-struct-returns.exit [new file with mode: 0644]
tests/qapi-schema/nested-struct-returns.json [new file with mode: 0644]
tests/qapi-schema/nested-struct-returns.out [new file with mode: 0644]
tests/qapi-schema/returns-alternate.err [new file with mode: 0644]
tests/qapi-schema/returns-alternate.exit [new file with mode: 0644]
tests/qapi-schema/returns-alternate.json [new file with mode: 0644]
tests/qapi-schema/returns-alternate.out [new file with mode: 0644]
tests/qapi-schema/returns-array-bad.err [new file with mode: 0644]
tests/qapi-schema/returns-array-bad.exit [new file with mode: 0644]
tests/qapi-schema/returns-array-bad.json [new file with mode: 0644]
tests/qapi-schema/returns-array-bad.out [new file with mode: 0644]
tests/qapi-schema/returns-int.err [new file with mode: 0644]
tests/qapi-schema/returns-int.exit [new file with mode: 0644]
tests/qapi-schema/returns-int.json [new file with mode: 0644]
tests/qapi-schema/returns-int.out [new file with mode: 0644]
tests/qapi-schema/returns-unknown.err [new file with mode: 0644]
tests/qapi-schema/returns-unknown.exit [new file with mode: 0644]
tests/qapi-schema/returns-unknown.json [new file with mode: 0644]
tests/qapi-schema/returns-unknown.out [new file with mode: 0644]
tests/qapi-schema/returns-whitelist.err [new file with mode: 0644]
tests/qapi-schema/returns-whitelist.exit [new file with mode: 0644]
tests/qapi-schema/returns-whitelist.json [new file with mode: 0644]
tests/qapi-schema/returns-whitelist.out [new file with mode: 0644]