qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 22/26] test-qobject-input-visitor: Cover miss


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 22/26] test-qobject-input-visitor: Cover missing nested struct member
Date: Tue, 28 Feb 2017 17:52:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 02/26/2017 03:43 PM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>>  tests/test-qobject-input-visitor.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>> 
>> diff --git a/tests/test-qobject-input-visitor.c 
>> b/tests/test-qobject-input-visitor.c
>> index 10c15c4..6e04736 100644
>> --- a/tests/test-qobject-input-visitor.c
>> +++ b/tests/test-qobject-input-visitor.c
>> @@ -894,7 +894,7 @@ static void 
>> test_visitor_in_fail_struct_missing(TestInputVisitorData *data,
>>      char *str;
>>      double dbl;
>>  
>> -    v = visitor_input_test_init(data, "{}");
>> +    v = visitor_input_test_init(data, "{ 'sub': [ {} ] }");
>>      visit_start_struct(v, NULL, NULL, 0, &error_abort);
>>      visit_start_struct(v, "struct", NULL, 0, &err);
>>      error_free_or_abort(&err);
>> @@ -920,6 +920,11 @@ static void 
>> test_visitor_in_fail_struct_missing(TestInputVisitorData *data,
>>      error_free_or_abort(&err);
>>      visit_type_null(v, "null", &err);
>>      error_free_or_abort(&err);
>> +    visit_start_list(v, "sub", NULL, 0, &error_abort);
>> +    visit_start_struct(v, NULL, NULL, 0, &error_abort);
>> +    visit_type_int(v, "i64", &i64, &err);
>> +    error_free_or_abort(&err);
>> +    visit_end_struct(v, NULL);
>>      visit_end_struct(v, NULL);
>
> Missing a visit_end_list, no?

Yes.

qobject-input-visitor.c fails to check the visit_end_ matches the last
visit_start_.  Perhaps test-qobject-input-visitor.c should additionally
check no visit_end_ is missing.

I intend to add the missing visit_end_list(), and leave the rest for the
next series.

Thanks!



reply via email to

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