testsuite: Remove the stylecontext test
authorBenjamin Otte <otte@redhat.com>
Wed, 5 Feb 2020 01:59:11 +0000 (02:59 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 5 Feb 2020 03:03:43 +0000 (04:03 +0100)
Stylecontexts are on their way out and I'm removing API that the
testsuite was relying on, so remove the tests.

Put the useful parts of the tests elsewhere.

testsuite/css/parser/meson.build
testsuite/css/parser/selector-original.css [new file with mode: 0644]
testsuite/css/parser/selector-original.ref.css [new file with mode: 0644]
testsuite/gtk/meson.build
testsuite/gtk/stylecontext.c [deleted file]

index 607faab0bbff7a11ef5d8127d64e7a3115ee4343..b378a5e9f39ff5c268019e1ce504840e19f7dfe9 100644 (file)
@@ -406,6 +406,8 @@ test_data = [
   'radial.ref.css',
   'selector.css',
   'selector.ref.css',
+  'selector-original.css',
+  'selector-original.ref.css',
   'shadow.css',
   'shadow.ref.css',
   'shadow-ordering.css',
diff --git a/testsuite/css/parser/selector-original.css b/testsuite/css/parser/selector-original.css
new file mode 100644 (file)
index 0000000..a3569e2
--- /dev/null
@@ -0,0 +1,39 @@
+* {}
+E {}
+E F {}
+E > F {}
+E + F {}
+E#id {}
+#id {}
+tab:first-child {}
+tab:last-child {}
+tab:first-child {}
+tab:last-child {}
+tab:nth-child(even) {}
+tab:nth-child(odd) {}
+.some-class {}
+.some-class.another-class {}
+.some-class .another-class {}
+E * {}
+E .class {}
+E > .foo {}
+E > #id {}
+E:active {}
+E:hover {}
+E:selected {}
+E:disabled {}
+E:indeterminate {}
+E:focus {}
+E:active:hover {}
+* > .notebook tab:first-child .label:focus {}
+E, F {}
+E, F /* comment here */ {}
+E,/* comment here */ F {}
+E1.e1_2 #T3_4 {}
+E:first-child {}
+E:last-child {}
+E:first-child {}
+E:last-child {}
+E:nth-child(even) {}
+E:nth-child(odd) {}
+E:focus tab {}
diff --git a/testsuite/css/parser/selector-original.ref.css b/testsuite/css/parser/selector-original.ref.css
new file mode 100644 (file)
index 0000000..e69de29
index e721ceaf49eb5efa0c54d06110acc998dc0671cf..e232522841c25130f9f38d903c38b472c15dfe43 100644 (file)
@@ -54,7 +54,6 @@ tests = [
   ['slicelistmodel'],
   ['sortlistmodel'],
   ['spinbutton'],
-  ['stylecontext'],
   ['templates'],
   ['textbuffer'],
   ['textiter'],
diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c
deleted file mode 100644 (file)
index a4d4d44..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#include <gtk/gtk.h>
-
-typedef struct {
-  GtkStyleContext *context;
-  GtkCssProvider  *blue_provider;
-  GtkCssProvider  *red_provider;
-  GtkCssProvider  *green_provider;
-} PrioritiesFixture;
-
-static void
-test_parse_selectors (void)
-{
-  GtkCssProvider *provider;
-  gint i;
-  const gchar *valid[] = {
-    "* {}",
-    "E {}",
-    "E F {}",
-    "E > F {}",
-    "E + F {}",
-    "E#id {}",
-    "#id {}",
-    "tab:first-child {}",
-    "tab:last-child {}",
-    "tab:first-child {}",
-    "tab:last-child {}",
-    "tab:nth-child(even) {}",
-    "tab:nth-child(odd) {}",
-    ".some-class {}",
-    ".some-class.another-class {}",
-    ".some-class .another-class {}",
-    "E * {}",
-    "E .class {}",
-    "E > .foo {}",
-    "E > #id {}",
-    "E:active {}",
-    "E:hover {}",
-    "E:selected {}",
-    "E:disabled {}",
-    "E:indeterminate {}",
-    "E:focus {}",
-    "E:active:hover {}",
-    "* > .notebook tab:first-child .label:focus {}",
-    "E, F {}",
-    "E, F /* comment here */ {}",
-    "E,/* comment here */ F {}",
-    "E1.e1_2 #T3_4 {}",
-    "E:first-child {}",
-    "E:last-child {}",
-    "E:first-child {}",
-    "E:last-child {}",
-    "E:nth-child(even) {}",
-    "E:nth-child(odd) {}",
-    "E:focus tab {}",
-     NULL
-  };
-
-  for (i = 0; valid[i]; i++)
-    {
-      provider = gtk_css_provider_new ();
-      gtk_css_provider_load_from_data (provider, valid[i], -1);
-
-      g_object_unref (provider);
-   }
-}
-
-void
-test_widget_path_parent (void)
-{
-  GtkStyleContext *parent, *context;
-
-  parent = gtk_style_context_new ();
-  context = gtk_style_context_new ();
-
-  gtk_style_context_set_parent (context, parent);
-
-  g_object_unref (parent);
-  g_object_unref (context);
-}
-
-static void
-test_style_classes (void)
-{
-  GtkStyleContext *context;
-  GList *classes;
-
-  context = gtk_style_context_new ();
-
-  classes = gtk_style_context_list_classes (context);
-  g_assert_null (classes);
-
-  gtk_style_context_add_class (context, "A");
-
-  classes = gtk_style_context_list_classes (context);
-  g_assert (classes);
-  g_assert_null (classes->next);
-  g_assert_cmpstr (classes->data, ==, "A");
-  g_list_free (classes);
-
-  gtk_style_context_add_class (context, "B");
-
-  classes = gtk_style_context_list_classes (context);
-  g_assert (classes);
-  g_assert_cmpstr (classes->data, ==, "A");
-  g_assert (classes->next);
-  g_assert_cmpstr (classes->next->data, ==, "B");
-  g_assert_null (classes->next->next);
-  g_list_free (classes);
-
-  gtk_style_context_remove_class (context, "A");
-
-  classes = gtk_style_context_list_classes (context);
-  g_assert (classes);
-  g_assert_null (classes->next);
-  g_assert_cmpstr (classes->data, ==, "B");
-  g_list_free (classes);
-
-  g_object_unref (context);
-}
-
-int
-main (int argc, char *argv[])
-{
-  gtk_init ();
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/style/parse/selectors", test_parse_selectors);
-  g_test_add_func ("/style/widget-path-parent", test_widget_path_parent);
-  g_test_add_func ("/style/classes", test_style_classes);
-
-  return g_test_run ();
-}