From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsOcA-0007zV-QT for qemu-devel@nongnu.org; Sun, 15 Dec 2013 22:13:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsOc0-0003Va-V0 for qemu-devel@nongnu.org; Sun, 15 Dec 2013 22:13:02 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:49931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsOc0-0003Uy-AB for qemu-devel@nongnu.org; Sun, 15 Dec 2013 22:12:52 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Dec 2013 08:42:49 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id CB3F6E0056 for ; Mon, 16 Dec 2013 08:45:11 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBG3Cj8Z5439964 for ; Mon, 16 Dec 2013 08:42:45 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBG3Cl1u022318 for ; Mon, 16 Dec 2013 08:42:47 +0530 Message-ID: <52AE6FB2.4070002@linux.vnet.ibm.com> Date: Mon, 16 Dec 2013 11:12:50 +0800 From: Wenchao Xia 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> <52AB0D51.5060208@redhat.com> <52AE6BA0.4000207@linux.vnet.ibm.com> In-Reply-To: <52AE6BA0.4000207@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: Eric Blake , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com 于 2013/12/16 10:55, Wenchao Xia 写道: > 于 2013/12/13 21:36, Eric Blake 写道: >> 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': >>> '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?) >> > > I guess EVENT_SHUDDOWN is one example, that have no associated info, > except time stamp. > I think you questioned why EVENT_B is needed? I added it before to allow that, both define can work. > >>> +{ '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':{}? >> > > I didn't touch the "{ }" parsing part, maybe an existing parsing > style, will check it. > >>> +++ 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. >> > yep, will fix. > >