diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-01-10 14:31:39 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-02-14 16:21:08 +0100 |
commit | bb6c5e3c3a460b449ddb81be2a572561121fbe7f (patch) | |
tree | 885ae31cc0b857e235dbb97ca39c1df500972ddb /tests | |
parent | 5c1904f103cbc5a7353fba8c8ca3cb16a0281392 (diff) | |
download | qemu-bb6c5e3c3a460b449ddb81be2a572561121fbe7f.zip qemu-bb6c5e3c3a460b449ddb81be2a572561121fbe7f.tar.gz qemu-bb6c5e3c3a460b449ddb81be2a572561121fbe7f.tar.bz2 |
qom-test: Test shutdown in addition to startup
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qom-test.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/qom-test.c b/tests/qom-test.c index 24cb9c5..3316a11 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(); |