Make the new compose table test work
authorMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2023 15:48:13 +0000 (11:48 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2023 15:48:13 +0000 (11:48 -0400)
This just copies what we do already for other
tests that check parser failures.

testsuite/gtk/composetable.c

index 8a552fc6e08f9b0319ec3fb6eb0e25b1a4fc171a..0ee3bac1fb77ca1024db5cb894722e55035fe6a6 100644 (file)
@@ -408,8 +408,23 @@ match_algorithmic (void)
 static void
 compose_table_large (void)
 {
-  char *file = g_build_filename (g_test_get_dir (G_TEST_DIST), "compose", "large", NULL);
-  gtk_compose_table_parse (file, NULL);
+  if (g_test_subprocess ())
+    {
+      char *file;
+      GtkComposeTable *table;
+
+      file = g_test_build_filename (G_TEST_DIST, "compose", "large", NULL);
+
+      table = gtk_compose_table_parse (file, NULL);
+      g_assert_nonnull (table);
+      g_free (file);
+
+      return;
+    }
+
+  g_test_trap_subprocess (NULL, 0, 0);
+  g_test_trap_assert_stderr ("*can't handle compose tables this large*");
+  g_test_trap_assert_failed ();
 }
 
 int