]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Replace test for bug 743877 using g_get_filename_charsets()
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 18 Mar 2015 18:57:35 +0000 (19:57 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 18 Mar 2015 19:00:33 +0000 (20:00 +0100)
Preserve compatibility with glib >= 2.24

tests/methods/bug743877.vala
vapi/glib-2.0.vapi

index 9049724b834a5247fd9397c7d9a2de99ccfe9a66..127aaf060d00f293ffd56a41f6e70ea36a33fc2f 100644 (file)
@@ -1,11 +1,9 @@
 void main () {
        Intl.setlocale ();
 
-       string input_str = "Álvaro";
-       string[] alternates;
-       var tokens = input_str.tokenize_and_fold (null, out alternates);
+       string[] charsets;
+       var is_utf8 = GLib.get_filename_charsets (out charsets);
 
-       assert ("álvaro" in tokens);
-       assert ("alvaro" in alternates);
+       assert (charsets.length != -1);
 }
 
index d0c55d78e87814a59d5930e795131b976c6db209..aa4690965059be23bf9906183e7d0a7ffd4e1cf0 100644 (file)
@@ -2266,6 +2266,7 @@ namespace GLib {
 
        public static string convert (string str, ssize_t len, string to_codeset, string from_codeset, out size_t bytes_read = null, out size_t bytes_written = null) throws ConvertError;
        public static bool get_charset (out unowned string charset);
+       public static bool get_filename_charsets ([CCode (array_length = false, array_null_terminated = true)] out string[] charsets);
 
        [SimpleType]
        public struct IConv {