qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

tests/test-qmp-event: Check event is actually emitted

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200317115459.31821-11-armbru@redhat.com>

+6 -1
+6 -1
tests/test-qmp-event.c
··· 26 26 27 27 typedef struct TestEventData { 28 28 QDict *expect; 29 + bool emitted; 29 30 } TestEventData; 30 31 31 32 TestEventData *test_event_data; ··· 52 53 qdict_del(d, "timestamp"); 53 54 54 55 g_assert(qobject_is_equal(QOBJECT(d), QOBJECT(test_event_data->expect))); 55 - 56 + test_event_data->emitted = true; 56 57 } 57 58 58 59 static void event_prepare(TestEventData *data, ··· 87 88 { 88 89 data->expect = qdict_from_jsonf_nofail("{ 'event': 'EVENT_A' }"); 89 90 qapi_event_send_event_a(); 91 + g_assert(data->emitted); 90 92 qobject_unref(data->expect); 91 93 } 92 94 ··· 95 97 { 96 98 data->expect = qdict_from_jsonf_nofail("{ 'event': 'EVENT_B' }"); 97 99 qapi_event_send_event_b(); 100 + g_assert(data->emitted); 98 101 qobject_unref(data->expect); 99 102 } 100 103 ··· 107 110 "{ 'event': 'EVENT_C', 'data': {" 108 111 " 'a': 1, 'b': { 'integer': 2, 'string': 'test1' }, 'c': 'test2' } }"); 109 112 qapi_event_send_event_c(true, 1, true, &b, "test2"); 113 + g_assert(data->emitted); 110 114 qobject_unref(data->expect); 111 115 } 112 116 ··· 132 136 " 'string': 'test2', 'enum2': 'value2' }," 133 137 " 'b': 'test3', 'enum3': 'value3' } }"); 134 138 qapi_event_send_event_d(&a, "test3", false, NULL, true, ENUM_ONE_VALUE3); 139 + g_assert(data->emitted); 135 140 qobject_unref(data->expect); 136 141 } 137 142