qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v8 09/17] qapi: Add positive tests to qapi-schem


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v8 09/17] qapi: Add positive tests to qapi-schema-test
Date: Tue, 03 Nov 2015 17:43:20 +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.
>
> This includes:
> Use of a member 'base' in a struct with a base class
> Use of a member name ending in 'Kind' or 'List'
> Use of a type name starting with 'has_'
> Use of a type named 'u'
> Use of a union branch name of 'u'
> Use of a union branch name starting with 'has_'
> Use of a union branch name of 'type'
>
> Signed-off-by: Eric Blake <address@hidden>
>
> ---
> v8: new, but collects portions of subset B v10 patches 2, 3, and
> 16 and subset C v7 patch 6 that were deferred to later.
>
> It might be worth dropping or simplifying this patch, depending
> on how many corner cases we actually want to test.

Let's go through your list:

* Use of a member 'base' in a struct with a base class

  'base' is no longer special, and testing it is as useful as testing
  any other non-special member name.  I'd drop it.  Or am I missing
  something?

* Use of a member name ending in 'Kind' or 'List'

  These aren't special as member names, but they are reserved type
  names.  The test ensures we don't accidentally reserve them as member
  names.  Low probability * low damage = very low risk.  But since you
  wrote the test already, we can just as well keep it.

* Use of a type name starting with 'has_'
* Use of a type named 'u'
* Use of a union branch name of 'u'
* Use of a union branch name starting with 'has_'

  Similarly: these are only reserved as member names, very low risk, but
  why not keep the test.

* Use of a union branch name of 'type'

  As far as I know, 'type' isn't reserved anywhere, it's just the name
  of a simple union's implicit tag member.  Testing a tag value doesn't
  clash with 'type' is as useful as testing any other non-variant member
  name.  I'd drop it.  Or am I missing something?

Anything else being tested here?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]