Refine ibus_get_language_name() test case
authorPeng Huang <shawn.p.huang@gmail.com>
Fri, 6 Jan 2012 20:17:32 +0000 (15:17 -0500)
committerPeng Huang <shawn.p.huang@gmail.com>
Tue, 21 Feb 2012 16:52:05 +0000 (11:52 -0500)
src/tests/ibus-util.c

index 9192223f53172a3413524ed01d603dc40ebb7143..7a6dd40518eabd7cfc6ccf75123ac58c6f104ebe 100644 (file)
@@ -1,12 +1,18 @@
 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <locale.h>
+
 #include "ibus.h"
 
 int main (int argc, char **argv)
 {
-    g_debug ("%s=%s", "eng", ibus_get_language_name ("eng"));
+    setlocale(LC_ALL, "en_US.Utf-8");
+
+    g_assert_cmpstr (ibus_get_language_name ("eng"), ==, "English");
+
     return 0;
 }