[mutter] tests: Make all alarm filters use the same type
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tests: Make all alarm filters use the same type
- Date: Wed, 14 Nov 2018 21:37:28 +0000 (UTC)
commit 76760bfd79b7d3f6305a7b6db992bc31dc08cff8
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Feb 6 15:20:19 2018 +0800
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
src/tests/test-runner.c | 4 ++--
src/tests/test-utils.c | 18 +++++++++++-------
src/tests/test-utils.h | 12 ++++++------
3 files changed, 19 insertions(+), 15 deletions(-)
---
diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c
index f5f476b8a..f90d9f928 100644
--- a/src/tests/test-runner.c
+++ b/src/tests/test-runner.c
@@ -50,12 +50,12 @@ test_case_alarm_filter (MetaX11Display *x11_display,
GHashTableIter iter;
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;
g_hash_table_iter_init (&iter, test->clients);
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 FALSE;
diff --git a/src/tests/test-utils.c b/src/tests/test-utils.c
index b752bf94c..980b20acd 100644
--- a/src/tests/test-utils.c
+++ b/src/tests/test-utils.c
@@ -185,10 +185,12 @@ async_waiter_set_and_wait (AsyncWaiter *waiter)
}
gboolean
-async_waiter_alarm_filter (AsyncWaiter *waiter,
- MetaX11Display *x11_display,
- XSyncAlarmNotifyEvent *event)
+async_waiter_alarm_filter (MetaX11Display *x11_display,
+ XSyncAlarmNotifyEvent *event,
+ gpointer data)
{
+ AsyncWaiter *waiter = data;
+
if (event->alarm != waiter->alarm)
return FALSE;
@@ -358,12 +360,14 @@ test_client_find_window (TestClient *client,
}
gboolean
-test_client_alarm_filter (TestClient *client,
- MetaX11Display *x11_display,
- XSyncAlarmNotifyEvent *event)
+test_client_alarm_filter (MetaX11Display *x11_display,
+ XSyncAlarmNotifyEvent *event,
+ gpointer data)
{
+ TestClient *client = data;
+
if (client->waiter)
- return async_waiter_alarm_filter (client->waiter, x11_display, event);
+ return async_waiter_alarm_filter (x11_display, event, client->waiter);
else
return FALSE;
}
diff --git a/src/tests/test-utils.h b/src/tests/test-utils.h
index 5dfec8367..e11f25353 100644
--- a/src/tests/test-utils.h
+++ b/src/tests/test-utils.h
@@ -43,9 +43,9 @@ typedef struct _TestClient TestClient;
void test_init (int *argc,
char ***argv);
-gboolean async_waiter_alarm_filter (AsyncWaiter *waiter,
- MetaX11Display *x11_display,
- XSyncAlarmNotifyEvent *event);
+gboolean async_waiter_alarm_filter (MetaX11Display *display,
+ XSyncAlarmNotifyEvent *event,
+ gpointer data);
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);
-gboolean test_client_alarm_filter (TestClient *client,
- MetaX11Display *x11_display,
- XSyncAlarmNotifyEvent *event);
+gboolean test_client_alarm_filter (MetaX11Display *x11_display,
+ XSyncAlarmNotifyEvent *event,
+ gpointer data);
gboolean test_client_wait (TestClient *client,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]