Boost logo

Boost-Commit :

From: bdawes_at_[hidden]
Date: 2007-09-29 15:40:24


Author: bemandawes
Date: 2007-09-29 15:40:23 EDT (Sat, 29 Sep 2007)
New Revision: 39609
URL: http://svn.boost.org/trac/boost/changeset/39609

Log:
Limit Windows expected message check to US English
Text files modified:
   trunk/libs/system/test/system_error_test.cpp | 15 ++++++++++-----
   1 files changed, 10 insertions(+), 5 deletions(-)

Modified: trunk/libs/system/test/system_error_test.cpp
==============================================================================
--- trunk/libs/system/test/system_error_test.cpp (original)
+++ trunk/libs/system/test/system_error_test.cpp 2007-09-29 15:40:23 EDT (Sat, 29 Sep 2007)
@@ -23,7 +23,7 @@
 #include <iostream>
 
 #ifdef BOOST_WINDOWS_API
-#include <winerror.h>
+#include <windows.h>
 #endif
 
 using boost::system::system_error;
@@ -41,10 +41,15 @@
     BOOST_CHECK( ex.code().value() == v );
     BOOST_CHECK( ex.code().category() == system_category );
 # ifdef BOOST_WINDOWS_API
- BOOST_CHECK( std::string( ex.what() ) == str );
- if ( std::string( ex.what() ) != str )
- std::cout << "expected \"" << str << "\", but what() returned \""
- << ex.what() << "\"\n";
+ LANGID language_id = ::GetUserDefaultUILanguage();
+ // std::cout << "GetUserDefaultUILanguage() returns " << language_id << '\n';
+ if ( language_id == 0x0409 ) // English (United States)
+ {
+ BOOST_CHECK( std::string( ex.what() ) == str );
+ if ( std::string( ex.what() ) != str )
+ std::cout << "expected \"" << str << "\", but what() returned \""
+ << ex.what() << "\"\n";
+ }
 # endif
   }
 


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