From 4b453298912881209c6da1d4e6da01c8f86c282c Mon Sep 17 00:00:00 2001
From: Ken Mays <kmays2000@gmail.com>
Date: Fri, 24 Dec 2021 15:06:02 +0000
Subject: Fix Pango 1.50 unit tests for Haiku


diff --git a/tests/markup-parse.c b/tests/markup-parse.c
index b324867..fbe1440 100644
--- a/tests/markup-parse.c
+++ b/tests/markup-parse.c
@@ -261,7 +261,7 @@ main (int argc, char *argv[])
   const gchar *name;
   gchar *path;
 
-  g_setenv ("LC_ALL", "en_US.UTF8", TRUE);
+  g_setenv ("LC_ALL", "C", TRUE);
   setlocale (LC_ALL, "");
 
   /* allow to easily generate expected output for new test cases */
diff --git a/tests/test-font.c b/tests/test-font.c
index 2eef439..95e1b75 100644
--- a/tests/test-font.c
+++ b/tests/test-font.c
@@ -125,7 +125,7 @@ test_empty_variations (void)
   gchar *str;
 
   desc = pango_font_description_from_string ("Cantarell 14");
-  g_assert_nonnull (desc);
+  g_assert ((desc) !=NULL);
   g_assert_cmpint ((pango_font_description_get_set_fields (desc) & PANGO_FONT_MASK_VARIATIONS), ==, 0);
   g_assert_null (pango_font_description_get_variations (desc));
 
@@ -513,9 +513,9 @@ test_to_filename (void)
   desc = pango_font_description_from_string ("Futura Medium Italic 14");
   str = pango_font_description_to_filename (desc);
 
-  g_assert_nonnull (strstr (str, "futura"));
-  g_assert_nonnull (strstr (str, "medium"));
-  g_assert_nonnull (strstr (str, "italic"));
+  g_assert ((strstr (str, "futura")) !=NULL);
+  g_assert ((strstr (str, "medium")) !=NULL);
+  g_assert ((strstr (str, "italic")) !=NULL);
 
   g_free (str);
 
diff --git a/tests/testcontext.c b/tests/testcontext.c
index 9cd8d83..27f7b01 100644
--- a/tests/testcontext.c
+++ b/tests/testcontext.c
@@ -39,7 +39,7 @@ test_list_families (void)
   pango_context_set_font_map (context, pango_cairo_font_map_get_default ());
 
   pango_context_list_families (context, &families, &n_families);
-  g_assert_nonnull (families);
+  g_assert ((families) !=NULL);
   g_assert_cmpint (n_families, >, 0);
 
   g_free (families);
diff --git a/tests/testlanguage.c b/tests/testlanguage.c
index 35844d4..ed78296 100644
--- a/tests/testlanguage.c
+++ b/tests/testlanguage.c
@@ -43,7 +43,7 @@ test_language_env (void)
       g_setenv ("LANGUAGE", "fr", TRUE);
 
       preferred = pango_language_get_preferred ();
-      g_assert_nonnull (preferred);
+      g_assert ((preferred) !=NULL);
       g_assert_true (preferred[0] == pango_language_from_string ("de"));
       g_assert_true (preferred[1] == pango_language_from_string ("ja"));
       g_assert_null (preferred[2]);
diff --git a/tests/testmisc.c b/tests/testmisc.c
index 1aa9094..903bfab 100644
--- a/tests/testmisc.c
+++ b/tests/testmisc.c
@@ -307,7 +307,7 @@ test_version_info (void)
 
   g_assert_null (pango_version_check (1, 0, 0));
   g_assert_null (pango_version_check (PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR, PANGO_VERSION_MICRO));
-  g_assert_nonnull (pango_version_check (2, 0, 0));
+  g_assert ((pango_version_check (2, 0, 0)) !=NULL);
 
   str = g_strdup_printf ("%d.%d.%d", PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR, PANGO_VERSION_MICRO);
   g_assert_cmpstr (str, ==, pango_version_string ());
@@ -544,7 +544,7 @@ test_index_to_x (void)
 
           pango_layout_index_to_line_x (layout, index, FALSE, &l, NULL);
           line = pango_layout_get_line (layout, l);
-          g_assert_nonnull (line);
+          g_assert ((line) !=NULL);
 
           pango_layout_line_index_to_x (line, index, 0, &x);
           pango_layout_line_x_to_index (line, x, &index2, &trailing);
diff --git a/tests/testserialize.c b/tests/testserialize.c
index e480da3..d0ddf07 100644
--- a/tests/testserialize.c
+++ b/tests/testserialize.c
@@ -62,7 +62,7 @@ test_serialize_attr_list (void)
       char *str;
 
       attrs = pango_attr_list_from_string (valid[i]);
-      g_assert_nonnull (attrs);
+      g_assert ((attrs) !=NULL);
       str = pango_attr_list_to_string (attrs);
       g_assert_cmpstr (str, ==, roundtripped[i]);
       g_free (str);
@@ -113,7 +113,7 @@ test_serialize_tab_array (void)
       char *str;
 
       tabs = pango_tab_array_from_string (valid[i]);
-      g_assert_nonnull (tabs);
+      g_assert ((tabs) !=NULL);
       str = pango_tab_array_to_string (tabs);
       g_assert_cmpstr (str, ==, roundtripped[i]);
       g_free (str);
