[gtk/debug-envvars-cleanup] Don't use __COUNTER__



commit 293fd91b4f0ac36aff4dd00cb06743899405af11
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 23 17:53:23 2022 -0400

    Don't use __COUNTER__
    
    I am seeing an off-by-one difference between gcc and clang.
    Not worth the trouble.

 testsuite/gtk/icontheme.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/testsuite/gtk/icontheme.c b/testsuite/gtk/icontheme.c
index 0a546ce79a..31c9b1cb40 100644
--- a/testsuite/gtk/icontheme.c
+++ b/testsuite/gtk/icontheme.c
@@ -191,13 +191,7 @@ make_lookup_pattern (const char *first_name,
   return g_string_free (s, FALSE);
 }
 
-#define CONCAT_EXPANDED(a,b) CONCAT_EXPANDED2(a,b)
-#define CONCAT_EXPANDED2(a,b) a##b
-
-#define LOOKUP_ORDER_TEST(icon_name,size,direction,flags,fallback,...)           \
-  
LOOKUP_ORDER_TEST1(CONCAT_EXPANDED(test_lookup_order,__COUNTER__),icon_name,size,direction,flags,fallback,__VA_ARGS__)
-
-#define LOOKUP_ORDER_TEST1(func,icon_name,size,direction,flags,fallback,...)           \
+#define LOOKUP_ORDER_TEST(func,icon_name,size,direction,flags,fallback,...)           \
 static void                                                                       \
 func (void)                                           \
 {                                                                                 \
@@ -217,8 +211,7 @@ func (void)                                           \
   g_free (pattern);                                                               \
 }
 
-
-LOOKUP_ORDER_TEST ("foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order0, "foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
                    "foo-bar-baz",
                    "foo-bar",
                    "foo",
@@ -226,7 +219,7 @@ LOOKUP_ORDER_TEST ("foo-bar-baz", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
                    "foo-bar-symbolic",
                    "foo-symbolic")
 
-LOOKUP_ORDER_TEST ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order1, "foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, TRUE,
                    "foo-bar-baz-rtl",
                    "foo-bar-baz",
                    "foo-bar-rtl",
@@ -240,11 +233,11 @@ LOOKUP_ORDER_TEST ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, TRUE,
                    "foo-symbolic-rtl",
                    "foo-symbolic")
 
-LOOKUP_ORDER_TEST ("foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, FALSE,
+LOOKUP_ORDER_TEST (test_lookup_order2, "foo-bar-baz", 16, GTK_TEXT_DIR_RTL, 0, FALSE,
                    "foo-bar-baz-rtl",
                    "foo-bar-baz")
 
-LOOKUP_ORDER_TEST ("foo-bar-baz-symbolic", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order3, "foo-bar-baz-symbolic", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
                    "foo-bar-baz-symbolic",
                    "foo-bar-symbolic",
                    "foo-symbolic",
@@ -252,7 +245,7 @@ LOOKUP_ORDER_TEST ("foo-bar-baz-symbolic", 16, GTK_TEXT_DIR_NONE, 0, TRUE,
                    "foo-bar",
                    "foo")
 
-LOOKUP_ORDER_TEST ("bla-bla", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order4, "bla-bla", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, 
TRUE,
                    "bla-bla-symbolic",
                    "bla-symbolic",
                    "bla-bla-symbolic", /* awkward */
@@ -260,7 +253,7 @@ LOOKUP_ORDER_TEST ("bla-bla", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBO
                    "bla-bla",
                    "bla")
 
-LOOKUP_ORDER_TEST ("bla-bla-symbolic", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order5, "bla-bla-symbolic", 16, GTK_TEXT_DIR_NONE, 
GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
                    "bla-bla-symbolic",
                    "bla-symbolic",
                    "bla-bla-symbolic", /* awkward */
@@ -268,7 +261,7 @@ LOOKUP_ORDER_TEST ("bla-bla-symbolic", 16, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FO
                    "bla-bla",
                    "bla")
 
-LOOKUP_ORDER_TEST ("bar-baz", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order6, "bar-baz", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
                    "bar-baz-symbolic-rtl",
                    "bar-baz-symbolic",
                    "bar-symbolic-rtl",
@@ -282,7 +275,7 @@ LOOKUP_ORDER_TEST ("bar-baz", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOL
                    "bar-rtl",
                    "bar")
 
-LOOKUP_ORDER_TEST ("bar-baz-symbolic", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order7, "bar-baz-symbolic", 16, GTK_TEXT_DIR_RTL, 
GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
                    "bar-baz-symbolic-rtl",
                    "bar-baz-symbolic",
                    "bar-symbolic-rtl",
@@ -296,7 +289,7 @@ LOOKUP_ORDER_TEST ("bar-baz-symbolic", 16, GTK_TEXT_DIR_RTL, GTK_ICON_LOOKUP_FOR
                    "bar-rtl",
                    "bar")
 
-LOOKUP_ORDER_TEST ("bar-baz", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order8, "bar-baz", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
                    "bar-baz-symbolic-ltr",
                    "bar-baz-symbolic",
                    "bar-symbolic-ltr",
@@ -310,7 +303,7 @@ LOOKUP_ORDER_TEST ("bar-baz", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOL
                    "bar-ltr",
                    "bar")
 
-LOOKUP_ORDER_TEST ("bar-baz-symbolic", 16, GTK_TEXT_DIR_LTR, GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
+LOOKUP_ORDER_TEST (test_lookup_order9, "bar-baz-symbolic", 16, GTK_TEXT_DIR_LTR, 
GTK_ICON_LOOKUP_FORCE_SYMBOLIC, TRUE,
                    "bar-baz-symbolic-ltr",
                    "bar-baz-symbolic",
                    "bar-symbolic-ltr",
@@ -784,7 +777,7 @@ main (int argc, char *argv[])
   g_test_add_func ("/icontheme/list", test_list);
   g_test_add_func ("/icontheme/inherit", test_inherit);
   g_test_add_func ("/icontheme/nonsquare-symbolic", test_nonsquare_symbolic);
-  //g_test_add_func ("/icontheme/lookup-order", test_lookup_order);
+  g_test_add_func ("/icontheme/lookup_order0", test_lookup_order0);
   g_test_add_func ("/icontheme/lookup_order1", test_lookup_order1);
   g_test_add_func ("/icontheme/lookup_order2", test_lookup_order2);
   g_test_add_func ("/icontheme/lookup_order3", test_lookup_order3);
@@ -794,7 +787,6 @@ main (int argc, char *argv[])
   g_test_add_func ("/icontheme/lookup_order7", test_lookup_order7);
   g_test_add_func ("/icontheme/lookup_order8", test_lookup_order8);
   g_test_add_func ("/icontheme/lookup_order9", test_lookup_order9);
-  g_test_add_func ("/icontheme/lookup_order10", test_lookup_order10);
 
   return g_test_run();
 }


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