mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
testsuite: Allow renderers in misc test to fail
When GL or Vulkan is not supported, the test should not fail. It would be nicer if we could detect GL/Vulkan not being available otherwise, but I'm not aware of a better solution, in particular because rendeers might have stricter requirements than GTK itself. So this is the next best fix.
This commit is contained in:
parent
1b33e2c3b2
commit
d2930695ca
@ -155,7 +155,6 @@ test_renderer (GskRenderer *renderer)
|
||||
GdkDisplay *display;
|
||||
gboolean realized;
|
||||
GdkSurface *surface;
|
||||
gboolean res;
|
||||
GError *error = NULL;
|
||||
|
||||
g_assert (GSK_IS_RENDERER (renderer));
|
||||
@ -174,15 +173,19 @@ test_renderer (GskRenderer *renderer)
|
||||
|
||||
surface = gdk_surface_new_toplevel (display ? display : gdk_display_get_default ());
|
||||
|
||||
res = gsk_renderer_realize (renderer, surface, &error);
|
||||
|
||||
if (!gsk_renderer_realize (renderer, surface, &error))
|
||||
{
|
||||
g_test_skip_printf ("%s not available: %s", G_OBJECT_TYPE_NAME (renderer), error->message);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_assert_no_error (error);
|
||||
g_assert_true (res);
|
||||
|
||||
g_assert_true (gsk_renderer_is_realized (renderer));
|
||||
g_assert_true (gsk_renderer_get_surface (renderer) == surface);
|
||||
|
||||
gsk_renderer_unrealize (renderer);
|
||||
}
|
||||
|
||||
g_assert_false (gsk_renderer_is_realized (renderer));
|
||||
g_assert_null (gsk_renderer_get_surface (renderer));
|
||||
@ -191,6 +194,7 @@ test_renderer (GskRenderer *renderer)
|
||||
|
||||
if (display)
|
||||
gdk_display_close (display);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user