Browse Source
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: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>pull/23/head
committed by
Markus Armbruster
25 changed files with 45 additions and 0 deletions
@ -0,0 +1 @@ |
|||
0 |
|||
@ -0,0 +1,3 @@ |
|||
# FIXME: we should reject collisions between commands and types |
|||
{ 'command': 'int', 'data': { 'character': 'str' }, |
|||
'returns': { 'value': 'int' } } |
|||
@ -0,0 +1,3 @@ |
|||
[OrderedDict([('command', 'int'), ('data', OrderedDict([('character', 'str')])), ('returns', OrderedDict([('value', 'int')]))])] |
|||
[] |
|||
[] |
|||
@ -0,0 +1 @@ |
|||
0 |
|||
@ -0,0 +1,2 @@ |
|||
# FIXME: an event named 'MAX' would conflict with implicit C enum |
|||
{ 'event': 'MAX' } |
|||
@ -0,0 +1,3 @@ |
|||
[OrderedDict([('event', 'MAX')])] |
|||
[] |
|||
[] |
|||
@ -0,0 +1 @@ |
|||
0 |
|||
@ -0,0 +1,2 @@ |
|||
# FIXME: we should reject types that duplicate builtin names |
|||
{ 'type': 'size', 'data': { 'myint': 'size' } } |
|||
@ -0,0 +1,3 @@ |
|||
[OrderedDict([('type', 'size'), ('data', OrderedDict([('myint', 'size')]))])] |
|||
[] |
|||
[OrderedDict([('type', 'size'), ('data', OrderedDict([('myint', 'size')]))])] |
|||
@ -0,0 +1 @@ |
|||
0 |
|||
@ -0,0 +1,3 @@ |
|||
# FIXME: we should reject commands defined more than once |
|||
{ 'command': 'foo', 'data': { 'one': 'str' } } |
|||
{ 'command': 'foo', 'data': { '*two': 'str' } } |
|||
@ -0,0 +1,4 @@ |
|||
[OrderedDict([('command', 'foo'), ('data', OrderedDict([('one', 'str')]))]), |
|||
OrderedDict([('command', 'foo'), ('data', OrderedDict([('*two', 'str')]))])] |
|||
[] |
|||
[] |
|||
@ -0,0 +1 @@ |
|||
0 |
|||
@ -0,0 +1,3 @@ |
|||
# FIXME: we should reject duplicate events |
|||
{ 'event': 'EVENT_A', 'data': { 'myint': 'int' } } |
|||
{ 'event': 'EVENT_A', 'data': { 'myint': 'int' } } |
|||
@ -0,0 +1,4 @@ |
|||
[OrderedDict([('event', 'EVENT_A'), ('data', OrderedDict([('myint', 'int')]))]), |
|||
OrderedDict([('event', 'EVENT_A'), ('data', OrderedDict([('myint', 'int')]))])] |
|||
[] |
|||
[] |
|||
@ -0,0 +1 @@ |
|||
0 |
|||
@ -0,0 +1,3 @@ |
|||
# FIXME: we should reject types defined more than once |
|||
{ 'type': 'foo', 'data': { 'one': 'str' } } |
|||
{ 'enum': 'foo', 'data': [ 'two' ] } |
|||
@ -0,0 +1,4 @@ |
|||
[OrderedDict([('type', 'foo'), ('data', OrderedDict([('one', 'str')]))]), |
|||
OrderedDict([('enum', 'foo'), ('data', ['two'])])] |
|||
[{'enum_name': 'foo', 'enum_values': ['two']}] |
|||
[OrderedDict([('type', 'foo'), ('data', OrderedDict([('one', 'str')]))])] |
|||
Loading…
Reference in new issue