diff options
Diffstat (limited to 'tests/qtest/qmp-cmd-test.c')
-rw-r--r-- | tests/qtest/qmp-cmd-test.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c index f34e688..3109a9f 100644 --- a/tests/qtest/qmp-cmd-test.c +++ b/tests/qtest/qmp-cmd-test.c @@ -210,19 +210,19 @@ static void test_object_add_failure_modes(void) resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':" " {'qom-type': 'memory-backend-ram', 'id': 'ram1' } }"); g_assert_nonnull(resp); - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); /* attempt to create an object without qom-type */ resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':" " {'id': 'ram1' } }"); g_assert_nonnull(resp); - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); /* attempt to delete an object that does not exist */ resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':" " {'id': 'ram1' } }"); g_assert_nonnull(resp); - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); /* attempt to create 2 objects with duplicate id */ resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':" @@ -236,7 +236,7 @@ static void test_object_add_failure_modes(void) " {'qom-type': 'memory-backend-ram', 'id': 'ram1'," " 'props': {'size': 1048576 } } }"); g_assert_nonnull(resp); - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); /* delete ram1 object */ resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':" @@ -251,7 +251,7 @@ static void test_object_add_failure_modes(void) " 'props': {'size': '1048576' } } }"); g_assert_nonnull(resp); /* now do it right */ - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':" " {'qom-type': 'memory-backend-ram', 'id': 'ram1'," @@ -272,7 +272,7 @@ static void test_object_add_failure_modes(void) " {'qom-type': 'memory-backend-ram'," " 'props': {'size': 1048576 } } }"); g_assert_nonnull(resp); - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); /* now do it right */ resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':" @@ -294,7 +294,7 @@ static void test_object_add_failure_modes(void) " {'qom-type': 'memory-backend-ram', 'id': 'ram1'," " 'props': {'sized': 1048576 } } }"); g_assert_nonnull(resp); - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); /* now do it right */ resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':" @@ -321,7 +321,7 @@ static void test_object_add_failure_modes(void) resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':" " {'id': 'ram1' } }"); g_assert_nonnull(resp); - qmp_assert_error_class(resp, "GenericError"); + qmp_expect_error_and_unref(resp, "GenericError"); qtest_quit(qts); } |