[Qemu-devel] [PATCH v2 05/16] tests/qapi-schema: Demonstrate bad reporting of funny characters

Markus Armbruster posted 16 patches 6 years, 5 months ago
Maintainers: Michael Roth <mdroth@linux.vnet.ibm.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
[Qemu-devel] [PATCH v2 05/16] tests/qapi-schema: Demonstrate bad reporting of funny characters
Posted by Markus Armbruster 6 years, 5 months ago
Invalid name 'not\\possible' is reported as 'not\possible'.  Control
characters (quoted or not) are even more confusing.  Mark FIXME.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/qapi-schema/enum-bad-name.err  | 2 +-
 tests/qapi-schema/enum-bad-name.json | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/qapi-schema/enum-bad-name.err b/tests/qapi-schema/enum-bad-name.err
index 9c3c1002b7..26a09f84ad 100644
--- a/tests/qapi-schema/enum-bad-name.err
+++ b/tests/qapi-schema/enum-bad-name.err
@@ -1 +1 @@
-tests/qapi-schema/enum-bad-name.json:2: Member of enum 'MyEnum' uses invalid name 'not^possible'
+tests/qapi-schema/enum-bad-name.json:3: Member of enum 'MyEnum' uses invalid name 'not\possible'
diff --git a/tests/qapi-schema/enum-bad-name.json b/tests/qapi-schema/enum-bad-name.json
index 8506562b31..b233fdc825 100644
--- a/tests/qapi-schema/enum-bad-name.json
+++ b/tests/qapi-schema/enum-bad-name.json
@@ -1,2 +1,3 @@
 # we ensure all enum names can map to C
-{ 'enum': 'MyEnum', 'data': [ 'not^possible' ] }
+# FIXME reports 'not\posible' instead of 'not\\possible'
+{ 'enum': 'MyEnum', 'data': [ 'not\\possible' ] }
-- 
2.21.0


Re: [Qemu-devel] [PATCH v2 05/16] tests/qapi-schema: Demonstrate bad reporting of funny characters
Posted by Eric Blake 6 years, 5 months ago
On 9/10/19 1:37 AM, Markus Armbruster wrote:
> Invalid name 'not\\possible' is reported as 'not\possible'.  Control
> characters (quoted or not) are even more confusing.  Mark FIXME.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  tests/qapi-schema/enum-bad-name.err  | 2 +-
>  tests/qapi-schema/enum-bad-name.json | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qapi-schema/enum-bad-name.err b/tests/qapi-schema/enum-bad-name.err
> index 9c3c1002b7..26a09f84ad 100644
> --- a/tests/qapi-schema/enum-bad-name.err
> +++ b/tests/qapi-schema/enum-bad-name.err
> @@ -1 +1 @@
> -tests/qapi-schema/enum-bad-name.json:2: Member of enum 'MyEnum' uses invalid name 'not^possible'
> +tests/qapi-schema/enum-bad-name.json:3: Member of enum 'MyEnum' uses invalid name 'not\possible'
> diff --git a/tests/qapi-schema/enum-bad-name.json b/tests/qapi-schema/enum-bad-name.json
> index 8506562b31..b233fdc825 100644
> --- a/tests/qapi-schema/enum-bad-name.json
> +++ b/tests/qapi-schema/enum-bad-name.json
> @@ -1,2 +1,3 @@
>  # we ensure all enum names can map to C
> -{ 'enum': 'MyEnum', 'data': [ 'not^possible' ] }
> +# FIXME reports 'not\posible' instead of 'not\\possible'

s/posible/possible/

(Is it bad when you have a typo in demonstrating that the code has a typo?)

With that fixed,

Reviewed-by: Eric Blake <eblake@redhat.com>

> +{ 'enum': 'MyEnum', 'data': [ 'not\\possible' ] }
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH v2 05/16] tests/qapi-schema: Demonstrate bad reporting of funny characters
Posted by Markus Armbruster 6 years, 4 months ago
Eric Blake <eblake@redhat.com> writes:

> On 9/10/19 1:37 AM, Markus Armbruster wrote:
>> Invalid name 'not\\possible' is reported as 'not\possible'.  Control
>> characters (quoted or not) are even more confusing.  Mark FIXME.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  tests/qapi-schema/enum-bad-name.err  | 2 +-
>>  tests/qapi-schema/enum-bad-name.json | 3 ++-
>>  2 files changed, 3 insertions(+), 2 deletions(-)
>> 
>> diff --git a/tests/qapi-schema/enum-bad-name.err b/tests/qapi-schema/enum-bad-name.err
>> index 9c3c1002b7..26a09f84ad 100644
>> --- a/tests/qapi-schema/enum-bad-name.err
>> +++ b/tests/qapi-schema/enum-bad-name.err
>> @@ -1 +1 @@
>> -tests/qapi-schema/enum-bad-name.json:2: Member of enum 'MyEnum' uses invalid name 'not^possible'
>> +tests/qapi-schema/enum-bad-name.json:3: Member of enum 'MyEnum' uses invalid name 'not\possible'
>> diff --git a/tests/qapi-schema/enum-bad-name.json b/tests/qapi-schema/enum-bad-name.json
>> index 8506562b31..b233fdc825 100644
>> --- a/tests/qapi-schema/enum-bad-name.json
>> +++ b/tests/qapi-schema/enum-bad-name.json
>> @@ -1,2 +1,3 @@
>>  # we ensure all enum names can map to C
>> -{ 'enum': 'MyEnum', 'data': [ 'not^possible' ] }
>> +# FIXME reports 'not\posible' instead of 'not\\possible'
>
> s/posible/possible/
>
> (Is it bad when you have a typo in demonstrating that the code has a typo?)

Funny, not bad %-}

> With that fixed,
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

>> +{ 'enum': 'MyEnum', 'data': [ 'not\\possible' ] }
>>