summaryrefslogtreecommitdiffstats
path: root/qemu/tests/drive_del-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/tests/drive_del-test.c')
-rw-r--r--qemu/tests/drive_del-test.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/qemu/tests/drive_del-test.c b/qemu/tests/drive_del-test.c
index 8951f6f61..fe03236f3 100644
--- a/qemu/tests/drive_del-test.c
+++ b/qemu/tests/drive_del-test.c
@@ -10,34 +10,24 @@
* See the COPYING.LIB file in the top-level directory.
*/
+#include "qemu/osdep.h"
#include <glib.h>
-#include <string.h>
#include "libqtest.h"
static void drive_add(void)
{
- QDict *response;
+ char *resp = hmp("drive_add 0 if=none,id=drive0");
- response = qmp("{'execute': 'human-monitor-command',"
- " 'arguments': {"
- " 'command-line': 'drive_add 0 if=none,id=drive0'"
- "}}");
- g_assert(response);
- g_assert_cmpstr(qdict_get_try_str(response, "return"), ==, "OK\r\n");
- QDECREF(response);
+ g_assert_cmpstr(resp, ==, "OK\r\n");
+ g_free(resp);
}
static void drive_del(void)
{
- QDict *response;
+ char *resp = hmp("drive_del drive0");
- response = qmp("{'execute': 'human-monitor-command',"
- " 'arguments': {"
- " 'command-line': 'drive_del drive0'"
- "}}");
- g_assert(response);
- g_assert_cmpstr(qdict_get_try_str(response, "return"), ==, "");
- QDECREF(response);
+ g_assert_cmpstr(resp, ==, "");
+ g_free(resp);
}
static void device_del(void)