|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73119 - trunk/libs/locale/test
From: artyomtnk_at_[hidden]
Date: 2011-07-15 08:48:41
Author: artyom
Date: 2011-07-15 08:48:40 EDT (Fri, 15 Jul 2011)
New Revision: 73119
URL: http://svn.boost.org/trac/boost/changeset/73119
Log:
Changed order of test to make the Boost.Locale's test
be the last such the if it fails we will still see more
output
Text files modified:
trunk/libs/locale/test/test_config.cpp | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
Modified: trunk/libs/locale/test/test_config.cpp
==============================================================================
--- trunk/libs/locale/test/test_config.cpp (original)
+++ trunk/libs/locale/test/test_config.cpp 2011-07-15 08:48:40 EDT (Fri, 15 Jul 2011)
@@ -77,26 +77,20 @@
std::cout << " LC_ALL="<< env("LC_ALL") << std::endl;
std::cout << " LC_CTYPE="<< env("LC_CTYPE") << std::endl;
std::cout << " TZ="<< env("TZ") << std::endl;
- std::cout << "- Detected Boost locale: ";
- try {
- boost::locale::generator gen;
- std::locale l = gen("");
- std::cout << std::use_facet<boost::locale::info>(l).name() << std::endl;
- }
- catch(std::exception const &) {
- std::cout << " undetected" << std::endl;
- }
+
char const *clocale=setlocale(LC_ALL,"");
if(!clocale)
clocale= "undetected";
- std::cout <<"- Detected C locale: " << clocale << std::endl;
+ std::cout <<"- C locale: " << clocale << std::endl;
+
try {
std::locale loc("");
- std::cout << "- Detected C++ locale: " << loc.name() << std::endl;
+ std::cout << "- C++ locale: " << loc.name() << std::endl;
}
catch(std::exception const &) {
- std::cout << "- Detected C++ locale: is not supported" << std::endl;
+ std::cout << "- C++ locale: is not supported" << std::endl;
}
+
char const *locales_to_check[] = {
"en_US.UTF-8", "en_US.ISO8859-1", "English_United States.1252",
"he_IL.UTF-8", "he_IL.ISO8859-8", "Hebrew_Israel.1255",
@@ -107,6 +101,7 @@
};
std::cout << "- Testing locales availability on the operation system:" << std::endl;
check_locale(locales_to_check);
+
std::cout << "- Testing timezone and time " << std::endl;
{
setlocale(LC_ALL,"C");
@@ -117,6 +112,17 @@
strftime(buf,sizeof(buf),"%%c=%c; %%Z=%Z; %%z=%z",gmtime(&now));
std::cout << " Universal Time:" << buf << std::endl;
}
+ std::cout << "- Boost.Locale's locale: ";
+ try {
+ boost::locale::generator gen;
+ std::locale l = gen("");
+ std::cout << std::use_facet<boost::locale::info>(l).name() << std::endl;
+ }
+ catch(std::exception const &) {
+ std::cout << " undetected" << std::endl;
+ return EXIT_FAILURE;
+ }
+ return EXIT_SUCCESS;
}
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