Skip to content

Commit

Permalink
Revert accidental conversion of lexical_cast test to to_string (from 8…
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Mar 31, 2016
1 parent cf6fa69 commit 7a2955f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/tests/test_lexical_cast.cpp
Expand Up @@ -87,7 +87,7 @@ bool validate(const char* str)
type_send val = initializer value; \
\
BOOST_CHECK_EXCEPTION( \
std::to_string(val), const char*, validate); \
lexical_cast<std::string>(val), const char*, validate); \
}

BOOST_AUTO_TEST_CASE_TEMPLATE(test_lexical_cast_throw, T, test_types)
Expand Down Expand Up @@ -200,14 +200,14 @@ BOOST_AUTO_TEST_CASE(test_lexical_cast_unsigned_long_long)

BOOST_AUTO_TEST_CASE(test_lexical_cast_result)
{
BOOST_CHECK_EQUAL(std::to_string(true), "1");
BOOST_CHECK_EQUAL(std::to_string(false), "0");
BOOST_CHECK_EQUAL(lexical_cast<std::string>(true), "1");
BOOST_CHECK_EQUAL(lexical_cast<std::string>(false), "0");

BOOST_CHECK_EQUAL(std::to_string(1), "1");
BOOST_CHECK_EQUAL(std::to_string(1u), "1");
BOOST_CHECK_EQUAL(lexical_cast<std::string>(1), "1");
BOOST_CHECK_EQUAL(lexical_cast<std::string>(1u), "1");

BOOST_CHECK_EQUAL(std::to_string(1.2f), "1.2");
BOOST_CHECK_EQUAL(std::to_string(1.2), "1.2");
BOOST_CHECK_EQUAL(lexical_cast<std::string>(1.2f), "1.2");
BOOST_CHECK_EQUAL(lexical_cast<std::string>(1.2), "1.2");

BOOST_CHECK_EQUAL(lexical_cast<int>("1"), 1);
BOOST_CHECK_EQUAL(lexical_cast<int>("-1"), -1);
Expand Down

0 comments on commit 7a2955f

Please sign in to comment.