|
@@ -159,6 +159,26 @@ static void test_event_deprecated(TestEventData *data, const void *unused)
|
|
|
qobject_unref(data->expect);
|
|
|
}
|
|
|
|
|
|
+static void test_event_deprecated_data(TestEventData *data, const void *unused)
|
|
|
+{
|
|
|
+ memset(&compat_policy, 0, sizeof(compat_policy));
|
|
|
+
|
|
|
+ data->expect = qdict_from_jsonf_nofail("{ 'event': 'TEST-EVENT-FEATURES0',"
|
|
|
+ " 'data': { 'foo': 42 } }");
|
|
|
+ qapi_event_send_test_event_features0(42);
|
|
|
+ g_assert(data->emitted);
|
|
|
+
|
|
|
+ qobject_unref(data->expect);
|
|
|
+
|
|
|
+ compat_policy.has_deprecated_output = true;
|
|
|
+ compat_policy.deprecated_output = COMPAT_POLICY_OUTPUT_HIDE;
|
|
|
+ data->expect = qdict_from_jsonf_nofail("{ 'event': 'TEST-EVENT-FEATURES0' }");
|
|
|
+ qapi_event_send_test_event_features0(42);
|
|
|
+ g_assert(data->emitted);
|
|
|
+
|
|
|
+ qobject_unref(data->expect);
|
|
|
+}
|
|
|
+
|
|
|
int main(int argc, char **argv)
|
|
|
{
|
|
|
g_test_init(&argc, &argv, NULL);
|
|
@@ -168,6 +188,7 @@ int main(int argc, char **argv)
|
|
|
event_test_add("/event/event_c", test_event_c);
|
|
|
event_test_add("/event/event_d", test_event_d);
|
|
|
event_test_add("/event/deprecated", test_event_deprecated);
|
|
|
+ event_test_add("/event/deprecated_data", test_event_deprecated_data);
|
|
|
g_test_run();
|
|
|
|
|
|
return 0;
|