Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72816 - trunk/libs/regex/test/regress
From: john_at_[hidden]
Date: 2011-06-30 08:23:44


Author: johnmaddock
Date: 2011-06-30 08:23:43 EDT (Thu, 30 Jun 2011)
New Revision: 72816
URL: http://svn.boost.org/trac/boost/changeset/72816

Log:
Set the Unicode locale to a "know good", otherwise a few tests fail on Linux.
Text files modified:
   trunk/libs/regex/test/regress/main.cpp | 17 +++++++++++++++++
   1 files changed, 17 insertions(+), 0 deletions(-)

Modified: trunk/libs/regex/test/regress/main.cpp
==============================================================================
--- trunk/libs/regex/test/regress/main.cpp (original)
+++ trunk/libs/regex/test/regress/main.cpp 2011-06-30 08:23:43 EDT (Thu, 30 Jun 2011)
@@ -20,6 +20,10 @@
 #include "test_locale.hpp"
 #include <stdarg.h>
 
+#ifdef BOOST_HAS_ICU
+#include <unicode/uloc.h>
+#endif
+
 #ifdef TEST_THREADS
 #include <list>
 #include <boost/thread.hpp>
@@ -82,6 +86,19 @@
 
 int cpp_main(int /*argc*/, char * /*argv*/[])
 {
+#ifdef BOOST_HAS_ICU
+ //
+ // We need to set the default locale used by ICU,
+ // otherwise some of our tests using equivalence classes fail.
+ //
+ UErrorCode err = U_ZERO_ERROR;
+ uloc_setDefault("en", &err);
+ if(err != U_ZERO_ERROR)
+ {
+ std::cerr << "Unable to set the default ICU locale to \"en\"." << std::endl;
+ return -1;
+ }
+#endif
 #ifdef TEST_THREADS
    try{
       get_array_data(); // initialises data.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk