Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76707 - trunk/libs/conversion/test
From: antoshkka_at_[hidden]
Date: 2012-01-26 12:47:59


Author: apolukhin
Date: 2012-01-26 12:47:56 EST (Thu, 26 Jan 2012)
New Revision: 76707
URL: http://svn.boost.org/trac/boost/changeset/76707

Log:
Update tests with example from #6452
Text files modified:
   trunk/libs/conversion/test/lexical_cast_empty_input_test.cpp | 15 +++++++++++++++
   1 files changed, 15 insertions(+), 0 deletions(-)

Modified: trunk/libs/conversion/test/lexical_cast_empty_input_test.cpp
==============================================================================
--- trunk/libs/conversion/test/lexical_cast_empty_input_test.cpp (original)
+++ trunk/libs/conversion/test/lexical_cast_empty_input_test.cpp 2012-01-26 12:47:56 EST (Thu, 26 Jan 2012)
@@ -138,6 +138,20 @@
     BOOST_CHECK_THROW(lexical_cast<signed char>(v), bad_lexical_cast);
 }
 
+
+struct my_string {
+ friend std::ostream &operator<<(std::ostream& sout, my_string const&/* st*/) {
+ return sout << "";
+ }
+};
+
+void test_empty_zero_terminated_string()
+{
+ my_string st;
+ std::string st2 = boost::lexical_cast<std::string>(st);
+ (void)st2;
+}
+
 unit_test::test_suite *init_unit_test_suite(int, char *[])
 {
     unit_test::test_suite *suite =
@@ -146,6 +160,7 @@
     suite->add(BOOST_TEST_CASE(&test_empty_string));
     suite->add(BOOST_TEST_CASE(&test_empty_user_class));
     suite->add(BOOST_TEST_CASE(&test_empty_vector));
+ suite->add(BOOST_TEST_CASE(&test_empty_zero_terminated_string));
 
     return suite;
 }


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