forked from boostorg/conversion
* fixes #6504 (characters widening fixed)
* much more tests * better support for unicode characters and template classes that are instantinated with unicode character types * meta code refactored (it is now shorter and clearer) [SVN r77824]
This commit is contained in:
1 parent
6ff6958204
commit
8562b480f8
5 files changed
+418
-355
No files matched your search
@@ -14,6 +14,8 @@
|
||||
|
||||
void testing_boost_containers_basic_string();
|
||||
void testing_boost_containers_string_std_string();
|
||||
void testing_boost_containers_string_widening();
|
||||
|
||||
|
||||
using namespace boost;
|
||||
|
||||
@@ -23,6 +25,7 @@ boost::unit_test::test_suite *init_unit_test_suite(int, char *[])
|
||||
BOOST_TEST_SUITE("Testing boost::lexical_cast with boost::container::string");
|
||||
suite->add(BOOST_TEST_CASE(testing_boost_containers_basic_string));
|
||||
suite->add(BOOST_TEST_CASE(testing_boost_containers_string_std_string));
|
||||
suite->add(BOOST_TEST_CASE(testing_boost_containers_string_widening));
|
||||
|
||||
return suite;
|
||||
}
|
||||
@@ -58,3 +61,23 @@ void testing_boost_containers_string_std_string()
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void testing_boost_containers_string_widening()
|
||||
{
|
||||
const char char_array[] = "Test string";
|
||||
|
||||
#ifndef BOOST_LCAST_NO_WCHAR_T
|
||||
const wchar_t wchar_array[] = L"Test string";
|
||||
BOOST_CHECK(boost::lexical_cast<boost::container::wstring>(char_array) == wchar_array);
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CHAR16_T) && !defined(BOOST_NO_UNICODE_LITERALS) && defined(BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES)
|
||||
const char16_t char16_array[] = u"Test string";
|
||||
BOOST_CHECK(boost::lexical_cast<boost::container::basic_string<char16_t> >(char_array) == char16_array);
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CHAR32_T) && !defined(BOOST_NO_UNICODE_LITERALS) && defined(BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES)
|
||||
const char32_t char32_array[] = U"Test string";
|
||||
BOOST_CHECK(boost::lexical_cast<boost::container::basic_string<char32_t> >(char_array) == char32_array);
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user