Boost logo

Boost-Commit :

From: bdawes_at_[hidden]
Date: 2007-10-15 10:51:00


Author: bemandawes
Date: 2007-10-15 10:50:59 EDT (Mon, 15 Oct 2007)
New Revision: 40051
URL: http://svn.boost.org/trac/boost/changeset/40051

Log:
Suppress message tests on Windows unless the language is US English
Text files modified:
   trunk/libs/filesystem/test/operations_test.cpp | 15 +++++++++++----
   1 files changed, 11 insertions(+), 4 deletions(-)

Modified: trunk/libs/filesystem/test/operations_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/operations_test.cpp (original)
+++ trunk/libs/filesystem/test/operations_test.cpp 2007-10-15 10:50:59 EDT (Mon, 15 Oct 2007)
@@ -53,6 +53,10 @@
     using ::difftime; using ::time; using ::tm; using ::mktime; using ::system; }
 # endif
 
+#ifdef BOOST_WINDOWS_API
+# include <windows.h>
+#endif
+
 #define CHECK_EXCEPTION(Functor,Expect) throws_fs_error(Functor,Expect,__LINE__)
 
 namespace
@@ -62,6 +66,8 @@
   bool report_throws;
   fs::directory_iterator end_itr;
 
+ unsigned short language_id; // 0 except for Windows
+
   const char * temp_dir_name = "temp_fs_test_dir";
 
   void create_file( const fs::path & ph, const std::string & contents )
@@ -141,7 +147,7 @@
     {
       exception_thrown = true;
       if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" )
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
         BOOST_CHECK( std::strcmp( x.what(),
           "boost::filesystem::create_directory" ) == 0 );
     }
@@ -156,7 +162,7 @@
     {
       exception_thrown = true;
       if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" )
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
         BOOST_CHECK( std::strcmp( x.what(),
           "boost::filesystem::create_directory: The system cannot find the path specified" ) == 0 );
     }
@@ -171,7 +177,7 @@
     {
       exception_thrown = true;
       if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" )
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
       {
         bool ok ( std::strcmp( x.what(),
           "boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
@@ -193,7 +199,7 @@
     {
       exception_thrown = true;
       if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" )
+ if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
       {
         bool ok ( std::strcmp( x.what(),
           "boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
@@ -263,6 +269,7 @@
     platform = "POSIX";
 # elif defined( BOOST_WINDOWS_API )
     platform = "Windows";
+ language_id = ::GetUserDefaultUILanguage();
 # else
     platform = ( platform == "Win32" || platform == "Win64" || platform == "Cygwin" )
                ? "Windows"


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