diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-05-04 15:39:19 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-05-04 15:39:19 +0000 |
commit | 633c33f224f3196f3f9bd80bd2e418d8143fea06 (patch) | |
tree | 1391da89470593209466df68c0b40b89c14963b1 /cpp/src/tests/logging.cpp | |
parent | c73f9286ebff93a6c8dbc29cf05e258c4b55c976 (diff) | |
download | qpid-python-633c33f224f3196f3f9bd80bd2e418d8143fea06.tar.gz |
QPID-3858: Updated branch - merged from trunk r.1333987
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1334037 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/logging.cpp')
-rw-r--r-- | cpp/src/tests/logging.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/tests/logging.cpp b/cpp/src/tests/logging.cpp index fc55d642c3..5d5bb1feef 100644 --- a/cpp/src/tests/logging.cpp +++ b/cpp/src/tests/logging.cpp @@ -29,6 +29,7 @@ #endif #include <boost/test/floating_point_comparison.hpp> +#include <boost/algorithm/string/predicate.hpp> #include <boost/format.hpp> #include "unit_test.h" @@ -43,8 +44,10 @@ namespace tests { QPID_AUTO_TEST_SUITE(loggingTestSuite) using namespace std; -using namespace boost; using namespace qpid::log; +using boost::ends_with; +using boost::contains; +using boost::format; QPID_AUTO_TEST_CASE(testStatementInit) { Statement s=QPID_LOG_STATEMENT_INIT(debug); int line=__LINE__; @@ -176,7 +179,9 @@ QPID_AUTO_TEST_CASE(testLoggerFormat) { l.format(Logger::FUNCTION); QPID_LOG(critical, "foo"); - BOOST_CHECK_EQUAL(string(BOOST_CURRENT_FUNCTION) + ": foo\n", out->last()); + BOOST_CHECK( ends_with( out->last(), ": foo\n")); + string name = out->last().substr(0, out->last().length() - 6); + BOOST_CHECK( contains( string(BOOST_CURRENT_FUNCTION), name)); l.format(Logger::LEVEL); QPID_LOG(critical, "foo"); |