Thomas Huth <th...@redhat.com> writes: > On 08/14/2018 07:53 PM, Markus Armbruster wrote: >> Thomas Huth <th...@redhat.com> 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?
I'm fine with comparing output of info qom-tree and info qtree. I figure the most likely cause for a change of order would be a series of QOM tree modifications that cancels out. There should be *no* QOM tree modifications. Thus, "almost a feature".