testsuite: Remove cursor tests
authorBenjamin Otte <otte@redhat.com>
Fri, 3 Nov 2017 22:18:56 +0000 (23:18 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 3 Nov 2017 23:07:13 +0000 (00:07 +0100)
Cursors always exist now, it does not make sense to test that their
creation fails anymore.

testsuite/gdk/cursor.c [deleted file]
testsuite/gdk/meson.build
testsuite/gtk/check-cursor-names.c [deleted file]
testsuite/gtk/meson.build

diff --git a/testsuite/gdk/cursor.c b/testsuite/gdk/cursor.c
deleted file mode 100644 (file)
index ec2997a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#include <gtk/gtk.h>
-
-static char *cursor_names[] = {
-  "none",
-  "default",
-  "help",
-  "pointer",
-  "context-menu",
-  "progress",
-  "wait",
-  "cell",
-  "crosshair",
-  "text",
-  "vertical-text",
-  "alias",
-  "copy",
-  "no-drop",
-  "move",
-  "not-allowed",
-  "grab",
-  "grabbing",
-  "all-scroll",
-  "col-resize",
-  "row-resize",
-  "n-resize",
-  "e-resize",
-  "s-resize",
-  "w-resize",
-  "ne-resize",
-  "nw-resize",
-  "sw-resize",
-  "se-resize",
-  "ew-resize",
-  "ns-resize",
-  "nesw-resize",
-  "nwse-resize",
-  "zoom-in",
-  "zoom-out",
-  "dnd-ask",
-};
-
-static void
-test_cursor_existence (gconstpointer name)
-{
-  GdkDisplay *display;
-  GdkCursor *cursor;
-
-  display = gdk_display_get_default ();
-  cursor = gdk_cursor_new_from_name (display, name);
-  g_assert (cursor != NULL);
-  g_object_unref (cursor);
-}
-
-static void
-test_cursor_nonexistence_subprocess (void)
-{
-  GdkDisplay *display;
-  GdkCursor *cursor;
-
-  display = gdk_display_get_default ();
-  cursor = gdk_cursor_new_from_name (display, "non-existing-cursor");
-  g_assert (cursor == NULL);
-}
-
-static void
-test_cursor_nonexistence (void)
-{
-  g_test_trap_subprocess ("/non-existing-cursors/subprocess/non-existing-cursor", 0, 0);
-  g_test_trap_assert_passed ();
-}
-
-int
-main (int argc, char *argv[])
-{
-  guint i;
-  char *test_name;
-
-  g_test_init (&argc, &argv, NULL);
-  gtk_init ();
-
-  for (i = 0; i < G_N_ELEMENTS (cursor_names); i++)
-    {
-      test_name = g_strdup_printf ("/standard-cursor-names/%s", cursor_names[i]);
-      g_test_add_data_func (test_name, cursor_names[i], test_cursor_existence);
-      g_free (test_name);
-    }
-
-  g_test_add_func ("/non-existing-cursors/subprocess/non-existing-cursor", test_cursor_nonexistence_subprocess);
-  g_test_add_func ("/non-existing-cursors/non-existing-cursor", test_cursor_nonexistence);
-
-  return g_test_run();
-}
index df60341f85d6672736e32b20be67c0eca6a6a5cc..227107b6bd2afacbb80284bc84e308f2a3f56b16 100644 (file)
@@ -3,7 +3,6 @@ testdatadir = join_paths(installed_test_datadir, 'gdk')
 
 tests = [
   'cairo',
-  'cursor',
   'display',
   'encoding',
   'keysyms',
diff --git a/testsuite/gtk/check-cursor-names.c b/testsuite/gtk/check-cursor-names.c
deleted file mode 100644 (file)
index 9d7b5cf..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <gtk/gtk.h>
-
-static char *cursor_names[] = {
-  /*** resize cursors that we're using for csd, from gtkwindow.c ***/
-  "nw-resize",
-  "n-resize",
-  "ne-resize",
-  "w-resize",
-  "e-resize",
-  "sw-resize",
-  "s-resize",
-  "se-resize",
-
-  /*** resize cursors, from gtkpaned.c ***/
-  "col-resize",
-  "row-resize",
-
-  /*** dnd cursors, from gtkdnd.c ***/
-  "dnd-ask",
-  "copy",
-  "move",
-  "alias",
-  "no-drop",
-
-  "none",      /* used e.g. in gtkentry.c */
-  "pointer",   /* used e.g. in gtklinkbutton.c */
-  "text",      /* used e.g. in gtkentry.c */
-  "crosshair", /* used e.g. in gtkcolorplane.c */
-  "progress",  /* used e.g. in gtkfilechooserwidget.c */
-};
-
-static void
-test_cursor_existence (gconstpointer name)
-{
-  GdkDisplay *display;
-  GdkCursor *cursor;
-
-  display = gdk_display_get_default ();
-  cursor = gdk_cursor_new_from_name (display, name);
-  g_assert (cursor != NULL);
-  g_object_unref (cursor);
-}
-
-int
-main (int argc, char *argv[])
-{
-  guint i;
-  char *test_name;
-  char *theme;
-
-  gtk_test_init (&argc, &argv);
-
-  g_object_get (gtk_settings_get_default (), "gtk-cursor-theme-name", &theme, NULL);
-  g_test_message ("Testing cursor theme: %s", theme);
-  g_free (theme);
-
-  for (i = 0; i < G_N_ELEMENTS (cursor_names); i++)
-    {
-      test_name = g_strdup_printf ("/check-cursor-names/%s", cursor_names[i]);
-      g_test_add_data_func (test_name, cursor_names[i], test_cursor_existence);
-      g_free (test_name);
-    }
-
-  return g_test_run();
-}
index 2778c63b9f53123271abc78b3cc2f81f4b4c7f47..bce3b4de926ecf0005ee574be6b1bc6d84e8c193 100644 (file)
@@ -16,7 +16,6 @@ tests = [
   ['builderparser'],
   ['cellarea'],
   ['check-icon-names'],
-  ['check-cursor-names'],
   ['clipboard'],
   ['cssprovider'],
   ['entry'],