This website requires JavaScript.
Explore
Help
Sign In
openkylin
/
qemu
mirror of
https://gitee.com/openkylin/qemu.git
Watch
9
Star
0
Fork
You've already forked qemu
0
Code
Issues
Projects
Releases
Wiki
Activity
5463df160e
qemu
/
tests
/
qapi-schema
/
redefined-event.json
4 lines
131 B
JSON
Raw
Normal View
History
Unescape
Escape
qapi: Better error messages for duplicated expressions The previous commit demonstrated that the generator overlooked duplicate expressions: - a complex type or command reusing a built-in type name - redeclaration of a type name, whether by the same or different metatype - redeclaration of a command or event - collision of a type with implicit 'Kind' enum for a union - collision with an implicit MAX enum constant Since the c_type() function in the generator treats all names as being in the same namespace, this patch adds a global array to track all known names and their source, to prevent collisions before it can cause further problems. While valid .json files won't trigger any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-05-04 23:05:17 +08:00
#
w
e
r
e
j
e
c
t
d
u
p
l
i
c
a
t
e
e
v
e
n
t
s
qapi: Add tests of redefined expressions 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>
2015-05-04 23:05:16 +08:00
{
'
e
v
e
n
t
'
:
'
E
V
E
N
T
_
A
'
,
'
d
a
t
a
'
:
{
'
m
y
i
n
t
'
:
'
i
n
t
'
}
}
{
'
e
v
e
n
t
'
:
'
E
V
E
N
T
_
A
'
,
'
d
a
t
a
'
:
{
'
m
y
i
n
t
'
:
'
i
n
t
'
}
}