[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] tests/device-introspection: Check that the
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH 2/6] tests/device-introspection: Check that the qom-tree and qtree do not change |
Date: |
Wed, 15 Aug 2018 08:00:53 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 08/14/2018 07:53 PM, Markus Armbruster wrote:
> Thomas Huth <address@hidden> writes:
[...]
>> @@ -115,10 +122,18 @@ static void test_one_device(const char *type)
>>
>> /*
>> * Some devices leave dangling pointers in QOM behind.
>> - * "info qom-tree" has a good chance at crashing then
>> + * "info qom-tree" or "info qtree" have a good chance at crashing then.
>> + * Also make sure that the tree did not change.
>> */
>> - qom_tree = hmp("info qom-tree");
>> - g_free(qom_tree);
>> + qom_tree_end = hmp("info qom-tree");
>> + g_assert_cmpstr(qom_tree_start, ==, qom_tree_end);
>> + g_free(qom_tree_start);
>> + g_free(qom_tree_end);
>> +
>> + qtree_end = hmp("info qtree");
>> + g_assert_cmpstr(qtree_start, ==, qtree_end);
>> + g_free(qtree_start);
>> + g_free(qtree_end);
>> }
>>
>> static void test_device_intro_list(void)
>
> Output of "info qom-tree" depends on hash table iteration order, but
> that could almost be considered a feature here.
Currently, it seems to work fine. If we hit a false positive with
ordering later, we still can add some code for sorting the output, I guess?
Thomas
[Qemu-devel] [PATCH 3/6] hw/timer/mc146818rtc: White space clean-up, Thomas Huth, 2018/08/14
[Qemu-devel] [PATCH 4/6] hw/timer/mc146818rtc: Fix introspection problem, Thomas Huth, 2018/08/14
[Qemu-devel] [PATCH 5/6] net: Silence 'has no peer' messages in testing mode, Thomas Huth, 2018/08/14