]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commitdiff
libqtest: New qtest_end() to go with qtest_start()
authorMarkus Armbruster <armbru@redhat.com>
Thu, 20 Jun 2013 06:55:29 +0000 (08:55 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 18 Jul 2013 16:32:55 +0000 (11:32 -0500)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1371711329-9144-3-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tests/fdc-test.c
tests/hd-geo-test.c
tests/ide-test.c
tests/libqtest.h

index 4b0301da469c49a86bc0005b2840efead4894d1d..fd198dcf8b86a3bbaf935dfefd48797c00be544f 100644 (file)
@@ -556,7 +556,7 @@ int main(int argc, char **argv)
     ret = g_test_run();
 
     /* Cleanup */
-    qtest_quit(global_qtest);
+    qtest_end();
     unlink(test_image);
 
     return ret;
index 9a31e8587f26f6cc7cb8263208648fcfa905f350..b72042e59d49ebddcafd15081b87f530036fd443 100644 (file)
@@ -244,7 +244,7 @@ static void test_ide_none(void)
     setup_common(argv, ARRAY_SIZE(argv));
     qtest_start(g_strjoinv(" ", argv));
     test_cmos();
-    qtest_quit(global_qtest);
+    qtest_end();
 }
 
 static void test_ide_mbr(bool use_device, MBRcontents mbr)
@@ -262,7 +262,7 @@ static void test_ide_mbr(bool use_device, MBRcontents mbr)
     }
     qtest_start(g_strjoinv(" ", argv));
     test_cmos();
-    qtest_quit(global_qtest);
+    qtest_end();
 }
 
 /*
@@ -334,7 +334,7 @@ static void test_ide_drive_user(const char *dev, bool trans)
     g_free(opts);
     qtest_start(g_strjoinv(" ", argv));
     test_cmos();
-    qtest_quit(global_qtest);
+    qtest_end();
 }
 
 /*
@@ -387,7 +387,7 @@ static void test_ide_drive_cd_0(void)
     }
     qtest_start(g_strjoinv(" ", argv));
     test_cmos();
-    qtest_quit(global_qtest);
+    qtest_end();
 }
 
 int main(int argc, char **argv)
index 7e2eb9455a6e91c05284c15e6466cafeba4f6962..7307f1d3361497beb5049cd2581412b1c25bab35 100644 (file)
@@ -122,7 +122,7 @@ static void ide_test_start(const char *cmdline_fmt, ...)
 
 static void ide_test_quit(void)
 {
-    qtest_quit(global_qtest);
+    qtest_end();
 }
 
 static QPCIDevice *get_pci_device(uint16_t *bmdma_base)
index 437bda39f3f44400cd21a668eb5cdf5ba0066943..0f6aade0929faabae2094956618afa561ff3ee8e 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef LIBQTEST_H
 #define LIBQTEST_H
 
+#include <stddef.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <stdarg.h>
@@ -318,6 +319,17 @@ static inline QTestState *qtest_start(const char *args)
     return global_qtest;
 }
 
+/**
+ * qtest_end:
+ *
+ * Shut down the QEMU process started by qtest_start().
+ */
+static inline void qtest_end(void)
+{
+    qtest_quit(global_qtest);
+    global_qtest = NULL;
+}
+
 /**
  * qmp:
  * @fmt...: QMP message to send to qemu