tests/libqtest: Make qmp_assert_success() independent from global_qtest

The normal libqtest library functions should never depend on global_qtest.
Pass in the test state via parameter instead. And while we're at it,
also rename this function to qtest_qmp_assert_success() to make it clear
that it is part of libqtest.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190813093047.27948-7-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Thomas Huth 2019-07-23 21:22:39 +02:00
parent e5758de4e8
commit 6fc9f3d347
3 changed files with 12 additions and 8 deletions

View file

@ -1111,13 +1111,13 @@ QDict *qmp(const char *fmt, ...)
return response;
}
void qmp_assert_success(const char *fmt, ...)
void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
{
va_list ap;
QDict *response;
va_start(ap, fmt);
response = qtest_vqmp(global_qtest, fmt, ap);
response = qtest_vqmp(qts, fmt, ap);
va_end(ap);
g_assert(response);