diff options
-rw-r--r-- | libadhocutil/unittests/testCompileTimeFormatter.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libadhocutil/unittests/testCompileTimeFormatter.cpp b/libadhocutil/unittests/testCompileTimeFormatter.cpp index 030dbc9..9089243 100644 --- a/libadhocutil/unittests/testCompileTimeFormatter.cpp +++ b/libadhocutil/unittests/testCompileTimeFormatter.cpp @@ -78,135 +78,135 @@ BOOST_FIXTURE_TEST_SUITE( TestStreamWrite, std::stringstream ) BOOST_AUTO_TEST_CASE ( empty ) { Formatter<formatEdgeCaseEmpty>::write(*this); - BOOST_REQUIRE(this->str().empty()); + BOOST_CHECK(this->str().empty()); } BOOST_AUTO_TEST_CASE ( single ) { Formatter<formatEdgeCaseSingle>::write(*this); - BOOST_REQUIRE_EQUAL(this->str(), "1"); + BOOST_CHECK_EQUAL(this->str(), "1"); } BOOST_AUTO_TEST_CASE ( start ) { Formatter<formatEdgeCaseFormatStart>::write(*this, 10); - BOOST_REQUIRE_EQUAL(this->str(), "10 after"); + BOOST_CHECK_EQUAL(this->str(), "10 after"); } BOOST_AUTO_TEST_CASE ( end ) { Formatter<formatEdgeCaseFormatEnd>::write(*this, 10); - BOOST_REQUIRE_EQUAL(this->str(), "before 10"); + BOOST_CHECK_EQUAL(this->str(), "before 10"); } BOOST_AUTO_TEST_CASE ( lonely ) { Formatter<formatEdgeCaseFormatLonely>::write(*this, 10); - BOOST_REQUIRE_EQUAL(this->str(), "10"); + BOOST_CHECK_EQUAL(this->str(), "10"); } BOOST_AUTO_TEST_CASE ( literal ) { Formatter<formatStringLiteral>::write(*this); - BOOST_REQUIRE_EQUAL(this->str(), "literal"); + BOOST_CHECK_EQUAL(this->str(), "literal"); } BOOST_AUTO_TEST_CASE ( singleInt ) { Formatter<formatStringSingle>::write(*this, 32); - BOOST_REQUIRE_EQUAL(this->str(), "single 32."); + BOOST_CHECK_EQUAL(this->str(), "single 32."); } BOOST_AUTO_TEST_CASE ( singleIntReturn ) { - BOOST_REQUIRE_EQUAL(Formatter<formatStringSingle>::write(*this, 32).str(), "single 32."); + BOOST_CHECK_EQUAL(Formatter<formatStringSingle>::write(*this, 32).str(), "single 32."); } BOOST_AUTO_TEST_CASE ( singleDouble ) { Formatter<formatStringSingle>::write(*this, 3.14); - BOOST_REQUIRE_EQUAL(this->str(), "single 3.14."); + BOOST_CHECK_EQUAL(this->str(), "single 3.14."); } BOOST_AUTO_TEST_CASE ( singlePath ) { boost::filesystem::path p("/tmp/test/path"); Formatter<formatStringSingle>::write(*this, p); - BOOST_REQUIRE_EQUAL(this->str(), R"(single "/tmp/test/path".)"); + BOOST_CHECK_EQUAL(this->str(), R"(single "/tmp/test/path".)"); } BOOST_AUTO_TEST_CASE ( multi ) { Formatter<formatStringMulti>::write(*this, "one", "two"); - BOOST_REQUIRE_EQUAL(this->str(), "First one, then two."); + BOOST_CHECK_EQUAL(this->str(), "First one, then two."); } BOOST_AUTO_TEST_CASE ( escape1 ) { Formatter<formatStringEscape1>::write(*this); - BOOST_REQUIRE_EQUAL(this->str(), "literal % percentage."); + BOOST_CHECK_EQUAL(this->str(), "literal % percentage."); } BOOST_AUTO_TEST_CASE ( escape2 ) { Formatter<formatStringEscape2>::write(*this); - BOOST_REQUIRE_EQUAL(this->str(), "literal %? percentage."); + BOOST_CHECK_EQUAL(this->str(), "literal %? percentage."); } BOOST_AUTO_TEST_CASE ( escape3 ) { Formatter<formatStringEscape3>::write(*this, 3); - BOOST_REQUIRE_EQUAL(this->str(), "literal %3 percentage."); + BOOST_CHECK_EQUAL(this->str(), "literal %3 percentage."); } BOOST_AUTO_TEST_CASE ( escape4 ) { Formatter<formatStringEscape4>::write(*this, 3); - BOOST_REQUIRE_EQUAL(this->str(), "literal %3% percentage."); + BOOST_CHECK_EQUAL(this->str(), "literal %3% percentage."); } BOOST_AUTO_TEST_CASE ( customBracketted ) { Formatter<formatStringCustom>::write(*this, "expr"); - BOOST_REQUIRE_EQUAL(this->str(), "custom -( expr )-"); + BOOST_CHECK_EQUAL(this->str(), "custom -( expr )-"); } BOOST_AUTO_TEST_CASE ( customLongName ) { Formatter<formatStringCustomLong>::write(*this, "some text here"); - BOOST_REQUIRE_EQUAL(this->str(), "custom ---( some text here )---"); + BOOST_CHECK_EQUAL(this->str(), "custom ---( some text here )---"); } BOOST_AUTO_TEST_CASE ( customParam1 ) { Formatter<formatStringCustomParam1>::write(*this, "some text here"); - BOOST_REQUIRE_EQUAL(this->str(), "custom ---( some text here )---"); + BOOST_CHECK_EQUAL(this->str(), "custom ---( some text here )---"); } BOOST_AUTO_TEST_CASE ( customParam2 ) { Formatter<formatStringCustomParam2>::write(*this, "some text here"); - BOOST_REQUIRE_EQUAL(this->str(), "custom ---------( some text here )---------"); + BOOST_CHECK_EQUAL(this->str(), "custom ---------( some text here )---------"); } typedef Formatter<formatStringCustom> TestFormat; BOOST_AUTO_TEST_CASE ( typedefFormat ) { TestFormat::write(*this, "expr"); - BOOST_REQUIRE_EQUAL(this->str(), "custom -( expr )-"); + BOOST_CHECK_EQUAL(this->str(), "custom -( expr )-"); } AdHocFormatter(TypedefWrapper, "Typedef wrapper %?."); BOOST_AUTO_TEST_CASE ( typedefWrapper ) { TypedefWrapper::write(*this, "expr"); - BOOST_REQUIRE_EQUAL(this->str(), "Typedef wrapper expr."); + BOOST_CHECK_EQUAL(this->str(), "Typedef wrapper expr."); } BOOST_AUTO_TEST_CASE ( longFormatString ) { Formatter<formatStringLong>::write(*this); - BOOST_REQUIRE_EQUAL(this->str().length(), 246); + BOOST_CHECK_EQUAL(this->str().length(), 246); } BOOST_AUTO_TEST_SUITE_END(); @@ -218,14 +218,14 @@ BOOST_AUTO_TEST_CASE ( customMultiArgRightAlign ) Formatter<formatStringMultiArg>::write(buf1, width, "something"); Formatter<formatStringMultiArg>::write(buf2, width, "something else"); Formatter<formatStringMultiArg>::write(buf3, width, 123.45); - BOOST_REQUIRE_EQUAL(buf1.str(), "value something"); - BOOST_REQUIRE_EQUAL(buf2.str(), "value something else"); - BOOST_REQUIRE_EQUAL(buf3.str(), "value 123.45"); + BOOST_CHECK_EQUAL(buf1.str(), "value something"); + BOOST_CHECK_EQUAL(buf2.str(), "value something else"); + BOOST_CHECK_EQUAL(buf3.str(), "value 123.45"); } BOOST_AUTO_TEST_CASE ( get ) { auto s = Formatter<formatStringMultiArg>::get(20, "something else"); - BOOST_REQUIRE_EQUAL(s, "value something else"); + BOOST_CHECK_EQUAL(s, "value something else"); } |