tests: Make all alarm filters use the same type

That'll make them more interchangable, would so ever be needed.

https://bugzilla.gnome.org/show_bug.cgi?id=790207
This commit is contained in:
Jonas Ådahl 2018-02-06 15:20:19 +08:00
parent 18c1d9672a
commit 76760bfd79
3 changed files with 19 additions and 15 deletions

View File

@ -50,12 +50,12 @@ test_case_alarm_filter (MetaX11Display *x11_display,
GHashTableIter iter; GHashTableIter iter;
gpointer key, value; gpointer key, value;
if (async_waiter_alarm_filter (test->waiter, x11_display, event)) if (async_waiter_alarm_filter (x11_display, event, test->waiter))
return TRUE; return TRUE;
g_hash_table_iter_init (&iter, test->clients); g_hash_table_iter_init (&iter, test->clients);
while (g_hash_table_iter_next (&iter, &key, &value)) while (g_hash_table_iter_next (&iter, &key, &value))
if (test_client_alarm_filter (value, x11_display, event)) if (test_client_alarm_filter (x11_display, event, value))
return TRUE; return TRUE;
return FALSE; return FALSE;

View File

@ -185,10 +185,12 @@ async_waiter_set_and_wait (AsyncWaiter *waiter)
} }
gboolean gboolean
async_waiter_alarm_filter (AsyncWaiter *waiter, async_waiter_alarm_filter (MetaX11Display *x11_display,
MetaX11Display *x11_display, XSyncAlarmNotifyEvent *event,
XSyncAlarmNotifyEvent *event) gpointer data)
{ {
AsyncWaiter *waiter = data;
if (event->alarm != waiter->alarm) if (event->alarm != waiter->alarm)
return FALSE; return FALSE;
@ -358,12 +360,14 @@ test_client_find_window (TestClient *client,
} }
gboolean gboolean
test_client_alarm_filter (TestClient *client, test_client_alarm_filter (MetaX11Display *x11_display,
MetaX11Display *x11_display, XSyncAlarmNotifyEvent *event,
XSyncAlarmNotifyEvent *event) gpointer data)
{ {
TestClient *client = data;
if (client->waiter) if (client->waiter)
return async_waiter_alarm_filter (client->waiter, x11_display, event); return async_waiter_alarm_filter (x11_display, event, client->waiter);
else else
return FALSE; return FALSE;
} }

View File

@ -43,9 +43,9 @@ typedef struct _TestClient TestClient;
void test_init (int *argc, void test_init (int *argc,
char ***argv); char ***argv);
gboolean async_waiter_alarm_filter (AsyncWaiter *waiter, gboolean async_waiter_alarm_filter (MetaX11Display *display,
MetaX11Display *x11_display, XSyncAlarmNotifyEvent *event,
XSyncAlarmNotifyEvent *event); gpointer data);
void async_waiter_set_and_wait (AsyncWaiter *waiter); void async_waiter_set_and_wait (AsyncWaiter *waiter);
@ -55,9 +55,9 @@ void async_waiter_destroy (AsyncWaiter *waiter);
char * test_client_get_id (TestClient *client); char * test_client_get_id (TestClient *client);
gboolean test_client_alarm_filter (TestClient *client, gboolean test_client_alarm_filter (MetaX11Display *x11_display,
MetaX11Display *x11_display, XSyncAlarmNotifyEvent *event,
XSyncAlarmNotifyEvent *event); gpointer data);
gboolean test_client_wait (TestClient *client, gboolean test_client_wait (TestClient *client,
GError **error); GError **error);