Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73162 - in trunk/libs/locale: src/win32 test
From: artyomtnk_at_[hidden]
Date: 2011-07-17 05:10:37


Author: artyom
Date: 2011-07-17 05:10:33 EDT (Sun, 17 Jul 2011)
New Revision: 73162
URL: http://svn.boost.org/trac/boost/changeset/73162

Log:
Fixed formatting test for cases where some locales
are not installed on the system

Text files modified:
   trunk/libs/locale/src/win32/lcid.hpp | 3 ++-
   trunk/libs/locale/test/test_winapi_formatting.cpp | 5 +++++
   2 files changed, 7 insertions(+), 1 deletions(-)

Modified: trunk/libs/locale/src/win32/lcid.hpp
==============================================================================
--- trunk/libs/locale/src/win32/lcid.hpp (original)
+++ trunk/libs/locale/src/win32/lcid.hpp 2011-07-17 05:10:33 EDT (Sun, 17 Jul 2011)
@@ -9,12 +9,13 @@
 #define BOOST_LOCALE_IMPL_WIN32_LCID_HPP
 
 #include <string>
+#include <boost/locale/config.hpp>
 
 namespace boost {
     namespace locale {
         namespace impl_win {
 
- unsigned locale_to_lcid(std::string const &locale_name);
+ BOOST_LOCALE_DECL unsigned locale_to_lcid(std::string const &locale_name);
 
         } // impl_win
     } // locale

Modified: trunk/libs/locale/test/test_winapi_formatting.cpp
==============================================================================
--- trunk/libs/locale/test/test_winapi_formatting.cpp (original)
+++ trunk/libs/locale/test/test_winapi_formatting.cpp 2011-07-17 05:10:33 EDT (Sun, 17 Jul 2011)
@@ -22,6 +22,7 @@
 #include <iomanip>
 #include "test_locale.hpp"
 #include "test_locale_tools.hpp"
+#include "../src/win32/lcid.hpp"
 #include <iostream>
 
 #include <time.h>
@@ -238,6 +239,10 @@
         for(unsigned i=0;i<sizeof(names)/sizeof(names[9]);i++) {
             name = names[i];
             std::cout << "- " << name << " locale" << std::endl;
+ if(boost::locale::impl_win::locale_to_lcid(name) == 0) {
+ std::cout << "-- not supported, skipping" << std::endl;
+ continue;
+ }
             std::locale l1=gen(name);
             std::cout << "-- UTF-8" << std::endl;
             test_by_char<char>(l1,name,lcids[i]);


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