From bb6c5e3c3a460b449ddb81be2a572561121fbe7f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 10 Jan 2014 14:31:39 +0100 Subject: [PATCH] qom-test: Test shutdown in addition to startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Markus Armbruster Signed-off-by: Andreas Färber --- tests/qom-test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qom-test.c b/tests/qom-test.c index 24cb9c5056..3316a110a2 100644 --- a/tests/qom-test.c +++ b/tests/qom-test.c @@ -42,17 +42,17 @@ static bool is_blacklisted(const char *arch, const char *mach) return false; } -static void test_nop(gconstpointer data) +static void test_machine(gconstpointer data) { - QTestState *s; const char *machine = data; char *args; + QDict *response; args = g_strdup_printf("-machine %s", machine); - s = qtest_start(args); - if (s) { - qtest_quit(s); - } + qtest_start(args); + response = qmp("{ 'execute': 'quit' }"); + g_assert(qdict_haskey(response, "return")); + qtest_end(); g_free(args); } @@ -82,7 +82,7 @@ static void add_machine_test_cases(void) mname = qstring_get_str(qstr); if (!is_blacklisted(arch, mname)) { path = g_strdup_printf("/%s/qom/%s", arch, mname); - g_test_add_data_func(path, mname, test_nop); + g_test_add_data_func(path, mname, test_machine); } } qtest_end();