@@ -165,7 +165,7 @@ test_serialize_font (void)
 
   font2 = pango_font_deserialize (context, bytes, &error);
   g_assert_no_error (error);
-  g_assert_nonnull (font2);
+  g_assert ((font2) !=NULL);
 
   bytes2 = pango_font_serialize (font2);
   g_assert_true (g_bytes_equal (bytes2, bytes));
@@ -286,9 +286,9 @@ test_serialize_layout_valid (void)
   g_assert_no_error (error);
   g_assert_true (PANGO_IS_LAYOUT (layout));
   g_assert_cmpstr (pango_layout_get_text (layout), ==, "Some fun with layouts!");
-  g_assert_nonnull (pango_layout_get_attributes (layout));
+  g_assert ((pango_layout_get_attributes (layout)) !=NULL);
   tabs = pango_layout_get_tabs (layout);
-  g_assert_nonnull (tabs);
+  g_assert ((tabs) !=NULL);
   pango_tab_array_free (tabs);
   s = pango_font_description_to_string (pango_layout_get_font_description (layout));
   g_assert_cmpstr (s, ==, "Sans Bold 32");
@@ -421,7 +421,7 @@ test_serialize_layout_invalid (void)
        if (test[i].expected_error)
          g_assert_error (error, PANGO_LAYOUT_DESERIALIZE_ERROR, test[i].expected_error);
        else
-         g_assert_nonnull (error);
+         g_assert ((error) !=NULL);
        g_bytes_unref (bytes);
        g_clear_error (&error);
     }
-- 
2.30.2


From 24d1dce96a5fc997a520a8b3e6cf07668a4e6c91 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 12 Oct 2015 22:19:59 +0000
Subject: Haiku patch for testattributes unit test


diff --git a/tests/testattributes.c b/tests/testattributes.c
index cd70edc..a86b5bc 100644
--- a/tests/testattributes.c
+++ b/tests/testattributes.c
@@ -132,31 +132,31 @@ test_binding (PangoAttribute *attr)
   switch (attr_base[attr->klass->type])
     {
     case INT:
-      g_assert_nonnull (pango_attribute_as_int (attr));
+      g_assert ((pango_attribute_as_int (attr)) !=NULL);
       break;
     case LANGUAGE:
-      g_assert_nonnull (pango_attribute_as_language (attr));
+      g_assert ((pango_attribute_as_language (attr)) !=NULL);
       break;
     case STRING:
-      g_assert_nonnull (pango_attribute_as_string (attr));
+      g_assert ((pango_attribute_as_string (attr)) !=NULL);
       break;
     case SIZE:
-      g_assert_nonnull (pango_attribute_as_size (attr));
+      g_assert ((pango_attribute_as_size (attr)) !=NULL);
       break;
     case FONT_DESC:
-      g_assert_nonnull (pango_attribute_as_font_desc (attr));
+      g_assert ((pango_attribute_as_font_desc (attr)) !=NULL);
       break;
     case COLOR:
-      g_assert_nonnull (pango_attribute_as_color (attr));
+      g_assert ((pango_attribute_as_color (attr)) !=NULL);
       break;
     case SHAPE:
-      g_assert_nonnull (pango_attribute_as_shape (attr));
+      g_assert ((pango_attribute_as_shape (attr)) !=NULL);
       break;
     case FLOAT:
-      g_assert_nonnull (pango_attribute_as_float (attr));
+      g_assert ((pango_attribute_as_float (attr)) !=NULL);
       break;
     case FONT_FEATURES:
-      g_assert_nonnull (pango_attribute_as_font_features (attr));
+      g_assert ((pango_attribute_as_font_features (attr)) !=NULL);
       break;
     case INVALID:
     default:
@@ -765,7 +765,7 @@ test_list_filter (void)
   g_assert_null (out);
 
   out = pango_attr_list_filter (list, just_weight, NULL);
-  g_assert_nonnull (out);
+  g_assert ((out) !=NULL);
 
   assert_attr_list (list, "0 -1 size 10\n"
                           "10 20 stretch condensed\n");
@@ -852,11 +852,11 @@ test_iter_get (void)
   iter = pango_attr_list_get_iterator (list);
   pango_attr_iterator_next (iter);
   attr = pango_attr_iterator_get (iter, PANGO_ATTR_SIZE);
-  g_assert_nonnull (attr);
+  g_assert ((attr) !=NULL);
   g_assert_cmpuint (attr->start_index, ==, 0);
   g_assert_cmpuint (attr->end_index, ==, G_MAXUINT);
   attr = pango_attr_iterator_get (iter, PANGO_ATTR_STRETCH);
-  g_assert_nonnull (attr);
+  g_assert ((attr) !=NULL);
   g_assert_cmpuint (attr->start_index, ==, 10);
   g_assert_cmpuint (attr->end_index, ==, 30);
   attr = pango_attr_iterator_get (iter, PANGO_ATTR_WEIGHT);
@@ -910,7 +910,7 @@ test_iter_get_font (void)
   pango_attr_iterator_get_font (iter, desc, &lang, &attrs);
   desc2 = pango_font_description_from_string ("Times Condensed 10px");
   g_assert_true (pango_font_description_equal (desc, desc2));
-  g_assert_nonnull (lang);
+  g_assert ((lang) !=NULL);
   g_assert_cmpstr (pango_language_to_string (lang), ==, "ja-jp");
   g_assert_null (attrs);
   pango_font_description_free (desc);
-- 
2.30.2

