carnold 2005/01/03 15:45:20
Modified: tests/src streamtestcase.cpp
tests/src/varia levelrangefiltertestcase.cpp
Log:
LOGCXX-10: All tests passing
Revision Changes Path
1.5 +5 -4 logging-log4cxx/tests/src/streamtestcase.cpp
Index: streamtestcase.cpp
===================================================================
RCS file: /home/cvs/logging-log4cxx/tests/src/streamtestcase.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- streamtestcase.cpp 26 Dec 2004 07:31:54 -0000 1.4
+++ streamtestcase.cpp 3 Jan 2005 23:45:20 -0000 1.5
@@ -1,5 +1,5 @@
/*
- * Copyright 2003,2004 The Apache Software Foundation.
+ * Copyright 2003-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -155,13 +155,14 @@
void testWidth() {
LoggerPtr root(Logger::getRootLogger());
log4cxx::logstream stream(root, log4cxx::Level::INFO);
- stream.width(4);
+ stream.width(5);
+ stream.precision(2);
stream << std::fixed
- << 10.00015
+ << '[' << 10.0 << L']'
<< LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("10.00")) == LogString::npos);
+ CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("[10.00]")) ==
LogString::npos);
}
void addMessage(std::wostream& os) {
1.8 +9 -9
logging-log4cxx/tests/src/varia/levelrangefiltertestcase.cpp
Index: levelrangefiltertestcase.cpp
===================================================================
RCS file:
/home/cvs/logging-log4cxx/tests/src/varia/levelrangefiltertestcase.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- levelrangefiltertestcase.cpp 3 Jan 2005 06:43:44 -0000 1.7
+++ levelrangefiltertestcase.cpp 3 Jan 2005 23:45:20 -0000 1.8
@@ -82,18 +82,18 @@
int passCount = 0;
LogString sbuf(LOG4CXX_STR("pass "));
- Pool pool;
- sbuf.append(StringHelper::toString(passCount, pool));
+ Pool pool;
+ sbuf.append(StringHelper::toString(passCount, pool));
- sbuf.append(LOG4CXX_STR("; no min or max set"));
+ sbuf.append(LOG4CXX_STR("; no min or max set"));
common(sbuf);
passCount++;
// test with a min set
rangeFilter->setLevelMin(Level::WARN);
sbuf.assign(LOG4CXX_STR("pass "));
- sbuf.append(StringHelper::toString(passCount, pool));
- sbuf.append(LOG4CXX_STR("; min set to WARN, max not set"));
+ sbuf.append(StringHelper::toString(passCount, pool));
+ sbuf.append(LOG4CXX_STR("; min set to WARN, max not set"));
common(sbuf);
passCount++;
@@ -105,8 +105,8 @@
//test with max set
rangeFilter->setLevelMax(Level::WARN);
sbuf.assign(LOG4CXX_STR("pass "));
- sbuf.append(StringHelper::toString(passCount, pool));
- sbuf.append(LOG4CXX_STR("; min not set, max set to WARN"));
+ sbuf.append(StringHelper::toString(passCount, pool));
+ sbuf.append(LOG4CXX_STR("; min not set, max set to WARN"));
common(sbuf);
passCount++;
@@ -191,7 +191,7 @@
//test with max set
rangeFilter->setLevelMax(Level::WARN);
- sbuf.append(LOG4CXX_STR("pass "));
+ sbuf.assign(LOG4CXX_STR("pass "));
sbuf.append(StringHelper::toString(passCount, pool));
@@ -253,6 +253,6 @@
const File
LevelRangeFilterTestCase::ACCEPT_FILE("output/LevelRangeFilter_accept");
const File
LevelRangeFilterTestCase::ACCEPT_WITNESS("witness/LevelRangeFilter_accept");
const File
LevelRangeFilterTestCase::NEUTRAL_FILE("output/LevelRangeFilter_neutral");
-const File
LevelRangeFilterTestCase::NEUTRAL_WITNESS("witness/LevelMatchFilter_neutral");
+const File
LevelRangeFilterTestCase::NEUTRAL_WITNESS("witness/LevelRangeFilter_neutral");
CPPUNIT_TEST_SUITE_REGISTRATION(LevelRangeFilterTestCase);