Received: from eggs.gnu.org ([2001:4830:134:3::10]:55182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk9JL-000822-BM for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:33:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dk9JJ-0006yT-0E for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:33:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58420) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dk9JI-0006xs-Qe for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:33:36 -0400 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 22 Aug 2017 15:22:17 +0200 Message-Id: <20170822132255.23945-17-marcandre.lureau@redhat.com> In-Reply-To: <20170822132255.23945-1-marcandre.lureau@redhat.com> References: <20170822132255.23945-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 16/54] qapi: add a test for invalid 'if' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Michael Roth Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/Makefile.include | 1 + tests/qapi-schema/bad-if.err | 1 + tests/qapi-schema/bad-if.exit | 1 + tests/qapi-schema/bad-if.json | 3 +++ tests/qapi-schema/bad-if.out | 0 5 files changed, 6 insertions(+) create mode 100644 tests/qapi-schema/bad-if.err create mode 100644 tests/qapi-schema/bad-if.exit create mode 100644 tests/qapi-schema/bad-if.json create mode 100644 tests/qapi-schema/bad-if.out diff --git a/tests/Makefile.include b/tests/Makefile.include index 3653c7b40a..1f1d8f075b 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -396,6 +396,7 @@ qapi-schema +=3D args-unknown.json qapi-schema +=3D bad-base.json qapi-schema +=3D bad-data.json qapi-schema +=3D bad-ident.json +qapi-schema +=3D bad-if.json qapi-schema +=3D bad-type-bool.json qapi-schema +=3D bad-type-dict.json qapi-schema +=3D bad-type-int.json diff --git a/tests/qapi-schema/bad-if.err b/tests/qapi-schema/bad-if.err new file mode 100644 index 0000000000..8054fbb143 --- /dev/null +++ b/tests/qapi-schema/bad-if.err @@ -0,0 +1 @@ +tests/qapi-schema/bad-if.json:2: 'if' condition requires a string or a l= ist of string diff --git a/tests/qapi-schema/bad-if.exit b/tests/qapi-schema/bad-if.exi= t new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/tests/qapi-schema/bad-if.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/bad-if.json b/tests/qapi-schema/bad-if.jso= n new file mode 100644 index 0000000000..3edd1a0bf2 --- /dev/null +++ b/tests/qapi-schema/bad-if.json @@ -0,0 +1,3 @@ +# check invalid 'if' type +{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' }, + 'if': { 'value': 'defined(TEST_IF_STRUCT)' } } diff --git a/tests/qapi-schema/bad-if.out b/tests/qapi-schema/bad-if.out new file mode 100644 index 0000000000..e69de29bb2 --=20 2.14.1.146.gd35faa819