[glibmm/wip/dboles/ustring_format_fold_and_test] tests/glibmm_ustring_format: Fix non-English langs



commit 25846ce12a96c1bca51223b5c54f5e3d91063416
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed Oct 24 15:44:00 2018 +0100

    tests/glibmm_ustring_format: Fix non-English langs
    
    >>>
    when I tested it, the glibmm_ustring_format test failed. It failed
    because my chosen language in Ubuntu is Swedish. The expected "42.00"
    became "42,00". The decimal delimiter is a comma in most European
    languages. English is an exception.
    >>>
    
    https://gitlab.gnome.org/GNOME/glibmm/merge_requests/4#note_352960

 tests/glibmm_ustring_format/main.cc | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/tests/glibmm_ustring_format/main.cc b/tests/glibmm_ustring_format/main.cc
index 76a3efab..62a39ba6 100644
--- a/tests/glibmm_ustring_format/main.cc
+++ b/tests/glibmm_ustring_format/main.cc
@@ -6,6 +6,10 @@
 int
 main(int, char**)
 {
+  // Don't use the user's preferred locale. The decimal delimiter may be ','
+  // instead of the expected '.'.
+  Glib::set_init_to_users_preferred_locale(false);
+
   Glib::init();
 
   char carr[10] = "UÅūduotys";


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