aboutsummaryrefslogtreecommitdiff
path: root/tests/qdev-monitor-test.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-13 12:32:47 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-13 12:32:47 +0000
commitc8d146aecceb560664b112279ffddf6fe1db99db (patch)
treeee6ad1ab9701df1b9fb69be823b0a6ac9cd03933 /tests/qdev-monitor-test.c
parent0100f42550201f346cc0c20c1864f941509eb592 (diff)
parentf8762027a33e2f5d0915c56a904962b1481f75c1 (diff)
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM/QTest infrastructure fixes and device conversions * QTest cleanups and test cases for some virtio devices * QTest for sPAPR PCI host bridge * qom-test now tests reading all properties beneath /machine * QOM API leak fixes * QOM cleanups for SSI devices * QOM conversion of QEMUMachine * QOM realize for buses * sPAPR PCI bus name change # gpg: Signature made Thu 13 Mar 2014 00:22:40 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: (31 commits) libqtest: Fix possible deadlock in qtest initialization pci: Move VMState registration/unregistration to QOM realize/unrealize qdev: Realize buses on device realization qdev: Prepare realize/unrealize hooks for BusState tests: Add spapr-pci-host-bridge qtest virtio-serial-port: Convert to QOM realize/unrealize virtio-console: QOM cast cleanup for VirtConsole tests: Add virtio-console qtest tests: Add virtio-serial qtest tests: Add virtio-scsi qtest tests: Add virtio-rng qtest tests: Add virtio-balloon qtest tests: Add virtio-blk qtest tests: Clean up IndustryPack TPCI200 gcov paths qom-test: Test QOM properties hw/boards: Convert current_machine to MachineState vl: Use MachineClass instead of global QEMUMachine list hw/core: Introduce QEMU machine as QOM object qdev-monitor-test: Don't test human-readable error message qdev-monitor-test: Simplify using g_assert_cmpstr() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/qdev-monitor-test.c')
-rw-r--r--tests/qdev-monitor-test.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/qdev-monitor-test.c b/tests/qdev-monitor-test.c
index ba7f9cc238..e20ffd67a7 100644
--- a/tests/qdev-monitor-test.c
+++ b/tests/qdev-monitor-test.c
@@ -32,8 +32,7 @@ static void test_device_add(void)
"}}");
g_assert(response);
error = qdict_get_qdict(response, "error");
- g_assert(!strcmp(qdict_get_try_str(error, "desc") ?: "",
- "Device needs media, but drive is empty"));
+ g_assert_cmpstr(qdict_get_try_str(error, "class"), ==, "GenericError");
QDECREF(response);
/* Delete the drive */
@@ -42,7 +41,7 @@ static void test_device_add(void)
" \"command-line\": \"drive_del drive0\""
"}}");
g_assert(response);
- g_assert(!strcmp(qdict_get_try_str(response, "return") ?: "(null)", ""));
+ g_assert_cmpstr(qdict_get_try_str(response, "return"), ==, "");
QDECREF(response);
/* Try to re-add the drive. This fails with duplicate IDs if a leaked
@@ -53,8 +52,7 @@ static void test_device_add(void)
" \"command-line\": \"drive_add pci-addr=auto if=none,id=drive0\""
"}}");
g_assert(response);
- g_assert(!strcmp(qdict_get_try_str(response, "return") ?: "",
- "OK\r\n"));
+ g_assert_cmpstr(qdict_get_try_str(response, "return"), ==, "OK\r\n");
QDECREF(response);
qtest_end();