[glib] tests/gvariant: Canonicalize to lower case to work on Illumos (OpenSolaris)



commit dc87c453fbdcf568990c0e7587fa4607f5e148b9
Author: Igor Pashev <pashev igor gmail com>
Date:   Fri Jul 19 18:23:29 2013 -0400

    tests/gvariant: Canonicalize to lower case to work on Illumos (OpenSolaris)
    
    Solaris libc gives lowercase strings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704585

 glib/tests/gvariant.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
index debd698..01e4600 100644
--- a/glib/tests/gvariant.c
+++ b/glib/tests/gvariant.c
@@ -3746,6 +3746,7 @@ test_parses (void)
     const gchar *tests[] = { "inf", "-inf", "nan" };
     GVariant *value;
     gchar *printed;
+    gchar *printed_down;
     gint i;
 
     for (i = 0; i < G_N_ELEMENTS (tests); i++)
@@ -3753,8 +3754,11 @@ test_parses (void)
         GError *error = NULL;
         value = g_variant_parse (NULL, tests[i], NULL, NULL, &error);
         printed = g_variant_print (value, FALSE);
-        g_assert (g_str_has_prefix (printed, tests[i]));
+        /* Canonicalize to lowercase; https://bugzilla.gnome.org/show_bug.cgi?id=704585 */
+        printed_down = g_ascii_strdown (printed, -1);
+        g_assert (g_str_has_prefix (printed_down, tests[i]));
         g_free (printed);
+        g_free (printed_down);
         g_variant_unref (value);
       }
   }


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