From 132663404bdaa634838d205b52da2eee226639eb Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 1 Feb 2012 04:22:21 +0000 Subject: [PATCH] Added tests for ticket #6453 [SVN r76817] --- test/lexical_cast_containers_test.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/lexical_cast_containers_test.cpp b/test/lexical_cast_containers_test.cpp index 5f98ac8..0c6315b 100644 --- a/test/lexical_cast_containers_test.cpp +++ b/test/lexical_cast_containers_test.cpp @@ -13,6 +13,7 @@ #include void testing_boost_containers_basic_string(); +void testing_boost_containers_string_std_string(); using namespace boost; @@ -21,6 +22,7 @@ boost::unit_test::test_suite *init_unit_test_suite(int, char *[]) unit_test::test_suite *suite = 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)); return suite; } @@ -35,4 +37,24 @@ void testing_boost_containers_basic_string() BOOST_CHECK(1000 == lexical_cast(str)); } +#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_WSTRING) +#define BOOST_LCAST_NO_WCHAR_T +#endif +void testing_boost_containers_string_std_string() +{ + std::string std_str("std_str"); + boost::container::string boost_str("boost_str"); + BOOST_CHECK(boost::lexical_cast(boost_str) == "boost_str"); + BOOST_CHECK(boost::lexical_cast(std_str) == "std_str"); + +#ifndef BOOST_LCAST_NO_WCHAR_T + std::wstring std_wstr(L"std_wstr"); + boost::container::wstring boost_wstr(L"boost_wstr"); + + BOOST_CHECK(boost::lexical_cast(boost_wstr) == L"boost_wstr"); + BOOST_CHECK(boost::lexical_cast(std_wstr) == L"std_wstr"); + +#endif + +}