[{"id":1819234,"web_url":"http://patchwork.ozlabs.org/comment/1819234/","msgid":"<87609g6zh5.fsf@dusky.pond.sub.org>","list_archive_url":null,"date":"2017-12-09T09:07:50","subject":"Re: [Qemu-devel] [PATCH v3 24/50] qapi: add some struct member tests","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/","name":"Markus Armbruster","email":"armbru@redhat.com"},"content":"Marc-André Lureau <marcandre.lureau@redhat.com> writes:\n\n> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n> ---\n>  tests/Makefile.include                    |  2 ++\n>  tests/qapi-schema/struct-if-invalid.err   |  1 +\n>  tests/qapi-schema/struct-if-invalid.exit  |  1 +\n>  tests/qapi-schema/struct-if-invalid.json  |  3 +++\n>  tests/qapi-schema/struct-if-invalid.out   |  0\n>  tests/qapi-schema/struct-member-type.err  |  0\n>  tests/qapi-schema/struct-member-type.exit |  1 +\n>  tests/qapi-schema/struct-member-type.json |  2 ++\n>  tests/qapi-schema/struct-member-type.out  | 12 ++++++++++++\n>  9 files changed, 22 insertions(+)\n>  create mode 100644 tests/qapi-schema/struct-if-invalid.err\n>  create mode 100644 tests/qapi-schema/struct-if-invalid.exit\n>  create mode 100644 tests/qapi-schema/struct-if-invalid.json\n>  create mode 100644 tests/qapi-schema/struct-if-invalid.out\n>  create mode 100644 tests/qapi-schema/struct-member-type.err\n>  create mode 100644 tests/qapi-schema/struct-member-type.exit\n>  create mode 100644 tests/qapi-schema/struct-member-type.json\n>  create mode 100644 tests/qapi-schema/struct-member-type.out\n>\n> diff --git a/tests/Makefile.include b/tests/Makefile.include\n> index 0aa532f029..44a3d8895e 100644\n> --- a/tests/Makefile.include\n> +++ b/tests/Makefile.include\n> @@ -520,7 +520,9 @@ qapi-schema += returns-whitelist.json\n>  qapi-schema += struct-base-clash-deep.json\n>  qapi-schema += struct-base-clash.json\n>  qapi-schema += struct-data-invalid.json\n> +qapi-schema += struct-if-invalid.json\n>  qapi-schema += struct-member-invalid.json\n> +qapi-schema += struct-member-type.json\n>  qapi-schema += trailing-comma-list.json\n>  qapi-schema += trailing-comma-object.json\n>  qapi-schema += type-bypass-bad-gen.json\n> diff --git a/tests/qapi-schema/struct-if-invalid.err b/tests/qapi-schema/struct-if-invalid.err\n> new file mode 100644\n> index 0000000000..42245262a9\n> --- /dev/null\n> +++ b/tests/qapi-schema/struct-if-invalid.err\n> @@ -0,0 +1 @@\n> +tests/qapi-schema/struct-if-invalid.json:2: Member 'bar' of 'data' for struct 'TestIfStruct' should be a type name\n> diff --git a/tests/qapi-schema/struct-if-invalid.exit b/tests/qapi-schema/struct-if-invalid.exit\n> new file mode 100644\n> index 0000000000..d00491fd7e\n> --- /dev/null\n> +++ b/tests/qapi-schema/struct-if-invalid.exit\n> @@ -0,0 +1 @@\n> +1\n> diff --git a/tests/qapi-schema/struct-if-invalid.json b/tests/qapi-schema/struct-if-invalid.json\n> new file mode 100644\n> index 0000000000..466cdb61e1\n> --- /dev/null\n> +++ b/tests/qapi-schema/struct-if-invalid.json\n> @@ -0,0 +1,3 @@\n> +# check missing 'type'\n> +{ 'struct': 'TestIfStruct', 'data':\n> +  { 'foo': 'int', 'bar': { 'if': 'defined(TEST_IF_STRUCT_BAR)' } } }\n\nHmm.  This tests the previous patch's change to check_type().  It\ndemonstrates that the \"should be a type name\" error message can be\nsuboptimal: it gets triggered when\n\n    not isinstance(value, str)\n    and not (isinstance(value, dict) and 'type' in value)\n\nFine when the value is neither str not dict.  Suboptimal when it's dict\nand 'type' is missing.  A more obvious example of suboptimality would be\n\n   'bar': { 'tvpe': 'int' }\n\nThe previous patch's\n\n        if isinstance(value, dict) and 'type' in value:\n            check_type(info, source, value['type'], allow_array,\n                       allow_dict, allow_optional, allow_metas)\n            if 'if' in value:\n                check_if(value, info)\n            check_unknown_keys(info, value, {'type', 'if'})\n            return\n        else:\n            raise QAPISemError(info, \"%s should be a type name\" % source)\n\nshould be improved to something like\n\n        if not isinstance(value, dict):\n            raise QAPISemError(\n                info, \"%s should be a type name or dictionary\" % source)\n        if 'type' not in value:\n            raise QAPISemError(\n                info, \"%s must have a member 'type'\" % source)\n        check_type(info, source, value['type'], allow_array,\n                   allow_dict, allow_optional, allow_metas)\n        if 'if' in value:\n            check_if(value, info)\n        check_unknown_keys(info, value, {'type', 'if'})\n        return\n\nproducing\n\n    struct-if-invalid.json:2: Member 'bar' of 'data' for struct 'TestIfStruct' must have a member 'type'\n\nThe fact that I missed this in review of the code, but noticed it in the\ntests is why I want tests added together with the code they test.\n\nNitpick: the file name struct-if-invalid makes me expect an invalid if.\nNot the case.  It's a missing type.  Let's rename accordingly.\n\n> diff --git a/tests/qapi-schema/struct-if-invalid.out b/tests/qapi-schema/struct-if-invalid.out\n> new file mode 100644\n> index 0000000000..e69de29bb2\n> diff --git a/tests/qapi-schema/struct-member-type.err b/tests/qapi-schema/struct-member-type.err\n> new file mode 100644\n> index 0000000000..e69de29bb2\n> diff --git a/tests/qapi-schema/struct-member-type.exit b/tests/qapi-schema/struct-member-type.exit\n> new file mode 100644\n> index 0000000000..573541ac97\n> --- /dev/null\n> +++ b/tests/qapi-schema/struct-member-type.exit\n> @@ -0,0 +1 @@\n> +0\n> diff --git a/tests/qapi-schema/struct-member-type.json b/tests/qapi-schema/struct-member-type.json\n> new file mode 100644\n> index 0000000000..8b33027817\n> --- /dev/null\n> +++ b/tests/qapi-schema/struct-member-type.json\n> @@ -0,0 +1,2 @@\n> +# check member 'a' with 'type' key only\n> +{ 'struct': 'foo', 'data': { 'a': { 'type': 'str' } } }\n> diff --git a/tests/qapi-schema/struct-member-type.out b/tests/qapi-schema/struct-member-type.out\n> new file mode 100644\n> index 0000000000..04b969d2e3\n> --- /dev/null\n> +++ b/tests/qapi-schema/struct-member-type.out\n> @@ -0,0 +1,12 @@\n> +enum QType\n> +    prefix QTYPE\n> +    member none:\n> +    member qnull:\n> +    member qnum:\n> +    member qstring:\n> +    member qdict:\n> +    member qlist:\n> +    member qbool:\n> +object foo\n> +    member a: str optional=False\n> +object q_empty\n\nThis is a positive test, isn't it?  Positive tests go into\nqapi-schema-test.json.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yv3Kv37Wdz9sP9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 Dec 2017 20:08:34 +1100 (AEDT)","from localhost ([::1]:40570 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eNb7X-0006Rf-Hv\n\tfor incoming@patchwork.ozlabs.org; Sat, 09 Dec 2017 04:08:31 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:53425)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1eNb73-0006Qg-4D\n\tfor qemu-devel@nongnu.org; Sat, 09 Dec 2017 04:08:03 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1eNb6y-00079o-3J\n\tfor qemu-devel@nongnu.org; Sat, 09 Dec 2017 04:08:01 -0500","from mx1.redhat.com ([209.132.183.28]:58780)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1eNb6x-000794-Qx\n\tfor qemu-devel@nongnu.org; Sat, 09 Dec 2017 04:07:56 -0500","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id F0ECDC049E31;\n\tSat,  9 Dec 2017 09:07:54 +0000 (UTC)","from blackfin.pond.sub.org (ovpn-116-74.ams2.redhat.com\n\t[10.36.116.74])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 0CB2C18426;\n\tSat,  9 Dec 2017 09:07:52 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid 8E7441138658; Sat,  9 Dec 2017 10:07:50 +0100 (CET)"],"From":"Markus Armbruster <armbru@redhat.com>","To":"=?utf-8?q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>\n\t<20170911110623.24981-25-marcandre.lureau@redhat.com>","Date":"Sat, 09 Dec 2017 10:07:50 +0100","In-Reply-To":"<20170911110623.24981-25-marcandre.lureau@redhat.com> (\n\t=?utf-8?b?Ik1hcmMtQW5kcsOp?= Lureau\"'s message of \"Mon,\n\t11 Sep 2017 \t13:05:57 +0200\")","Message-ID":"<87609g6zh5.fsf@dusky.pond.sub.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tSat, 09 Dec 2017 09:07:55 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [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":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1837340,"web_url":"http://patchwork.ozlabs.org/comment/1837340/","msgid":"<CAJ+F1CJbzrhr5xSaLX5B2mR3oVJkjDLnQRL0Y2fOcSkitPj12Q@mail.gmail.com>","list_archive_url":null,"date":"2018-01-11T21:31:50","subject":"Re: [Qemu-devel] [PATCH v3 24/50] qapi: add some struct member tests","submitter":{"id":6442,"url":"http://patchwork.ozlabs.org/api/people/6442/","name":"Marc-André Lureau","email":"marcandre.lureau@gmail.com"},"content":"Hi\n\nOn Sat, Dec 9, 2017 at 10:07 AM, Markus Armbruster <armbru@redhat.com> wrote:\n> Marc-André Lureau <marcandre.lureau@redhat.com> writes:\n>\n>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n>> ---\n>>  tests/Makefile.include                    |  2 ++\n>>  tests/qapi-schema/struct-if-invalid.err   |  1 +\n>>  tests/qapi-schema/struct-if-invalid.exit  |  1 +\n>>  tests/qapi-schema/struct-if-invalid.json  |  3 +++\n>>  tests/qapi-schema/struct-if-invalid.out   |  0\n>>  tests/qapi-schema/struct-member-type.err  |  0\n>>  tests/qapi-schema/struct-member-type.exit |  1 +\n>>  tests/qapi-schema/struct-member-type.json |  2 ++\n>>  tests/qapi-schema/struct-member-type.out  | 12 ++++++++++++\n>>  9 files changed, 22 insertions(+)\n>>  create mode 100644 tests/qapi-schema/struct-if-invalid.err\n>>  create mode 100644 tests/qapi-schema/struct-if-invalid.exit\n>>  create mode 100644 tests/qapi-schema/struct-if-invalid.json\n>>  create mode 100644 tests/qapi-schema/struct-if-invalid.out\n>>  create mode 100644 tests/qapi-schema/struct-member-type.err\n>>  create mode 100644 tests/qapi-schema/struct-member-type.exit\n>>  create mode 100644 tests/qapi-schema/struct-member-type.json\n>>  create mode 100644 tests/qapi-schema/struct-member-type.out\n>>\n>> diff --git a/tests/Makefile.include b/tests/Makefile.include\n>> index 0aa532f029..44a3d8895e 100644\n>> --- a/tests/Makefile.include\n>> +++ b/tests/Makefile.include\n>> @@ -520,7 +520,9 @@ qapi-schema += returns-whitelist.json\n>>  qapi-schema += struct-base-clash-deep.json\n>>  qapi-schema += struct-base-clash.json\n>>  qapi-schema += struct-data-invalid.json\n>> +qapi-schema += struct-if-invalid.json\n>>  qapi-schema += struct-member-invalid.json\n>> +qapi-schema += struct-member-type.json\n>>  qapi-schema += trailing-comma-list.json\n>>  qapi-schema += trailing-comma-object.json\n>>  qapi-schema += type-bypass-bad-gen.json\n>> diff --git a/tests/qapi-schema/struct-if-invalid.err b/tests/qapi-schema/struct-if-invalid.err\n>> new file mode 100644\n>> index 0000000000..42245262a9\n>> --- /dev/null\n>> +++ b/tests/qapi-schema/struct-if-invalid.err\n>> @@ -0,0 +1 @@\n>> +tests/qapi-schema/struct-if-invalid.json:2: Member 'bar' of 'data' for struct 'TestIfStruct' should be a type name\n>> diff --git a/tests/qapi-schema/struct-if-invalid.exit b/tests/qapi-schema/struct-if-invalid.exit\n>> new file mode 100644\n>> index 0000000000..d00491fd7e\n>> --- /dev/null\n>> +++ b/tests/qapi-schema/struct-if-invalid.exit\n>> @@ -0,0 +1 @@\n>> +1\n>> diff --git a/tests/qapi-schema/struct-if-invalid.json b/tests/qapi-schema/struct-if-invalid.json\n>> new file mode 100644\n>> index 0000000000..466cdb61e1\n>> --- /dev/null\n>> +++ b/tests/qapi-schema/struct-if-invalid.json\n>> @@ -0,0 +1,3 @@\n>> +# check missing 'type'\n>> +{ 'struct': 'TestIfStruct', 'data':\n>> +  { 'foo': 'int', 'bar': { 'if': 'defined(TEST_IF_STRUCT_BAR)' } } }\n>\n> Hmm.  This tests the previous patch's change to check_type().  It\n> demonstrates that the \"should be a type name\" error message can be\n> suboptimal: it gets triggered when\n>\n>     not isinstance(value, str)\n>     and not (isinstance(value, dict) and 'type' in value)\n>\n> Fine when the value is neither str not dict.  Suboptimal when it's dict\n> and 'type' is missing.  A more obvious example of suboptimality would be\n>\n>    'bar': { 'tvpe': 'int' }\n>\n> The previous patch's\n>\n>         if isinstance(value, dict) and 'type' in value:\n>             check_type(info, source, value['type'], allow_array,\n>                        allow_dict, allow_optional, allow_metas)\n>             if 'if' in value:\n>                 check_if(value, info)\n>             check_unknown_keys(info, value, {'type', 'if'})\n>             return\n>         else:\n>             raise QAPISemError(info, \"%s should be a type name\" % source)\n>\n> should be improved to something like\n>\n>         if not isinstance(value, dict):\n>             raise QAPISemError(\n>                 info, \"%s should be a type name or dictionary\" % source)\n>         if 'type' not in value:\n>             raise QAPISemError(\n>                 info, \"%s must have a member 'type'\" % source)\n>         check_type(info, source, value['type'], allow_array,\n>                    allow_dict, allow_optional, allow_metas)\n>         if 'if' in value:\n>             check_if(value, info)\n>         check_unknown_keys(info, value, {'type', 'if'})\n>         return\n>\n> producing\n>\n>     struct-if-invalid.json:2: Member 'bar' of 'data' for struct 'TestIfStruct' must have a member 'type'\n>\n\nFixed differently in v4\n\n> The fact that I missed this in review of the code, but noticed it in the\n> tests is why I want tests added together with the code they test.\n>\n\nChanged in v4\n\n> Nitpick: the file name struct-if-invalid makes me expect an invalid if.\n> Not the case.  It's a missing type.  Let's rename accordingly.\n\nDone\n\n>\n>> diff --git a/tests/qapi-schema/struct-if-invalid.out b/tests/qapi-schema/struct-if-invalid.out\n>> new file mode 100644\n>> index 0000000000..e69de29bb2\n>> diff --git a/tests/qapi-schema/struct-member-type.err b/tests/qapi-schema/struct-member-type.err\n>> new file mode 100644\n>> index 0000000000..e69de29bb2\n>> diff --git a/tests/qapi-schema/struct-member-type.exit b/tests/qapi-schema/struct-member-type.exit\n>> new file mode 100644\n>> index 0000000000..573541ac97\n>> --- /dev/null\n>> +++ b/tests/qapi-schema/struct-member-type.exit\n>> @@ -0,0 +1 @@\n>> +0\n>> diff --git a/tests/qapi-schema/struct-member-type.json b/tests/qapi-schema/struct-member-type.json\n>> new file mode 100644\n>> index 0000000000..8b33027817\n>> --- /dev/null\n>> +++ b/tests/qapi-schema/struct-member-type.json\n>> @@ -0,0 +1,2 @@\n>> +# check member 'a' with 'type' key only\n>> +{ 'struct': 'foo', 'data': { 'a': { 'type': 'str' } } }\n>> diff --git a/tests/qapi-schema/struct-member-type.out b/tests/qapi-schema/struct-member-type.out\n>> new file mode 100644\n>> index 0000000000..04b969d2e3\n>> --- /dev/null\n>> +++ b/tests/qapi-schema/struct-member-type.out\n>> @@ -0,0 +1,12 @@\n>> +enum QType\n>> +    prefix QTYPE\n>> +    member none:\n>> +    member qnull:\n>> +    member qnum:\n>> +    member qstring:\n>> +    member qdict:\n>> +    member qlist:\n>> +    member qbool:\n>> +object foo\n>> +    member a: str optional=False\n>> +object q_empty\n>\n> This is a positive test, isn't it?  Positive tests go into\n> qapi-schema-test.json.\n>\n\nRight, I wonder why we have .exit files then. Perhaps the few ones\nthat return 0 shouldn't exist.\n\nthanks","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"nz4b2xSM\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3zHfPZ0jwzz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 12 Jan 2018 08:38:10 +1100 (AEDT)","from localhost ([::1]:44763 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eZkY4-0008GS-3N\n\tfor incoming@patchwork.ozlabs.org; Thu, 11 Jan 2018 16:38:08 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:48546)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1eZkS1-0003Gs-HV\n\tfor qemu-devel@nongnu.org; Thu, 11 Jan 2018 16:31:57 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1eZkS0-0007aB-Eu\n\tfor qemu-devel@nongnu.org; Thu, 11 Jan 2018 16:31:53 -0500","from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:37624)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <marcandre.lureau@gmail.com>)\n\tid 1eZkS0-0007Z1-5E\n\tfor qemu-devel@nongnu.org; Thu, 11 Jan 2018 16:31:52 -0500","by mail-wr0-x242.google.com with SMTP id f8so3559235wre.4\n\tfor <qemu-devel@nongnu.org>; Thu, 11 Jan 2018 13:31:52 -0800 (PST)","by 10.223.199.143 with HTTP; Thu, 11 Jan 2018 13:31:50 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc:content-transfer-encoding;\n\tbh=OkPbrSGMnzU1OyTdgItJcqPMZRadyCcsuzRaTkIIXwg=;\n\tb=nz4b2xSMl9Iyo372NVlGtq/FE7BsHVOpLMQsEaN6sWaGxbnhqvMsvndtjXM9LXum0x\n\ttuOYbCvAmi1QvnaxrQTGx0vbTA8cCvCmfIPIlfj/0EqpEhE+RqOFhV81uOiK/jUr45V/\n\t7kR1HPVoKwAoTZznPXhhmnhL81rLPmCjeS4As9eUYhRX/5MoWgxNCMdl/DdG9Is+Qjyd\n\tcVU57CmpD52vLL12JhgipPDoGrb3tkfSLsyjVkFSESmQ9hT3Z6JW2BG2v6BKXvElshq5\n\tiyEhYajQbd9nhel5qGCaJKHg58Y5hb2IHJrFgB9EOV1m7bt8af6YcOzkzinghMF8BUs1\n\tcIEA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=OkPbrSGMnzU1OyTdgItJcqPMZRadyCcsuzRaTkIIXwg=;\n\tb=aIDC1hI8gevdl/tBL96u8jh/5CrUfLEAU4P3mAe9crlfUuyvG8BiWWXcCLohxqkJjK\n\tYGv6ZBcOhQXVzIyqNH+PaTsio6c52D9jcjEOOqliSCLiKkpkyc2V5C9D1JbM9MkmcIK1\n\tJSk57mCOewqmSB8Rnl7ZHE8LYwT6LPXwKMpSRf2T0Tn9ivFLBOW/crNz9sVZSasiOIzS\n\tzmeUpYf8D6ZXTlfqt2Bcp2D4GGIQnkAaqnGepZFnPndG6hhv1fFij+aD2zwakQ3n3tqJ\n\toN+DV1kduiP7wRGpncrGzZnykmu9WNdUC8WaMtNePI6qtzt/Ul0mtFonJtK8oypY6hW9\n\tUmEA==","X-Gm-Message-State":"AKGB3mKnQAndcMzjwoH/UMmMnp6RXOo0ZFB/XxQvMdFTXX1cd6jMRdvr\n\tN+QjyH3AAIW8hpmAsa1vBDD5LY+QZK+WJ+CRDBM=","X-Google-Smtp-Source":"ACJfBotF+Ryf0nPQVXI7HYNTopORQZrfQqSrZwe1+QCweq0XqbX43+n5InVYv/rl50Nu/S6KRhnC460AI6zhEoFliwQ=","X-Received":"by 10.223.197.69 with SMTP id s5mr22669183wrf.96.1515706311096; \n\tThu, 11 Jan 2018 13:31:51 -0800 (PST)","MIME-Version":"1.0","In-Reply-To":"<87609g6zh5.fsf@dusky.pond.sub.org>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>\n\t<20170911110623.24981-25-marcandre.lureau@redhat.com>\n\t<87609g6zh5.fsf@dusky.pond.sub.org>","From":"=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@gmail.com>","Date":"Thu, 11 Jan 2018 22:31:50 +0100","Message-ID":"<CAJ+F1CJbzrhr5xSaLX5B2mR3oVJkjDLnQRL0Y2fOcSkitPj12Q@mail.gmail.com>","To":"Markus Armbruster <armbru@redhat.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c0c::242","Subject":"Re: [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":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"QEMU <qemu-devel@nongnu.org>, Michael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1850537,"web_url":"http://patchwork.ozlabs.org/comment/1850537/","msgid":"<87372jla1a.fsf@dusky.pond.sub.org>","list_archive_url":null,"date":"2018-02-02T14:51:29","subject":"Re: [Qemu-devel] [PATCH v3 24/50] qapi: add some struct member tests","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/","name":"Markus Armbruster","email":"armbru@redhat.com"},"content":"Marc-André Lureau <marcandre.lureau@gmail.com> writes:\n\n> Hi\n>\n> On Sat, Dec 9, 2017 at 10:07 AM, Markus Armbruster <armbru@redhat.com> wrote:\n>> Marc-André Lureau <marcandre.lureau@redhat.com> writes:\n[...]\n>>> diff --git a/tests/qapi-schema/struct-member-type.json b/tests/qapi-schema/struct-member-type.json\n>>> new file mode 100644\n>>> index 0000000000..8b33027817\n>>> --- /dev/null\n>>> +++ b/tests/qapi-schema/struct-member-type.json\n>>> @@ -0,0 +1,2 @@\n>>> +# check member 'a' with 'type' key only\n>>> +{ 'struct': 'foo', 'data': { 'a': { 'type': 'str' } } }\n>>> diff --git a/tests/qapi-schema/struct-member-type.out b/tests/qapi-schema/struct-member-type.out\n>>> new file mode 100644\n>>> index 0000000000..04b969d2e3\n>>> --- /dev/null\n>>> +++ b/tests/qapi-schema/struct-member-type.out\n>>> @@ -0,0 +1,12 @@\n>>> +enum QType\n>>> +    prefix QTYPE\n>>> +    member none:\n>>> +    member qnull:\n>>> +    member qnum:\n>>> +    member qstring:\n>>> +    member qdict:\n>>> +    member qlist:\n>>> +    member qbool:\n>>> +object foo\n>>> +    member a: str optional=False\n>>> +object q_empty\n>>\n>> This is a positive test, isn't it?  Positive tests go into\n>> qapi-schema-test.json.\n>>\n>\n> Right, I wonder why we have .exit files then. Perhaps the few ones\n> that return 0 shouldn't exist.\n\nThere are a few legitimate positive test cases, such as empty.json and\ndoc-good.json.\n\nMoreover, we occasionally add negative test cases that fail to fail,\ndemonstrating a bug.  Example: quoted-structural-chars in commit\n98626572f1, fixed in commit c7a3f25200.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3zY16d04Qzz9t0m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  3 Feb 2018 02:26:33 +1100 (AEDT)","from localhost ([::1]:36489 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ehdEV-0003a8-1Q\n\tfor incoming@patchwork.ozlabs.org; Fri, 02 Feb 2018 10:26:31 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:46084)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ehcgi-0007H7-G7\n\tfor qemu-devel@nongnu.org; Fri, 02 Feb 2018 09:51:39 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1ehcge-0007Ej-JX\n\tfor qemu-devel@nongnu.org; Fri, 02 Feb 2018 09:51:36 -0500","from mx1.redhat.com ([209.132.183.28]:47170)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1ehcge-0007EQ-D2\n\tfor qemu-devel@nongnu.org; Fri, 02 Feb 2018 09:51:32 -0500","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 92F986E761;\n\tFri,  2 Feb 2018 14:51:31 +0000 (UTC)","from blackfin.pond.sub.org (ovpn-116-148.ams2.redhat.com\n\t[10.36.116.148])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 510069CC2;\n\tFri,  2 Feb 2018 14:51:31 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid D78FD1138645; Fri,  2 Feb 2018 15:51:29 +0100 (CET)"],"From":"Markus Armbruster <armbru@redhat.com>","To":"=?utf-8?q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@gmail.com>","References":"<20170911110623.24981-1-marcandre.lureau@redhat.com>\n\t<20170911110623.24981-25-marcandre.lureau@redhat.com>\n\t<87609g6zh5.fsf@dusky.pond.sub.org>\n\t<CAJ+F1CJbzrhr5xSaLX5B2mR3oVJkjDLnQRL0Y2fOcSkitPj12Q@mail.gmail.com>","Date":"Fri, 02 Feb 2018 15:51:29 +0100","In-Reply-To":"<CAJ+F1CJbzrhr5xSaLX5B2mR3oVJkjDLnQRL0Y2fOcSkitPj12Q@mail.gmail.com>\n\t( =?utf-8?b?Ik1hcmMtQW5kcsOp?= Lureau\"'s message of \"Thu,\n\t11 Jan 2018 \t22:31:50 +0100\")","Message-ID":"<87372jla1a.fsf@dusky.pond.sub.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tFri, 02 Feb 2018 14:51:31 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [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":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"QEMU <qemu-devel@nongnu.org>, Michael Roth <mdroth@linux.vnet.ibm.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]