On 11/12/2013 06:44 PM, Wenchao Xia wrote: > Signed-off-by: Wenchao Xia <xiaw...@linux.vnet.ibm.com> > ---
> +++ b/tests/qapi-schema/qapi-schema-test.json > @@ -93,3 +93,15 @@ > '*u16' : [ 'uint16' ], > '*i64x': 'int' , > '*u64x': 'uint64' } } > + > +# testing event > +{ 'type': 'EventStructOne', > + 'data': { 'struct1': 'UserDefOne', 'string': 'str', '*enum2': 'EnumOne' } } > + > +{ 'event': 'EVENT_A' } > +{ 'event': 'EVENT_B', > + 'data': { } } Do we really have events with no associated information (the mere name of the event carrying the full data?) > +{ 'event': 'EVENT_C', > + 'data': { '*a': 'int', '*b': 'UserDefOne', 'c': 'str' } } > +{ 'event': 'EVENT_D', > + 'data': { 'a' : 'EventStructOne', 'b' : 'str', '*c': 'str', '*enum3': > 'EnumOne' } } Looks like reasonable support for encoding existing events. > + OrderedDict([('event', 'EVENT_A')]), > + OrderedDict([('event', 'EVENT_B'), ('data', OrderedDict())]), Shouldn't the omission of 'data' be the same as 'data':{}? > +++ b/tests/test-qmp-event.c > @@ -0,0 +1,250 @@ > +/* > + * QMP Input Visitor unit-tests. > + * > + * Copyright (C) 2011 Red Hat Inc. Unusual choice of copyright year and ownership. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature