Commit cfdd5bca authored by Eric Blake's avatar Eric Blake Committed by Markus Armbruster
Browse files

qapi: Add tests of redefined expressions



Demonstrate that the qapi generator doesn't deal very well with
redefined expressions.  At the parse level, they are silently
accepted; and while the testsuite just stops at parsing, I've
further tested that many of them cause generator crashes or
invalid C code if they were appended to qapi-schema-test.json.
A later patch will tighten things up and adjust the testsuite
to match.

Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
parent 0545f6b8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -214,6 +214,8 @@ check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
	missing-type.json bad-ident.json ident-with-escape.json \
	double-type.json bad-base.json bad-type-bool.json bad-type-int.json \
	bad-type-dict.json double-data.json unknown-expr-key.json \
	redefined-type.json redefined-command.json redefined-builtin.json \
	redefined-event.json command-int.json event-max.json \
	missing-colon.json missing-comma-list.json \
	missing-comma-object.json non-objects.json \
	qapi-schema-test.json quoted-structural-chars.json \
+0 −0

Empty file added.

+1 −0
Original line number Diff line number Diff line
0
+3 −0
Original line number Diff line number Diff line
# FIXME: we should reject collisions between commands and types
{ 'command': 'int', 'data': { 'character': 'str' },
  'returns': { 'value': 'int' } }
+3 −0
Original line number Diff line number Diff line
[OrderedDict([('command', 'int'), ('data', OrderedDict([('character', 'str')])), ('returns', OrderedDict([('value', 'int')]))])]
[]
[]
Loading