qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/2] qom-test: Test shutdown in addition to startup


From: armbru
Subject: [Qemu-devel] [PATCH 2/2] qom-test: Test shutdown in addition to startup
Date: Fri, 10 Jan 2014 14:31:39 +0100

From: Markus Armbruster <address@hidden>

Signed-off-by: Markus Armbruster <address@hidden>
---
 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 3cbd480..8f42716 100644
--- a/tests/qom-test.c
+++ b/tests/qom-test.c
@@ -48,17 +48,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);
 }
 
@@ -88,7 +88,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();
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]