From 6b89c517f94b9c3535558c1552bb9f9c4d4c8a26 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sat, 29 Sep 2007 19:40:23 +0000 Subject: [PATCH] Limit Windows expected message check to US English [SVN r39609] --- test/system_error_test.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/system_error_test.cpp b/test/system_error_test.cpp index 9158fb9..0a7211a 100644 --- a/test/system_error_test.cpp +++ b/test/system_error_test.cpp @@ -23,7 +23,7 @@ #include #ifdef BOOST_WINDOWS_API -#include +#include #endif using boost::system::system_error; @@ -41,10 +41,15 @@ namespace 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 }