From patchwork Thu Oct 15 07:51:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 530544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B3EB31402B6 for ; Thu, 15 Oct 2015 18:55:44 +1100 (AEDT) Received: from localhost ([::1]:46315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdO2-0006Wg-Ry for incoming@patchwork.ozlabs.org; Thu, 15 Oct 2015 03:55:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdKN-00021x-77 for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:51:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmdKL-0002R3-MG for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:51:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdKL-0002Qj-FK for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:51:53 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 0A5BC157743 for ; Thu, 15 Oct 2015 07:51:53 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9F7poxr002126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 15 Oct 2015 03:51:51 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CE19A300111E; Thu, 15 Oct 2015 09:51:45 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 15 Oct 2015 09:51:38 +0200 Message-Id: <1444895505-16067-6-git-send-email-armbru@redhat.com> In-Reply-To: <1444895505-16067-1-git-send-email-armbru@redhat.com> References: <1444895505-16067-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/12] qapi: Move empty-enum to compile-time test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Eric Blake Rather than just asserting that we can parse an empty enum, let's also make sure we can compile it, by including it in qapi-schema-test. Signed-off-by: Eric Blake Message-Id: <1444710158-8723-5-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster --- tests/Makefile | 1 - tests/qapi-schema/enum-empty.err | 0 tests/qapi-schema/enum-empty.exit | 1 - tests/qapi-schema/enum-empty.json | 2 -- tests/qapi-schema/enum-empty.out | 2 -- tests/qapi-schema/qapi-schema-test.json | 6 ++++++ tests/qapi-schema/qapi-schema-test.out | 1 + 7 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 tests/qapi-schema/enum-empty.err delete mode 100644 tests/qapi-schema/enum-empty.exit delete mode 100644 tests/qapi-schema/enum-empty.json delete mode 100644 tests/qapi-schema/enum-empty.out diff --git a/tests/Makefile b/tests/Makefile index 9a6601d..e058312 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -260,7 +260,6 @@ qapi-schema += enum-bad-name.json qapi-schema += enum-bad-prefix.json qapi-schema += enum-clash-member.json qapi-schema += enum-dict-member.json -qapi-schema += enum-empty.json qapi-schema += enum-int-member.json qapi-schema += enum-max-member.json qapi-schema += enum-missing-data.json diff --git a/tests/qapi-schema/enum-empty.err b/tests/qapi-schema/enum-empty.err deleted file mode 100644 index e69de29..0000000 diff --git a/tests/qapi-schema/enum-empty.exit b/tests/qapi-schema/enum-empty.exit deleted file mode 100644 index 573541a..0000000 --- a/tests/qapi-schema/enum-empty.exit +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/qapi-schema/enum-empty.json b/tests/qapi-schema/enum-empty.json deleted file mode 100644 index 40d4e85..0000000 --- a/tests/qapi-schema/enum-empty.json +++ /dev/null @@ -1,2 +0,0 @@ -# An empty enum, although unusual, is currently acceptable -{ 'enum': 'MyEnum', 'data': [ ] } diff --git a/tests/qapi-schema/enum-empty.out b/tests/qapi-schema/enum-empty.out deleted file mode 100644 index a449d45..0000000 --- a/tests/qapi-schema/enum-empty.out +++ /dev/null @@ -1,2 +0,0 @@ -object :empty -enum MyEnum [] diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json index abe59fd..c8cd2dd 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -1,11 +1,17 @@ # *-*- Mode: Python -*-* +# This file is a stress test of supported qapi constructs that must +# parse and compile correctly. + # for testing enums { 'enum': 'EnumOne', 'data': [ 'value1', 'value2', 'value3' ] } { 'struct': 'NestedEnumsOne', 'data': { 'enum1': 'EnumOne', '*enum2': 'EnumOne', 'enum3': 'EnumOne', '*enum4': 'EnumOne' } } +# An empty enum, although unusual, is currently acceptable +{ 'enum': 'MyEnum', 'data': [ ] } + # for testing override of default naming heuristic { 'enum': 'QEnumTwo', 'prefix': 'QENUM_TWO', diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out index 8f81784..e3504ab 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -86,6 +86,7 @@ object EventStructOne member struct1: UserDefOne optional=False member string: str optional=False member enum2: EnumOne optional=True +enum MyEnum [] object NestedEnumsOne member enum1: EnumOne optional=False member enum2: EnumOne optional=True