forked from boostorg/system
Limit Windows expected message check to US English
[SVN r39609]
This commit is contained in:
@ -23,7 +23,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#ifdef BOOST_WINDOWS_API
|
#ifdef BOOST_WINDOWS_API
|
||||||
#include <winerror.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using boost::system::system_error;
|
using boost::system::system_error;
|
||||||
@ -41,10 +41,15 @@ namespace
|
|||||||
BOOST_CHECK( ex.code().value() == v );
|
BOOST_CHECK( ex.code().value() == v );
|
||||||
BOOST_CHECK( ex.code().category() == system_category );
|
BOOST_CHECK( ex.code().category() == system_category );
|
||||||
# ifdef BOOST_WINDOWS_API
|
# ifdef BOOST_WINDOWS_API
|
||||||
BOOST_CHECK( std::string( ex.what() ) == str );
|
LANGID language_id = ::GetUserDefaultUILanguage();
|
||||||
if ( std::string( ex.what() ) != str )
|
// std::cout << "GetUserDefaultUILanguage() returns " << language_id << '\n';
|
||||||
std::cout << "expected \"" << str << "\", but what() returned \""
|
if ( language_id == 0x0409 ) // English (United States)
|
||||||
<< ex.what() << "\"\n";
|
{
|
||||||
|
BOOST_CHECK( std::string( ex.what() ) == str );
|
||||||
|
if ( std::string( ex.what() ) != str )
|
||||||
|
std::cout << "expected \"" << str << "\", but what() returned \""
|
||||||
|
<< ex.what() << "\"\n";
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user