forked from boostorg/conversion
Merge from trunk
* Much more tests * Now numeric_cast (and lexical_cast) can be compiled with disabled exceptions * Supress warning described in #6645 (implicit conversion shortens 64-bit value into a 32-bit value) * Fixed compilation of lexical_cast with BOOST_NO_STD_LOCALE defined * Documentation updates * Case insensitive "NaN" and "Inf" parsing * Performance tests commit [SVN r77288]
This commit is contained in:
@@ -138,6 +138,19 @@ void test_empty_vector()
|
||||
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;
|
||||
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(st), std::string());;
|
||||
}
|
||||
|
||||
unit_test::test_suite *init_unit_test_suite(int, char *[])
|
||||
{
|
||||
unit_test::test_suite *suite =
|
||||
@@ -146,6 +159,7 @@ unit_test::test_suite *init_unit_test_suite(int, char *[])
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user