Received: from eggs.gnu.org ([2001:4830:134:3::10]:58752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnQEi-0002NH-5f for qemu-devel@nongnu.org; Wed, 29 Apr 2015 07:33:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnQEc-0006XA-3H for qemu-devel@nongnu.org; Wed, 29 Apr 2015 07:33:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnQEb-0006X6-RA for qemu-devel@nongnu.org; Wed, 29 Apr 2015 07:32:58 -0400 From: Markus Armbruster References: <1428775783-18082-1-git-send-email-eblake@redhat.com> <1428775783-18082-5-git-send-email-eblake@redhat.com> Date: Wed, 29 Apr 2015 13:32:13 +0200 In-Reply-To: <1428775783-18082-5-git-send-email-eblake@redhat.com> (Eric Blake's message of "Sat, 11 Apr 2015 12:09:43 -0600") Message-ID: <87twvz6ugy.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 4/4] qapi: Test name mangling of downstream extensions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > So that we don't regress in supporting downstream extensions, make > sure that our testsuite covers downstream naming choices in as many > places as possible. > > Signed-off-by: Eric Blake > --- > tests/qapi-schema/qapi-schema-test.json | 19 +++++++++++++++++++ > tests/qapi-schema/qapi-schema-test.out | 21 ++++++++++++++++++--- > tests/test-qmp-commands.c | 8 ++++++++ > 3 files changed, 45 insertions(+), 3 deletions(-) > > diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json > index 8193dc1..a833b63 100644 > --- a/tests/qapi-schema/qapi-schema-test.json > +++ b/tests/qapi-schema/qapi-schema-test.json > @@ -107,3 +107,22 @@ > 'data': { '*a': 'int', '*b': 'UserDefOne', 'c': 'str' } } > { 'event': 'EVENT_D', > 'data': { 'a' : 'EventStructOne', 'b' : 'str', '*c': 'str', '*enum3': 'EnumOne' } } > + > +# test that we correctly compile downstream extensions > +{ 'enum': '__org.qemu_x-Enum', 'data': [ '__org.qemu_x-value' ] } > +{ 'struct': '__org.qemu_x-Base', > + 'data': { '__org.qemu_x-member1': '__org.qemu_x-Enum' } } > +{ 'struct': '__org.qemu_x-Struct', 'base': '__org.qemu_x-Base', > + 'data': { '__org.qemu_x-member2': 'str' } } > +{ 'struct': '__org.qemu_x-Struct2', > + 'data': { 'array': ['__org.qemu_x-Union1'] } } > +{ 'union': '__org.qemu_x-Union1', 'data': { '__org.qemu_x-branch': 'str' } } > +{ 'union': '__org.qemu_x-Union2', 'base': '__org.qemu_x-Base', > + 'discriminator': '__org.qemu_x-member1', > + 'data': { '__org.qemu_x-value': '__org.qemu_x-Struct2' } } > +{ 'alternate': '__org.qemu_x-Alt', > + 'data': { '__org.qemu_x-branch': 'str', 'b': '__org.qemu_x-Base' } } > +{ 'event': '__ORG.QEMU_X-EVENT', 'data': '__org.qemu_x-Struct' } > +{ 'command': '__org.qemu_x-command', > + 'data': { 'a': ['__org.qemu_x-Enum'], 'b': ['__org.qemu_x-Struct'], > + 'c': '__org.qemu_x-Union2', 'd': '__org.qemu_x-Alt' } } Can't say offhand whether 'returns' takes a separate path. If it does, we better test it here. Since it can be fixed on top if it's necessary, Reviewed-by: Markus Armbruster