From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWRQt-0002Sy-TT for qemu-devel@nongnu.org; Mon, 31 Aug 2015 11:55:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWRQo-0006DQ-Od for qemu-devel@nongnu.org; Mon, 31 Aug 2015 11:55:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWRQo-0006Cc-8L for qemu-devel@nongnu.org; Mon, 31 Aug 2015 11:55:38 -0400 From: Markus Armbruster Date: Mon, 31 Aug 2015 17:55:31 +0200 Message-Id: <1441036533-26113-3-git-send-email-armbru@redhat.com> In-Reply-To: <1441036533-26113-1-git-send-email-armbru@redhat.com> References: <1441036533-26113-1-git-send-email-armbru@redhat.com> In-Reply-To: <1440780366-7177-1-git-send-email-armbru@redhat.com> References: <1440780366-7177-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 29/31] tests/qapi-schema: Cover non-string, non-dictionary members List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com We always report "should be a dictionary" then. This is misleading: when allow_dict, it can be a dictionary or a type name string, else it can only be a type name. Signed-off-by: Markus Armbruster --- tests/Makefile | 2 ++ tests/qapi-schema/args-invalid.err | 1 + tests/qapi-schema/args-invalid.exit | 1 + tests/qapi-schema/args-invalid.json | 3 +++ tests/qapi-schema/args-invalid.out | 0 tests/qapi-schema/struct-data-invalid.err | 1 + tests/qapi-schema/struct-data-invalid.exit | 1 + tests/qapi-schema/struct-data-invalid.json | 3 +++ tests/qapi-schema/struct-data-invalid.out | 0 tests/qapi-schema/struct-member-invalid.err | 1 + tests/qapi-schema/struct-member-invalid.exit | 1 + tests/qapi-schema/struct-member-invalid.json | 3 +++ tests/qapi-schema/struct-member-invalid.out | 0 13 files changed, 17 insertions(+) create mode 100644 tests/qapi-schema/args-invalid.err create mode 100644 tests/qapi-schema/args-invalid.exit create mode 100644 tests/qapi-schema/args-invalid.json create mode 100644 tests/qapi-schema/args-invalid.out create mode 100644 tests/qapi-schema/struct-data-invalid.err create mode 100644 tests/qapi-schema/struct-data-invalid.exit create mode 100644 tests/qapi-schema/struct-data-invalid.json create mode 100644 tests/qapi-schema/struct-data-invalid.out create mode 100644 tests/qapi-schema/struct-member-invalid.err create mode 100644 tests/qapi-schema/struct-member-invalid.exit create mode 100644 tests/qapi-schema/struct-member-invalid.json create mode 100644 tests/qapi-schema/struct-member-invalid.out diff --git a/tests/Makefile b/tests/Makefile index 597ca90..b128e28 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -229,12 +229,14 @@ check-qapi-schema-y := $(addprefix tests/qapi-schema/, \ redefined-type.json redefined-command.json redefined-builtin.json \ redefined-event.json command-int.json bad-data.json event-max.json \ type-bypass.json type-bypass-no-gen.json type-bypass-bad-gen.json \ + args-invalid.json \ args-array-empty.json args-array-unknown.json args-int.json \ args-unknown.json args-member-unknown.json args-member-array.json \ args-member-array-bad.json args-alternate.json args-union.json \ returns-array-bad.json returns-int.json returns-dict.json \ returns-unknown.json returns-alternate.json returns-whitelist.json \ missing-colon.json missing-comma-list.json missing-comma-object.json \ + struct-data-invalid.json struct-member-invalid.json \ nested-struct-data.json non-objects.json \ qapi-schema-test.json quoted-structural-chars.json \ leading-comma-list.json leading-comma-object.json \ diff --git a/tests/qapi-schema/args-invalid.err b/tests/qapi-schema/args-invalid.err new file mode 100644 index 0000000..6d0fa05 --- /dev/null +++ b/tests/qapi-schema/args-invalid.err @@ -0,0 +1 @@ +tests/qapi-schema/args-invalid.json:2: 'data' for command 'foo' should be a dictionary diff --git a/tests/qapi-schema/args-invalid.exit b/tests/qapi-schema/args-invalid.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/qapi-schema/args-invalid.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/args-invalid.json b/tests/qapi-schema/args-invalid.json new file mode 100644 index 0000000..4a64135 --- /dev/null +++ b/tests/qapi-schema/args-invalid.json @@ -0,0 +1,3 @@ +# FIXME error "should be a dictionary" is misleading, type name is also fine +{ 'command': 'foo', + 'data': false } diff --git a/tests/qapi-schema/args-invalid.out b/tests/qapi-schema/args-invalid.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/struct-data-invalid.err b/tests/qapi-schema/struct-data-invalid.err new file mode 100644 index 0000000..a40e23a --- /dev/null +++ b/tests/qapi-schema/struct-data-invalid.err @@ -0,0 +1 @@ +tests/qapi-schema/struct-data-invalid.json:2: 'data' for struct 'foo' should be a dictionary diff --git a/tests/qapi-schema/struct-data-invalid.exit b/tests/qapi-schema/struct-data-invalid.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/qapi-schema/struct-data-invalid.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/struct-data-invalid.json b/tests/qapi-schema/struct-data-invalid.json new file mode 100644 index 0000000..b76de82 --- /dev/null +++ b/tests/qapi-schema/struct-data-invalid.json @@ -0,0 +1,3 @@ +# FIXME error "should be a dictionary" is misleading, type name is also fine +{ 'struct': 'foo', + 'data': false } diff --git a/tests/qapi-schema/struct-data-invalid.out b/tests/qapi-schema/struct-data-invalid.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/struct-member-invalid.err b/tests/qapi-schema/struct-member-invalid.err new file mode 100644 index 0000000..9e4c7b8 --- /dev/null +++ b/tests/qapi-schema/struct-member-invalid.err @@ -0,0 +1 @@ +tests/qapi-schema/struct-member-invalid.json:2: Member 'a' of 'data' for struct 'foo' should be a dictionary diff --git a/tests/qapi-schema/struct-member-invalid.exit b/tests/qapi-schema/struct-member-invalid.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/qapi-schema/struct-member-invalid.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/struct-member-invalid.json b/tests/qapi-schema/struct-member-invalid.json new file mode 100644 index 0000000..968e63c --- /dev/null +++ b/tests/qapi-schema/struct-member-invalid.json @@ -0,0 +1,3 @@ +# FIXME error message "should be a dictionary" is wrong, must be type name +{ 'struct': 'foo', + 'data': { 'a': false } } diff --git a/tests/qapi-schema/struct-member-invalid.out b/tests/qapi-schema/struct-member-invalid.out new file mode 100644 index 0000000..e69de29 -- 2.4.3