From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrSup-0007h6-5X for qemu-devel@nongnu.org; Fri, 13 Dec 2013 08:36:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrSuj-00068k-6O for qemu-devel@nongnu.org; Fri, 13 Dec 2013 08:36:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrSui-00068e-TG for qemu-devel@nongnu.org; Fri, 13 Dec 2013 08:36:21 -0500 Message-ID: <52AB0D51.5060208@redhat.com> Date: Fri, 13 Dec 2013 06:36:17 -0700 From: Eric Blake MIME-Version: 1.0 References: <1384307094-5836-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1384307094-5836-5-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1384307094-5836-5-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GgUpMxDWOhE7bTN2mSIlFrOb2s4vBjn4G" Subject: Re: [Qemu-devel] [PATCH RFC 3/3] tests: add test cases for qapi event support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GgUpMxDWOhE7bTN2mSIlFrOb2s4vBjn4G Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/12/2013 06:44 PM, Wenchao Xia wrote: > Signed-off-by: Wenchao Xia > --- > +++ 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': 'EnumO= ne' } } > + > +{ '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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --GgUpMxDWOhE7bTN2mSIlFrOb2s4vBjn4G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSqw1RAAoJEKeha0olJ0NqEx0IAI9rOBs6/yxOp0NJ0Qjhhjmj HXDutUNcY6Z7jVotLcnkBJHNHG20uZdDiDp0xyiAC/nSOHirG5qE3f3A7uRGc+UR g1gskRWZuB6mRxY9wIVEHMoFGVZauATT9Sk1ieh4nVioiZh3LdG6T4Vo8kaykwQx 0RBOjms5Yalx3L6ZjQTr1xS1FywkWp3zNNbfKU6GKRwSrrCgjTWjG9/pwFA5ilKA +474MUnjZMVq6hmjlqxc+M1NuRbp9BCtnMbl3SM7sb3QXjqurHWBtI2dRmeVb0rU CJqj28q029tcsjwCHG1E60lFrCHLRU914MSVTXU7JhdzaZisX3/5e0HoL+nfh7g= =HS4W -----END PGP SIGNATURE----- --GgUpMxDWOhE7bTN2mSIlFrOb2s4vBjn4G--