summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/logging.cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-03-25 23:44:30 +0000
committerStephen D. Huston <shuston@apache.org>2009-03-25 23:44:30 +0000
commit67d330f235362bf622b95f8c4d14321272a44ba7 (patch)
tree82153e6fd6c1c77e9defc80cb2e6b34d23de25cf /qpid/cpp/src/tests/logging.cpp
parentb51fd45a4ed81bee144c22c2a57fc0e882d44149 (diff)
downloadqpid-python-67d330f235362bf622b95f8c4d14321272a44ba7.tar.gz
Merge from trunk tag to-cmake-25mar09 (r758432)
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/cmake@758465 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/logging.cpp')
-rw-r--r--qpid/cpp/src/tests/logging.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/qpid/cpp/src/tests/logging.cpp b/qpid/cpp/src/tests/logging.cpp
index 051722e7c8..00e1d7de85 100644
--- a/qpid/cpp/src/tests/logging.cpp
+++ b/qpid/cpp/src/tests/logging.cpp
@@ -23,6 +23,7 @@
#include "qpid/memory.h"
#include "qpid/Options.h"
#if defined (_WIN32)
+# include "qpid/log/windows/SinkOptions.h"
#else
# include "qpid/log/posix/SinkOptions.h"
#endif
@@ -172,7 +173,7 @@ QPID_AUTO_TEST_CASE(testLoggerFormat) {
l.format(Logger::FUNCTION);
QPID_LOG(critical, "foo");
- BOOST_CHECK_REGEX("void .*testLoggerFormat.*\\(\\): foo\n", out->last());
+ BOOST_CHECK_EQUAL(string(BOOST_CURRENT_FUNCTION) + ": foo\n", out->last());
l.format(Logger::LEVEL);
QPID_LOG(critical, "foo");
@@ -270,7 +271,11 @@ QPID_AUTO_TEST_CASE(testOptionsParse) {
"--log-function", "YES"
};
qpid::log::Options opts("");
+#ifdef _WIN32
+ qpid::log::windows::SinkOptions sinks("test");
+#else
qpid::log::posix::SinkOptions sinks("test");
+#endif
opts.parse(ARGC(argv), const_cast<char**>(argv));
sinks = *opts.sinkOptions;
vector<string> expect=list_of("error+:foo")("debug:bar")("info");
@@ -286,7 +291,11 @@ QPID_AUTO_TEST_CASE(testOptionsParse) {
QPID_AUTO_TEST_CASE(testOptionsDefault) {
Options opts("");
+#ifdef _WIN32
+ qpid::log::windows::SinkOptions sinks("test");
+#else
qpid::log::posix::SinkOptions sinks("test");
+#endif
sinks = *opts.sinkOptions;
BOOST_CHECK(sinks.logToStderr);
BOOST_CHECK(!sinks.logToStdout);
@@ -345,8 +354,13 @@ QPID_AUTO_TEST_CASE(testQuoteNonPrintable) {
ScopedSuppressLogging ls(l);
Options opts("test");
opts.time=false;
+#ifdef _WIN32
+ qpid::log::windows::SinkOptions *sinks =
+ dynamic_cast<qpid::log::windows::SinkOptions *>(opts.sinkOptions.get());
+#else
qpid::log::posix::SinkOptions *sinks =
dynamic_cast<qpid::log::posix::SinkOptions *>(opts.sinkOptions.get());
+#endif
sinks->logToStderr = false;
sinks->logFile = "logging.tmp";
l.configure(opts);