|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73094 - trunk/libs/locale/test
From: artyomtnk_at_[hidden]
Date: 2011-07-14 05:01:52
Author: artyom
Date: 2011-07-14 05:01:50 EDT (Thu, 14 Jul 2011)
New Revision: 73094
URL: http://svn.boost.org/trac/boost/changeset/73094
Log:
merged changeset 1887 - generator should be tested regardless of backends
Text files modified:
trunk/libs/locale/test/Jamfile.v2 | 2 +-
trunk/libs/locale/test/test_generator.cpp | 29 ++++++++++-------------------
2 files changed, 11 insertions(+), 20 deletions(-)
Modified: trunk/libs/locale/test/Jamfile.v2
==============================================================================
--- trunk/libs/locale/test/Jamfile.v2 (original)
+++ trunk/libs/locale/test/Jamfile.v2 2011-07-14 05:01:50 EDT (Thu, 14 Jul 2011)
@@ -29,12 +29,12 @@
[ run test_codepage_converter.cpp ]
[ run test_codepage.cpp ]
[ run test_message.cpp : $(BOOST_ROOT)/libs/locale/test ]
+ [ run test_generator.cpp ]
# icu
[ run test_collate.cpp ]
[ run test_convert.cpp ]
[ run test_boundary.cpp ]
[ run test_formatting.cpp : : : <optimization>off ]
- [ run test_generator.cpp ]
[ run test_icu_vs_os_timezone.cpp ]
# winapi
[ run test_winapi_collate.cpp ]
Modified: trunk/libs/locale/test/test_generator.cpp
==============================================================================
--- trunk/libs/locale/test/test_generator.cpp (original)
+++ trunk/libs/locale/test/test_generator.cpp 2011-07-14 05:01:50 EDT (Thu, 14 Jul 2011)
@@ -5,25 +5,17 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
-#ifndef BOOST_LOCALE_WITH_ICU
-#include <iostream>
-int main()
-{
- std::cout << "ICU is not build... Skipping" << std::endl;
-}
-#else
#include <boost/locale/generator.hpp>
#include <boost/locale/info.hpp>
-#include <boost/locale/collator.hpp>
+#include <boost/locale/message.hpp>
#include <iomanip>
#include "test_locale.hpp"
-bool has_collator(std::locale const &l)
+bool has_message(std::locale const &l)
{
- return std::has_facet<std::collate<char> >(l)
- && dynamic_cast<boost::locale::collator<char> const *>(&std::use_facet<std::collate<char> >(l));
+ return std::has_facet<boost::locale::message_format<char> >(l);
}
struct test_facet : public std::locale::facet {
@@ -39,24 +31,24 @@
try {
boost::locale::generator g;
std::locale l=g("en_US.UTF-8");
- TEST(has_collator(l));
+ TEST(has_message(l));
- g.categories(g.categories() ^ boost::locale::collation_facet);
+ g.categories(g.categories() ^ boost::locale::message_facet);
g.locale_cache_enabled(true);
g("en_US.UTF-8");
- g.categories(g.categories() | boost::locale::collation_facet);
+ g.categories(g.categories() | boost::locale::message_facet);
l=g("en_US.UTF-8");
- TEST(!has_collator(l));
+ TEST(!has_message(l));
g.clear_cache();
g.locale_cache_enabled(false);
l=g("en_US.UTF-8");
- TEST(has_collator(l));
+ TEST(has_message(l));
g.characters(g.characters() ^ boost::locale::char_facet);
l=g("en_US.UTF-8");
- TEST(!has_collator(l));
+ TEST(!has_message(l));
g.characters(g.characters() | boost::locale::char_facet);
l=g("en_US.UTF-8");
- TEST(has_collator(l));
+ TEST(has_message(l));
l=g("en_US.ISO8859-1");
TEST(std::use_facet<boost::locale::info>(l).language()=="en");
@@ -104,5 +96,4 @@
FINALIZE();
}
-#endif // NOICU
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
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