mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
tests: add qmp_assert_error_class()
This helper will simplify a bunch of code checking for QMP errors and can be shared by various tests. Note that test-qga does check for error description as well, so don't replace the code there for now. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
b8e1f74b0a
commit
ebb4d82d88
5 changed files with 46 additions and 61 deletions
|
@ -1004,4 +1004,13 @@ void qtest_qmp_device_del(const char *id);
|
|||
*/
|
||||
bool qmp_rsp_is_err(QDict *rsp);
|
||||
|
||||
/**
|
||||
* qmp_assert_error_class:
|
||||
* @rsp: QMP response to check for error
|
||||
* @class: an error class
|
||||
*
|
||||
* Assert the response has the given error class and discard @rsp.
|
||||
*/
|
||||
void qmp_assert_error_class(QDict *rsp, const char *class);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue