tests/qapi-schema: Switch member name clash test to struct
Test args-name-clash covers command parameter name clash. This effectively covers struct member name clash as well. The next commit will make parameter name clash impossible. Convert args-name-clash from testing command to testing a struct, and rename it to struct-member-name-clash. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-26-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message typo fixed]
This commit is contained in:
parent
05ebf841ef
commit
e75d4225b7
@ -1,2 +0,0 @@
|
||||
args-name-clash.json: In command 'oops':
|
||||
args-name-clash.json:4: parameter 'a_b' collides with parameter 'a-b'
|
@ -30,7 +30,6 @@ schemas = [
|
||||
'args-member-array-bad.json',
|
||||
'args-member-case.json',
|
||||
'args-member-unknown.json',
|
||||
'args-name-clash.json',
|
||||
'args-union.json',
|
||||
'args-unknown.json',
|
||||
'bad-base.json',
|
||||
@ -177,6 +176,7 @@ schemas = [
|
||||
'struct-member-if-invalid.json',
|
||||
'struct-member-invalid-dict.json',
|
||||
'struct-member-invalid.json',
|
||||
'struct-member-name-clash.json',
|
||||
'trailing-comma-list.json',
|
||||
'trailing-comma-object.json',
|
||||
'type-bypass-bad-gen.json',
|
||||
|
2
tests/qapi-schema/struct-member-name-clash.err
Normal file
2
tests/qapi-schema/struct-member-name-clash.err
Normal file
@ -0,0 +1,2 @@
|
||||
struct-member-name-clash.json: In struct 'Oops':
|
||||
struct-member-name-clash.json:4: member 'a_b' collides with member 'a-b'
|
@ -1,4 +1,4 @@
|
||||
# C member name collision
|
||||
# Reject members that clash when mapped to C names (we would have two 'a_b'
|
||||
# members).
|
||||
{ 'command': 'oops', 'data': { 'a-b': 'str', 'a_b': 'str' } }
|
||||
{ 'struct': 'Oops', 'data': { 'a-b': 'str', 'a_b': 'str' } }
|
Loading…
Reference in New Issue
Block a user