mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
qapi-schema: test: add a unit test for parsing array alternates
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220321164243.200569-4-pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Dead code dropped in test_visitor_in_alternate_list()] Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
committed by
Markus Armbruster
parent
b36dc5c279
commit
79db994861
@@ -119,6 +119,7 @@
|
||||
{ 'alternate': 'AltEnumNum', 'data': { 'e': 'EnumOne', 'n': 'number' } }
|
||||
{ 'alternate': 'AltNumEnum', 'data': { 'n': 'number', 'e': 'EnumOne' } }
|
||||
{ 'alternate': 'AltEnumInt', 'data': { 'e': 'EnumOne', 'i': 'int' } }
|
||||
{ 'alternate': 'AltListInt', 'data': { 'l': ['int'], 'i': 'int' } }
|
||||
|
||||
# for testing use of 'str' within alternates
|
||||
{ 'alternate': 'AltStrObj', 'data': { 's': 'str', 'o': 'TestStruct' } }
|
||||
|
||||
@@ -121,6 +121,10 @@ alternate AltEnumInt
|
||||
tag type
|
||||
case e: EnumOne
|
||||
case i: int
|
||||
alternate AltListInt
|
||||
tag type
|
||||
case l: intList
|
||||
case i: int
|
||||
alternate AltStrObj
|
||||
tag type
|
||||
case s: str
|
||||
|
||||
Reference in New Issue
Block a user