mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Remove outdated tests related to QMP/branch collisions
Now that branches are in a separate C namespace, we can remove
the restrictions in the parser that claim a branch name would
collide with QMP, and delete the negative tests that are no
longer problematic. A separate patch can then add positive
tests to qapi-schema-test to test that any corner cases will
compile correctly.
This reverts the scripts/qapi.py portion of commit 7b2a5c2
,
now that the assertions that it plugged are no longer possible.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1447836791-369-15-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
10565ca92a
commit
61a946611b
14 changed files with 2 additions and 72 deletions
|
@ -548,8 +548,7 @@ def check_union(expr, expr_info):
|
|||
base = expr.get('base')
|
||||
discriminator = expr.get('discriminator')
|
||||
members = expr['data']
|
||||
values = {'MAX': '(automatic)', 'KIND': '(automatic)',
|
||||
'TYPE': '(automatic)'}
|
||||
values = {'MAX': '(automatic)'}
|
||||
|
||||
# Two types of unions, determined by discriminator.
|
||||
|
||||
|
@ -607,19 +606,13 @@ def check_union(expr, expr_info):
|
|||
" of branch '%s'" % key)
|
||||
|
||||
# If the discriminator names an enum type, then all members
|
||||
# of 'data' must also be members of the enum type, which in turn
|
||||
# must not collide with the discriminator name.
|
||||
# of 'data' must also be members of the enum type.
|
||||
if enum_define:
|
||||
if key not in enum_define['enum_values']:
|
||||
raise QAPIExprError(expr_info,
|
||||
"Discriminator value '%s' is not found in "
|
||||
"enum '%s'" %
|
||||
(key, enum_define["enum_name"]))
|
||||
if discriminator in enum_define['enum_values']:
|
||||
raise QAPIExprError(expr_info,
|
||||
"Discriminator name '%s' collides with "
|
||||
"enum value in '%s'" %
|
||||
(discriminator, enum_define["enum_name"]))
|
||||
|
||||
# Otherwise, check for conflicts in the generated enum
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue