[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 25/27] qapi: Add positive tests to qapi-schem
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v9 25/27] qapi: Add positive tests to qapi-schema-test |
Date: |
Thu, 05 Nov 2015 19:44:42 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> Add positive tests to qapi-schema-test for things that were
> made possible by recent patches but which caused compile errors
> due to collisions prior to that point. The focus is mainly on
> collisions due to names we have reserved for qapi, even though
> it is unlikely that anyone will want to abuse these names in
> actual .json files.
>
> The added tests includes:
Checking sanity aloud:
> Use of a member name ending in 'Kind' or 'List' [1, 4]
Reserved for type names, because we generate typedef FOOList for
['FOO'], and FOOKind for a simple union FOO.
> Use of a type name starting with 'has_' [1, 5]
Reserved for member names, because we generate has_FOO for an optional
member FOO in the same name space.
See below for union branch.
Could additionally test command and event names, but I very much doubt
that's worth the bother.
> Use of a type named 'u' [1, 6]
> Use of a union branch name of 'u' [2, 6]
Reserved for member names, because we generate u in the same name space
for unions.
> Use of a union branch name starting with 'has_' [2, 5]
See above.
> Use of an alternate branch name of 'max' [3]
I'd prefer keeping "branch name can't be MAX" as artificial restriction
just for similarity to unions.
> [1] Never broken, but could break if reservations are too strict
> [2] Broken prior to commit e4ba22b
> [3] Broken prior to previous commit
> [4] See reservations in commit 4dc2e69 and 255960d
> [5] See reservations in commit 9fb081e
> [6] See reservation in commit 5e59baf
>
> Not worth testing here: we no longer have a collision with a
> member named 'base' (commit ddf2190) or with a branch named
> 'type' (commit e4ba22b).
>
> Signed-off-by: Eric Blake <address@hidden>
Patch looks good.
- [Qemu-devel] [PATCH v9 18/27] qapi: Factor out QAPISchemaObjectTypeMember.check_clash(), (continued)
- [Qemu-devel] [PATCH v9 18/27] qapi: Factor out QAPISchemaObjectTypeMember.check_clash(), Eric Blake, 2015/11/04
- [Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVariants.check(), Eric Blake, 2015/11/04
- [Qemu-devel] [PATCH v9 15/27] qapi: Simplify QAPISchemaObjectTypeMember.check(), Eric Blake, 2015/11/04
- [Qemu-devel] [PATCH v9 22/27] qapi: Remove outdated tests related to QMP/branch collisions, Eric Blake, 2015/11/04
- [Qemu-devel] [PATCH v9 26/27] qapi: Remove dead visitor code, Eric Blake, 2015/11/04
- [Qemu-devel] [PATCH v9 25/27] qapi: Add positive tests to qapi-schema-test, Eric Blake, 2015/11/04
- Re: [Qemu-devel] [PATCH v9 25/27] qapi: Add positive tests to qapi-schema-test,
Markus Armbruster <=
- [Qemu-devel] [PATCH v9 12/27] qapi-types: Simplify gen_struct_field[s], Eric Blake, 2015/11/04
- [Qemu-devel] [PATCH v9 19/27] qapi: Check for qapi collisions of flat union branches, Eric Blake, 2015/11/04
[Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*, Eric Blake, 2015/11/04