qapi: Move empty-enum to compile-time test
Rather than just asserting that we can parse an empty enum, let's also make sure we can compile it, by including it in qapi-schema-test. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1444710158-8723-5-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
baabb84c5b
commit
625b251c69
@ -260,7 +260,6 @@ qapi-schema += enum-bad-name.json
|
||||
qapi-schema += enum-bad-prefix.json
|
||||
qapi-schema += enum-clash-member.json
|
||||
qapi-schema += enum-dict-member.json
|
||||
qapi-schema += enum-empty.json
|
||||
qapi-schema += enum-int-member.json
|
||||
qapi-schema += enum-max-member.json
|
||||
qapi-schema += enum-missing-data.json
|
||||
|
@ -1 +0,0 @@
|
||||
0
|
@ -1,2 +0,0 @@
|
||||
# An empty enum, although unusual, is currently acceptable
|
||||
{ 'enum': 'MyEnum', 'data': [ ] }
|
@ -1,2 +0,0 @@
|
||||
object :empty
|
||||
enum MyEnum []
|
@ -1,11 +1,17 @@
|
||||
# *-*- Mode: Python -*-*
|
||||
|
||||
# This file is a stress test of supported qapi constructs that must
|
||||
# parse and compile correctly.
|
||||
|
||||
# for testing enums
|
||||
{ 'enum': 'EnumOne',
|
||||
'data': [ 'value1', 'value2', 'value3' ] }
|
||||
{ 'struct': 'NestedEnumsOne',
|
||||
'data': { 'enum1': 'EnumOne', '*enum2': 'EnumOne', 'enum3': 'EnumOne', '*enum4': 'EnumOne' } }
|
||||
|
||||
# An empty enum, although unusual, is currently acceptable
|
||||
{ 'enum': 'MyEnum', 'data': [ ] }
|
||||
|
||||
# for testing override of default naming heuristic
|
||||
{ 'enum': 'QEnumTwo',
|
||||
'prefix': 'QENUM_TWO',
|
||||
|
@ -86,6 +86,7 @@ object EventStructOne
|
||||
member struct1: UserDefOne optional=False
|
||||
member string: str optional=False
|
||||
member enum2: EnumOne optional=True
|
||||
enum MyEnum []
|
||||
object NestedEnumsOne
|
||||
member enum1: EnumOne optional=False
|
||||
member enum2: EnumOne optional=True
|
||||
|
Loading…
Reference in New Issue
Block a user