From nobody Mon Feb 9 20:12:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505129484637612.7466838574264; Mon, 11 Sep 2017 04:31:24 -0700 (PDT) Received: from localhost ([::1]:56852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drMvz-0001jm-Ku for importer@patchew.org; Mon, 11 Sep 2017 07:31:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drMYs-0005kK-0z for qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:07:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drMYq-0006dQ-TA for qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:07:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35890) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1drMYq-0006co-KL for qemu-devel@nongnu.org; Mon, 11 Sep 2017 07:07:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA2B2CBB9F; Mon, 11 Sep 2017 11:07:27 +0000 (UTC) Received: from localhost (ovpn-112-47.ams2.redhat.com [10.36.112.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 713E45DD60; Mon, 11 Sep 2017 11:07:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BA2B2CBB9F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 11 Sep 2017 13:05:57 +0200 Message-Id: <20170911110623.24981-25-marcandre.lureau@redhat.com> In-Reply-To: <20170911110623.24981-1-marcandre.lureau@redhat.com> References: <20170911110623.24981-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 11 Sep 2017 11:07:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 24/50] qapi: add some struct member tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com, Michael Roth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/Makefile.include | 2 ++ tests/qapi-schema/struct-if-invalid.err | 1 + tests/qapi-schema/struct-if-invalid.exit | 1 + tests/qapi-schema/struct-if-invalid.json | 3 +++ tests/qapi-schema/struct-if-invalid.out | 0 tests/qapi-schema/struct-member-type.err | 0 tests/qapi-schema/struct-member-type.exit | 1 + tests/qapi-schema/struct-member-type.json | 2 ++ tests/qapi-schema/struct-member-type.out | 12 ++++++++++++ 9 files changed, 22 insertions(+) create mode 100644 tests/qapi-schema/struct-if-invalid.err create mode 100644 tests/qapi-schema/struct-if-invalid.exit create mode 100644 tests/qapi-schema/struct-if-invalid.json create mode 100644 tests/qapi-schema/struct-if-invalid.out create mode 100644 tests/qapi-schema/struct-member-type.err create mode 100644 tests/qapi-schema/struct-member-type.exit create mode 100644 tests/qapi-schema/struct-member-type.json create mode 100644 tests/qapi-schema/struct-member-type.out diff --git a/tests/Makefile.include b/tests/Makefile.include index 0aa532f029..44a3d8895e 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -520,7 +520,9 @@ qapi-schema +=3D returns-whitelist.json qapi-schema +=3D struct-base-clash-deep.json qapi-schema +=3D struct-base-clash.json qapi-schema +=3D struct-data-invalid.json +qapi-schema +=3D struct-if-invalid.json qapi-schema +=3D struct-member-invalid.json +qapi-schema +=3D struct-member-type.json qapi-schema +=3D trailing-comma-list.json qapi-schema +=3D trailing-comma-object.json qapi-schema +=3D type-bypass-bad-gen.json diff --git a/tests/qapi-schema/struct-if-invalid.err b/tests/qapi-schema/st= ruct-if-invalid.err new file mode 100644 index 0000000000..42245262a9 --- /dev/null +++ b/tests/qapi-schema/struct-if-invalid.err @@ -0,0 +1 @@ +tests/qapi-schema/struct-if-invalid.json:2: Member 'bar' of 'data' for str= uct 'TestIfStruct' should be a type name diff --git a/tests/qapi-schema/struct-if-invalid.exit b/tests/qapi-schema/s= truct-if-invalid.exit new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/tests/qapi-schema/struct-if-invalid.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/struct-if-invalid.json b/tests/qapi-schema/s= truct-if-invalid.json new file mode 100644 index 0000000000..466cdb61e1 --- /dev/null +++ b/tests/qapi-schema/struct-if-invalid.json @@ -0,0 +1,3 @@ +# check missing 'type' +{ 'struct': 'TestIfStruct', 'data': + { 'foo': 'int', 'bar': { 'if': 'defined(TEST_IF_STRUCT_BAR)' } } } diff --git a/tests/qapi-schema/struct-if-invalid.out b/tests/qapi-schema/st= ruct-if-invalid.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qapi-schema/struct-member-type.err b/tests/qapi-schema/s= truct-member-type.err new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qapi-schema/struct-member-type.exit b/tests/qapi-schema/= struct-member-type.exit new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/tests/qapi-schema/struct-member-type.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/struct-member-type.json b/tests/qapi-schema/= struct-member-type.json new file mode 100644 index 0000000000..8b33027817 --- /dev/null +++ b/tests/qapi-schema/struct-member-type.json @@ -0,0 +1,2 @@ +# check member 'a' with 'type' key only +{ 'struct': 'foo', 'data': { 'a': { 'type': 'str' } } } diff --git a/tests/qapi-schema/struct-member-type.out b/tests/qapi-schema/s= truct-member-type.out new file mode 100644 index 0000000000..04b969d2e3 --- /dev/null +++ b/tests/qapi-schema/struct-member-type.out @@ -0,0 +1,12 @@ +enum QType + prefix QTYPE + member none: + member qnull: + member qnum: + member qstring: + member qdict: + member qlist: + member qbool: +object foo + member a: str optional=3DFalse +object q_empty --=20 2.14.1.146.gd35faa819