tests/wayland-unit-tests: Clean up toplevel_apply_limits() signal handler

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1993>
This commit is contained in:
Jonas Ådahl 2021-09-07 10:34:04 +02:00 committed by Marge Bot
parent ed4e532690
commit 41e426af10

View File

@ -241,14 +241,17 @@ static void
toplevel_apply_limits (void) toplevel_apply_limits (void)
{ {
ApplyLimitData data = {}; ApplyLimitData data = {};
gulong handler_id;
data.loop = g_main_loop_new (NULL, FALSE); data.loop = g_main_loop_new (NULL, FALSE);
data.wayland_test_client = wayland_test_client_new ("xdg-apply-limits"); data.wayland_test_client = wayland_test_client_new ("xdg-apply-limits");
g_signal_connect (test_driver, "sync-point", G_CALLBACK (on_sync_point), &data); handler_id = g_signal_connect (test_driver, "sync-point",
G_CALLBACK (on_sync_point), &data);
g_main_loop_run (data.loop); g_main_loop_run (data.loop);
g_assert_cmpint (data.state, ==, APPLY_LIMIT_STATE_FINISH); g_assert_cmpint (data.state, ==, APPLY_LIMIT_STATE_FINISH);
wayland_test_client_finish (data.wayland_test_client); wayland_test_client_finish (data.wayland_test_client);
g_test_assert_expected_messages (); g_test_assert_expected_messages ();
g_signal_handler_disconnect (test_driver, handler_id);
} }
static void static void