summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-31 14:57:43 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-11-01 21:23:35 -0500
commitc8432ae66899b55acf51deb86ef04b668197cd1e (patch)
treea2777584eee73bcd02c234c2aed91fae04c520ce /testsuite
parent642ad4e06f76bc840f1c640e41a1a1a8e3809a52 (diff)
downloadgtk+-c8432ae66899b55acf51deb86ef04b668197cd1e.tar.gz
testsuite: Improve coverage for seats
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gdk/seat.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/testsuite/gdk/seat.c b/testsuite/gdk/seat.c
index bd98236132..75fd9616fd 100644
--- a/testsuite/gdk/seat.c
+++ b/testsuite/gdk/seat.c
@@ -38,11 +38,12 @@ test_list_seats (void)
static void
test_default_seat (void)
{
- GdkDisplay *display;
+ GdkDisplay *display, *d;
GdkSeat *seat0;
GdkSeatCapabilities caps;
GdkDevice *pointer0, *keyboard0, *device;
- GList *physical_devices, *l;
+ GList *physical_devices, *tools, *l;
+ GdkDeviceTool *tool;
display = gdk_display_get_default ();
seat0 = gdk_display_get_default_seat (display);
@@ -55,9 +56,14 @@ test_default_seat (void)
g_assert_true (GDK_IS_SEAT (seat0));
+ g_assert_true (gdk_seat_get_display (seat0) == display);
+ g_object_get (seat0, "display", &d, NULL);
+ g_assert_true (display == d);
+ g_object_unref (d);
+
caps = gdk_seat_get_capabilities (seat0);
- g_assert (caps != GDK_SEAT_CAPABILITY_NONE);
+ g_assert_true (caps != GDK_SEAT_CAPABILITY_NONE);
pointer0 = gdk_seat_get_pointer (seat0);
physical_devices = gdk_seat_get_devices (seat0, GDK_SEAT_CAPABILITY_POINTER);
@@ -65,15 +71,15 @@ test_default_seat (void)
if ((caps & GDK_SEAT_CAPABILITY_POINTER) != 0)
{
g_assert_nonnull (pointer0);
- g_assert (gdk_device_get_display (pointer0) == display);
- g_assert (gdk_device_get_seat (pointer0) == seat0);
+ g_assert_true (gdk_device_get_display (pointer0) == display);
+ g_assert_true (gdk_device_get_seat (pointer0) == seat0);
g_assert_nonnull (physical_devices);
for (l = physical_devices; l; l = l->next)
{
device = l->data;
- g_assert (gdk_device_get_display (device) == display);
- g_assert (gdk_device_get_seat (device) == seat0);
+ g_assert_true (gdk_device_get_display (device) == display);
+ g_assert_true (gdk_device_get_seat (device) == seat0);
}
g_list_free (physical_devices);
}
@@ -89,17 +95,17 @@ test_default_seat (void)
if ((caps & GDK_SEAT_CAPABILITY_KEYBOARD) != 0)
{
g_assert_nonnull (keyboard0);
- g_assert (gdk_device_get_display (keyboard0) == display);
- g_assert (gdk_device_get_seat (keyboard0) == seat0);
- g_assert (gdk_device_get_source (keyboard0) == GDK_SOURCE_KEYBOARD);
+ g_assert_true (gdk_device_get_display (keyboard0) == display);
+ g_assert_true (gdk_device_get_seat (keyboard0) == seat0);
+ g_assert_true (gdk_device_get_source (keyboard0) == GDK_SOURCE_KEYBOARD);
g_assert_nonnull (physical_devices);
for (l = physical_devices; l; l = l->next)
{
device = l->data;
- g_assert (gdk_device_get_display (device) == display);
- g_assert (gdk_device_get_seat (device) == seat0);
- g_assert (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD);
+ g_assert_true (gdk_device_get_display (device) == display);
+ g_assert_true (gdk_device_get_seat (device) == seat0);
+ g_assert_true (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD);
}
g_list_free (physical_devices);
}
@@ -109,6 +115,13 @@ test_default_seat (void)
g_assert_null (physical_devices);
}
+ tools = gdk_seat_get_tools (seat0);
+ for (l = tools; l; l = l->next)
+ {
+ tool = l->data;
+ g_assert_true (GDK_IS_DEVICE_TOOL (tool));
+ }
+ g_list_free (tools);
}
int