|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77921 - trunk/libs/conversion/test
From: antoshkka_at_[hidden]
Date: 2012-04-11 14:34:10
Author: apolukhin
Date: 2012-04-11 14:34:10 EDT (Wed, 11 Apr 2012)
New Revision: 77921
URL: http://svn.boost.org/trac/boost/changeset/77921
Log:
Fix iterator_range test for compilers with new unicode characters but without new unicode locales support
Text files modified:
trunk/libs/conversion/test/lexical_cast_iterator_range_test.cpp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
Modified: trunk/libs/conversion/test/lexical_cast_iterator_range_test.cpp
==============================================================================
--- trunk/libs/conversion/test/lexical_cast_iterator_range_test.cpp (original)
+++ trunk/libs/conversion/test/lexical_cast_iterator_range_test.cpp 2012-04-11 14:34:10 EDT (Wed, 11 Apr 2012)
@@ -51,11 +51,13 @@
BOOST_CHECK_EQUAL(lexical_cast<unsigned short>(rng), 1u);
BOOST_CHECK_EQUAL(lexical_cast<long int>(rng), 1);
BOOST_CHECK_EQUAL(lexical_cast<unsigned long int>(rng), 1u);
+
+#ifdef BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES
BOOST_CHECK_EQUAL(lexical_cast<float>(rng), 1.0f);
BOOST_CHECK_EQUAL(lexical_cast<double>(rng), 1.0);
BOOST_CHECK_EQUAL(lexical_cast<long double>(rng), 1.0L);
BOOST_CHECK_EQUAL(lexical_cast<class_with_user_defined_sream_operators>(rng), 1);
-
+#endif
#if defined(BOOST_HAS_LONG_LONG)
BOOST_CHECK_EQUAL(lexical_cast<boost::ulong_long_type>(rng), 1u);
BOOST_CHECK_EQUAL(lexical_cast<boost::long_long_type>(rng), 1);
@@ -102,6 +104,15 @@
iterator_range<const test_char_type*> crng2(eleven, eleven + 1);
BOOST_CHECK_EQUAL(lexical_cast<std::string>(crng2), "1");
+ BOOST_CHECK_EQUAL(lexical_cast<float>(rng1), 1.0f);
+ BOOST_CHECK_EQUAL(lexical_cast<double>(rng1), 1.0);
+ BOOST_CHECK_EQUAL(lexical_cast<long double>(rng1), 1.0L);
+ BOOST_CHECK_EQUAL(lexical_cast<class_with_user_defined_sream_operators>(rng1), 1);
+
+ BOOST_CHECK_EQUAL(lexical_cast<float>(crng2), 1.0f);
+ BOOST_CHECK_EQUAL(lexical_cast<double>(crng2), 1.0);
+ BOOST_CHECK_EQUAL(lexical_cast<long double>(crng2), 1.0L);
+ BOOST_CHECK_EQUAL(lexical_cast<class_with_user_defined_sream_operators>(crng2), 1);
#ifndef BOOST_LCAST_NO_WCHAR_T
BOOST_CHECK(lexical_cast<std::wstring>(rng1) == L"1");
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