[Qemu-devel] [PATCH 03/56] check-qjson: Cover whitespace more thoroughly

Markus Armbruster posted 56 patches 7 years, 2 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 03/56] check-qjson: Cover whitespace more thoroughly
Posted by Markus Armbruster 7 years, 2 months ago
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/check-qjson.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 81b92d6b0c..0a9a054c7b 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -1236,7 +1236,7 @@ static void simple_whitespace(void)
                     })),
         },
         {
-            .encoded = " [ 43 , { 'h' : 'b' }, [ ], 42 ]",
+            .encoded = "\t[ 43 , { 'h' : 'b' },\n\t[ ], 42 ]\n",
             .decoded = QLIT_QLIST(((QLitObject[]){
                         QLIT_QNUM(43),
                         QLIT_QDICT(((QLitDictEntry[]){
-- 
2.17.1


Re: [Qemu-devel] [PATCH 03/56] check-qjson: Cover whitespace more thoroughly
Posted by Eric Blake 7 years, 2 months ago
On 08/08/2018 07:02 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   tests/check-qjson.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/check-qjson.c b/tests/check-qjson.c
> index 81b92d6b0c..0a9a054c7b 100644
> --- a/tests/check-qjson.c
> +++ b/tests/check-qjson.c
> @@ -1236,7 +1236,7 @@ static void simple_whitespace(void)
>                       })),
>           },
>           {
> -            .encoded = " [ 43 , { 'h' : 'b' }, [ ], 42 ]",
> +            .encoded = "\t[ 43 , { 'h' : 'b' },\n\t[ ], 42 ]\n",

I would also test \r, since that is the final whitespace character 
mentioned in RFC 7159.

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

Re: [Qemu-devel] [PATCH 03/56] check-qjson: Cover whitespace more thoroughly
Posted by Markus Armbruster 7 years, 2 months ago
Eric Blake <eblake@redhat.com> writes:

> On 08/08/2018 07:02 AM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   tests/check-qjson.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tests/check-qjson.c b/tests/check-qjson.c
>> index 81b92d6b0c..0a9a054c7b 100644
>> --- a/tests/check-qjson.c
>> +++ b/tests/check-qjson.c
>> @@ -1236,7 +1236,7 @@ static void simple_whitespace(void)
>>                       })),
>>           },
>>           {
>> -            .encoded = " [ 43 , { 'h' : 'b' }, [ ], 42 ]",
>> +            .encoded = "\t[ 43 , { 'h' : 'b' },\n\t[ ], 42 ]\n",
>
> I would also test \r, since that is the final whitespace character
> mentioned in RFC 7159.

Easy to do, so why not.