7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for CF log stamp filter"
10 #include <boost/test/unit_test.hpp>
12 #include <boost/iostreams/device/back_inserter.hpp>
17 using namespace boost;
28 m_sink(iostreams::back_inserter(m_buffer))
43 iostreams::back_insert_device<string>
m_sink;
57 string str =
"Hello world!";
58 Uint nbbytes_wrtitten;
63 BOOST_CHECK_EQUAL(nbbytes_wrtitten, f.
m_buffer.length());
72 BOOST_CHECK_EQUAL(
string(
"<TestStream> ") + str, f.
m_buffer);
74 BOOST_CHECK_EQUAL(nbbytes_wrtitten, str.length() + 13);
83 BOOST_CHECK_EQUAL(
string(
"<%tpye%> ") + str, f.
m_buffer);
85 BOOST_CHECK_EQUAL(nbbytes_wrtitten, str.length() + 9);
96 string str =
"Hello world!";
97 unsigned int nbbytes_wrtitten;
103 BOOST_CHECK_EQUAL(
string(
"--") + cl.
short_str() + string(
"-- ") + str, f.
m_buffer);
104 BOOST_CHECK_EQUAL(nbbytes_wrtitten, str.length() + cl.
short_str().length() + 5);
109 BOOST_AUTO_TEST_SUITE_END()
external boost library namespace
iostreams::back_insert_device< string > m_sink
BOOST_AUTO_TEST_CASE(write)
LogStampFilter_Fixture()
common setup for each test case
~LogStampFilter_Fixture()
common tear-down for each test case
Prepends a stamp to the log messages.
std::string short_str() const
void setStamp(const std::string &stamp)
Sets stamp.
Top-level namespace for coolfluid.
void endMessage()
Ends message.
LogStampFilter * m_filter
possibly common functions used on the tests below
unsigned int Uint
typedef for unsigned int
std::streamsize write(Sink &sink, const char_type *data, std::streamsize size)
Writes data to a sink.
Most basic kernel library.
void setPlace(const CodeLocation &place)
Sets the code location.