[pango/tab-align: 2/8] test-layout: Make --fonts work as expected




commit 7a96294c33cc6f2a6e34b7f4f9d57c93754eff0c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Nov 28 21:52:47 2021 -0500

    test-layout: Make --fonts work as expected
    
    We want to use this without initializing tests.

 tests/test-layout.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 3ea3063d..1139e4fd 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -117,7 +117,7 @@ install_fonts (const char *dir)
 
   config = FcConfigCreate ();
 
-  path = g_test_build_filename (G_TEST_DIST, "fonts/fonts.conf", NULL);
+  path = g_build_filename (dir, "fonts.conf", NULL);
   g_file_get_contents (path, &conf, &len, NULL);
 
   if (!FcConfigParseAndLoadFromMemory (config, (const FcChar8 *) conf, TRUE))
@@ -161,7 +161,10 @@ main (int argc, char *argv[])
   g_option_context_free (option_context);
 
   if (opt_fonts)
-    install_fonts (opt_fonts);
+    {
+      install_fonts (opt_fonts);
+      g_free (opt_fonts);
+    }
 
   /* allow to easily generate expected output for new test cases */
   if (argc > 1 && argv[1][0] != '-')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]