[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/19] tests/qapi-schema: Demonstrate insufficie
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 05/19] tests/qapi-schema: Demonstrate insufficient 'if' checking |
Date: |
Mon, 23 Sep 2019 07:55:49 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 9/23/19 6:55 AM, Markus Armbruster wrote:
>>> +++ b/tests/qapi-schema/union-branch-if-invalid.json
>>> @@ -0,0 +1,7 @@
>>> +# Cover branch with invalid 'if'
>>> +# FIXME not rejected, would generate '#if \n'
>>> +{ 'enum': 'Branches', 'data': ['branch1'] }
>>> +{ 'struct': 'Stru', 'data': { 'member': 'str' } }
>>> +{ 'union': 'Uni',
>>> + 'base': { 'tag': 'Branches' }, 'discriminator': 'tag',
>>> + 'data': { 'branch1': { 'type': 'Stru', 'if': [''] } } }
>>
>> So you're pointing out a difference between an empty string and a string
>> not containing a C macro name (possibly because later patches will give
>> them different error messages).
>
> Not sure I got this comment.
I was comparing:
> +++ b/tests/qapi-schema/union-branch-if-invalid.json
> + 'data': { 'branch1': { 'type': 'Stru', 'if': [''] } } }
with:
> +++ b/tests/qapi-schema/alternate-branch-if-invalid.json
> + 'data': { 'branch': { 'type': 'int', 'if': ' ' } } }
Both of which produce invalid expansions, but because of the difference
between empty string vs. all-whitespace might be fixed differently in
later patches. At any rate, nothing to change in those tests.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 00/19] qapi: Frontend fixes and cleanups, Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 03/19] tests/qapi-schema: Demonstrate misleading optional tag error, Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 14/19] qapi: Simplify check_keys(), Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 12/19] qapi: Fix missing 'if' checks in struct, union, alternate 'data', Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 10/19] qapi: Fix broken discriminator error messages, Markus Armbruster, 2019/09/14
- [Qemu-devel] [PATCH 02/19] tests/qapi-schema: Delete two redundant tests, Markus Armbruster, 2019/09/14