[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] tests: Enhance qmp output to cover partial
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] tests: Enhance qmp output to cover partial visit |
Date: |
Tue, 25 Oct 2016 08:41:16 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 10/25/2016 06:07 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> Add a test that proves (at least when run under valgrind) that
>> we are correctly handling allocated memory even when a visit
>> is aborted in the middle for whatever other reason.
>>
>> See commit f24582d "qapi: fix double free in
>> qmp_output_visitor_cleanup()" for a fix that was lacking
>> testsuite exposure prior to this patch.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>> +static void test_visitor_out_partial_visit(TestOutputVisitorData *data,
>> + const void *unused)
>> +{
>> + /* Check that aborting mid-visit doesn't leak or double-free */
>> + visit_start_struct(data->ov, NULL, NULL, 0, &error_abort);
>> + visit_start_struct(data->ov, "nested", NULL, 0, &error_abort);
>> + visitor_reset(data);
>
> Add a second test that additionally visits a member? Or is visiting the
> "nested" member enough?
Visiting "nested" was enough to trigger the particular valgrind trace I
wanted, but more coverage never hurts. I'll send v2...
> Would you be willing to do the same for lists and alternates?
...and it will also cover these.
>
> Speaking of alternates, visitor.h's virtual walk example covers struct
> and list, but not alternate.
Sounds like my v2 will be a longer series :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature