aboutsummaryrefslogtreecommitdiff
path: root/tests/libqtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r--tests/libqtest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 1f3b0cb1b1..5973a67652 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -450,8 +450,11 @@ static void qmp_response(void *opaque, QObject *obj, Error *err)
{
QMPResponseParser *qmp = opaque;
- if (!obj) {
- fprintf(stderr, "QMP JSON response parsing failed\n");
+ assert(!obj != !err);
+
+ if (err) {
+ error_prepend(&err, "QMP JSON response parsing failed: ");
+ error_report_err(err);
abort();
}