You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by ca...@apache.org on 2008/01/28 19:40:24 UTC
svn commit: r615984 [3/4] - in /logging/log4cxx/trunk/src/test/cpp: ./
customlogger/ db/ defaultinit/ helpers/ net/ nt/ pattern/ rolling/ spi/
util/ varia/ xml/
Modified: logging/log4cxx/trunk/src/test/cpp/nt/nteventlogappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/nt/nteventlogappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/nt/nteventlogappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/nt/nteventlogappendertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,8 +16,6 @@
*/
#if defined(_WIN32) && !defined(_WIN32_WCE)
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/nt/nteventlogappender.h>
#include "../appenderskeletontestcase.h"
#include "windows.h"
@@ -25,6 +23,7 @@
#include <log4cxx/spi/loggingevent.h>
#include <log4cxx/patternlayout.h>
#include "../insertwide.h"
+#include "../logunit.h"
#include <log4cxx/helpers/date.h>
using namespace log4cxx;
@@ -37,15 +36,15 @@
*/
class NTEventLogAppenderTestCase : public AppenderSkeletonTestCase
{
- CPPUNIT_TEST_SUITE(NTEventLogAppenderTestCase);
+ LOGUNIT_TEST_SUITE(NTEventLogAppenderTestCase);
//
// tests inherited from AppenderSkeletonTestCase
//
- CPPUNIT_TEST(testDefaultThreshold);
- CPPUNIT_TEST(testSetOptionThreshold);
- CPPUNIT_TEST(testHelloWorld);
+ LOGUNIT_TEST(testDefaultThreshold);
+ LOGUNIT_TEST(testSetOptionThreshold);
+ LOGUNIT_TEST(testHelloWorld);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -62,7 +61,7 @@
DWORD oldest;
if(stat) stat = GetOldestEventLogRecord(hEventLog, &oldest);
CloseEventLog(hEventLog);
- CPPUNIT_ASSERT(stat);
+ LOGUNIT_ASSERT(stat);
expectedId += oldest;
}
@@ -83,7 +82,7 @@
appender->doAppend(event, p);
}
hEventLog = ::OpenEventLogW(NULL, L"log4cxx_test");
- CPPUNIT_ASSERT(hEventLog != NULL);
+ LOGUNIT_ASSERT(hEventLog != NULL);
DWORD actualId;
BOOL stat = GetNumberOfEventLogRecords(hEventLog, &actualId);
DWORD oldest;
@@ -91,10 +90,10 @@
actualId += oldest;
actualId--;
CloseEventLog(hEventLog);
- CPPUNIT_ASSERT(stat);
- CPPUNIT_ASSERT_EQUAL(expectedId, actualId);
+ LOGUNIT_ASSERT(stat);
+ LOGUNIT_ASSERT_EQUAL(expectedId, actualId);
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(NTEventLogAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(NTEventLogAppenderTestCase);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/pattern/patternparsertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/pattern/patternparsertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/pattern/patternparsertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/pattern/patternparsertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -15,9 +15,6 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/spi/loggingevent.h>
#include <log4cxx/helpers/system.h>
@@ -26,6 +23,7 @@
#include "num343patternconverter.h"
#include "../testchar.h"
#include "../insertwide.h"
+#include "../logunit.h"
#include <log4cxx/spi/loggerrepository.h>
#include <log4cxx/pattern/patternparser.h>
#include <log4cxx/pattern/patternconverter.h>
@@ -63,17 +61,17 @@
map.insert(PatternMap::value_type(LOG4CXX_STR(spec), (PatternConstructor) cls ::newInstance))
-class PatternParserTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(PatternParserTestCase)
{
- CPPUNIT_TEST_SUITE(PatternParserTestCase);
- CPPUNIT_TEST(testNewWord);
- CPPUNIT_TEST(testNewWord2);
- CPPUNIT_TEST(testBogusWord1);
- CPPUNIT_TEST(testBogusWord2);
- CPPUNIT_TEST(testBasic1);
- CPPUNIT_TEST(testBasic2);
- CPPUNIT_TEST(testMultiOption);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(PatternParserTestCase);
+ LOGUNIT_TEST(testNewWord);
+ LOGUNIT_TEST(testNewWord2);
+ LOGUNIT_TEST(testBogusWord1);
+ LOGUNIT_TEST(testBogusWord2);
+ LOGUNIT_TEST(testBasic1);
+ LOGUNIT_TEST(testBasic2);
+ LOGUNIT_TEST(testMultiOption);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr logger;
LoggingEventPtr event;
@@ -157,7 +155,7 @@
(*converterIter)->format(event, actual, p);
(*fieldIter)->format(fieldStart, actual);
}
- CPPUNIT_ASSERT_EQUAL(expected, actual);
+ LOGUNIT_ASSERT_EQUAL(expected, actual);
}
@@ -245,5 +243,5 @@
// See bug LOGCXX-204
//
#if !defined(_MSC_VER) || _MSC_VER > 1200
-CPPUNIT_TEST_SUITE_REGISTRATION(PatternParserTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(PatternParserTestCase);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp Mon Jan 28 10:40:19 2008
@@ -15,9 +15,6 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/mdc.h>
@@ -40,6 +37,7 @@
#include <apr_strings.h>
#include <log4cxx/helpers/pool.h>
#include "testchar.h"
+#include "logunit.h"
#include <log4cxx/spi/loggerrepository.h>
#include <log4cxx/helpers/stringhelper.h>
@@ -62,24 +60,24 @@
using namespace log4cxx;
using namespace log4cxx::helpers;
-class PatternLayoutTest : public CppUnit::TestFixture
+LOGUNIT_CLASS(PatternLayoutTest)
{
- CPPUNIT_TEST_SUITE(PatternLayoutTest);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
- CPPUNIT_TEST(test3);
- CPPUNIT_TEST(test4);
- CPPUNIT_TEST(test5);
- CPPUNIT_TEST(test6);
- CPPUNIT_TEST(test7);
- CPPUNIT_TEST(test8);
- CPPUNIT_TEST(test9);
- CPPUNIT_TEST(test10);
- CPPUNIT_TEST(test11);
- CPPUNIT_TEST(test12);
- CPPUNIT_TEST(testMDC1);
- CPPUNIT_TEST(testMDC2);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(PatternLayoutTest);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST(test3);
+ LOGUNIT_TEST(test4);
+ LOGUNIT_TEST(test5);
+ LOGUNIT_TEST(test6);
+ LOGUNIT_TEST(test7);
+ LOGUNIT_TEST(test8);
+ LOGUNIT_TEST(test9);
+ LOGUNIT_TEST(test10);
+ LOGUNIT_TEST(test11);
+ LOGUNIT_TEST(test12);
+ LOGUNIT_TEST(testMDC1);
+ LOGUNIT_TEST(testMDC2);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr root;
LoggerPtr logger;
@@ -102,7 +100,7 @@
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/patternLayout1.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/patternLayout.1")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/patternLayout.1")));
}
void test2()
@@ -130,7 +128,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.2")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.2")));
}
void test3()
@@ -158,7 +156,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.3")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.3")));
}
// Output format:
@@ -188,7 +186,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.4")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.4")));
}
void test5()
@@ -216,7 +214,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.5")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.5")));
}
void test6()
@@ -244,7 +242,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.6")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.6")));
}
void test7()
@@ -272,7 +270,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.7")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.7")));
}
void test8()
@@ -303,7 +301,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.8")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.8")));
}
void test9()
@@ -329,7 +327,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.9")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.9")));
}
void test10()
@@ -361,7 +359,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.10")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.10")));
}
void test11()
@@ -387,7 +385,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.11")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.11")));
}
void test12()
@@ -417,7 +415,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.12")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/patternLayout.12")));
}
void testMDC1()
@@ -428,7 +426,7 @@
logger->debug(LOG4CXX_TEST_STR("Hello World"));
MDC::clear();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/patternLayout.mdc.1")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/patternLayout.mdc.1")));
}
void testMDC2()
@@ -504,7 +502,7 @@
layout->activateOptions(pool);
root->debug(LOG4CXX_TEST_STR("finished mdc pattern test"));
- CPPUNIT_ASSERT(Compare::compare(OUTPUT_FILE, WITNESS_FILE));
+ LOGUNIT_ASSERT(Compare::compare(OUTPUT_FILE, WITNESS_FILE));
}
std::string createMessage(Pool& pool, int i) {
@@ -546,4 +544,4 @@
const LogString PatternLayoutTest::FILTERED(LOG4CXX_STR("output/filtered"));
-CPPUNIT_TEST_SUITE_REGISTRATION(PatternLayoutTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(PatternLayoutTest);
Modified: logging/log4cxx/trunk/src/test/cpp/propertyconfiguratortest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/propertyconfiguratortest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/propertyconfiguratortest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/propertyconfiguratortest.cpp Mon Jan 28 10:40:19 2008
@@ -15,23 +15,23 @@
* limitations under the License.
*/
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/helpers/properties.h>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/logmanager.h>
#include "vectorappender.h"
+#include "logunit.h"
using namespace log4cxx;
using namespace log4cxx::helpers;
-class PropertyConfiguratorTest : public CppUnit::TestFixture
+LOGUNIT_CLASS(PropertyConfiguratorTest)
{
- CPPUNIT_TEST_SUITE(PropertyConfiguratorTest);
- CPPUNIT_TEST(testInherited);
- CPPUNIT_TEST(testNull);
- CPPUNIT_TEST(testAppenderThreshold);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(PropertyConfiguratorTest);
+ LOGUNIT_TEST(testInherited);
+ LOGUNIT_TEST(testNull);
+ LOGUNIT_TEST(testAppenderThreshold);
+ LOGUNIT_TEST_SUITE_END();
public:
void testInherited() {
@@ -42,10 +42,10 @@
props.put(LOG4CXX_STR("log4j.appender.VECTOR2"), LOG4CXX_STR("org.apache.log4j.VectorAppender"));
PropertyConfigurator::configure(props);
LoggerPtr logger = Logger::getLogger("org.apache.log4j.PropertyConfiguratorTest");
- CPPUNIT_ASSERT_EQUAL((int) Level::DEBUG_INT,
+ LOGUNIT_ASSERT_EQUAL((int) Level::DEBUG_INT,
logger->getEffectiveLevel()->toInt());
Logger::getRootLogger()->setLevel(Level::getError());
- CPPUNIT_ASSERT_EQUAL((int) Level::ERROR_INT,
+ LOGUNIT_ASSERT_EQUAL((int) Level::ERROR_INT,
logger->getEffectiveLevel()->toInt());
LogManager::resetConfiguration();
}
@@ -58,10 +58,10 @@
props.put(LOG4CXX_STR("log4j.appender.VECTOR2"), LOG4CXX_STR("org.apache.log4j.VectorAppender"));
PropertyConfigurator::configure(props);
LoggerPtr logger = Logger::getLogger("org.apache.log4j.PropertyConfiguratorTest");
- CPPUNIT_ASSERT_EQUAL((int) Level::DEBUG_INT,
+ LOGUNIT_ASSERT_EQUAL((int) Level::DEBUG_INT,
logger->getEffectiveLevel()->toInt());
Logger::getRootLogger()->setLevel(Level::getError());
- CPPUNIT_ASSERT_EQUAL((int) Level::ERROR_INT,
+ LOGUNIT_ASSERT_EQUAL((int) Level::ERROR_INT,
logger->getEffectiveLevel()->toInt());
LogManager::resetConfiguration();
}
@@ -74,15 +74,15 @@
PropertyConfigurator::configure(props);
LoggerPtr root(Logger::getRootLogger());
VectorAppenderPtr appender(root->getAppender(LOG4CXX_STR("VECTOR1")));
- CPPUNIT_ASSERT_EQUAL((int) Level::WARN_INT, appender->getThreshold()->toInt());
+ LOGUNIT_ASSERT_EQUAL((int) Level::WARN_INT, appender->getThreshold()->toInt());
LOG4CXX_INFO(root, "Info message");
LOG4CXX_WARN(root, "Warn message");
LOG4CXX_WARN(root, "Error message");
- CPPUNIT_ASSERT_EQUAL((size_t) 2, appender->vector.size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 2, appender->vector.size());
LogManager::resetConfiguration();
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(PropertyConfiguratorTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(PropertyConfiguratorTest);
Modified: logging/log4cxx/trunk/src/test/cpp/rolling/filenamepatterntestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rolling/filenamepatterntestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rolling/filenamepatterntestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rolling/filenamepatterntestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,9 +16,6 @@
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/pattern/filedatepatternconverter.h>
#include <log4cxx/pattern/integerpatternconverter.h>
#include <log4cxx/pattern/patternparser.h>
@@ -26,6 +23,7 @@
#include <log4cxx/helpers/date.h>
#include <log4cxx/helpers/integer.h>
#include "../util/compare.h"
+#include "../logunit.h"
#include "../insertwide.h"
#include <apr_time.h>
@@ -42,26 +40,26 @@
*
*/
class FileNamePatternTestCase : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(FileNamePatternTestCase);
- CPPUNIT_TEST(testFormatInteger1);
- CPPUNIT_TEST(testFormatInteger2);
- CPPUNIT_TEST(testFormatInteger3);
- CPPUNIT_TEST(testFormatInteger4);
- CPPUNIT_TEST(testFormatInteger5);
- CPPUNIT_TEST(testFormatInteger6);
- CPPUNIT_TEST(testFormatInteger7);
- CPPUNIT_TEST(testFormatInteger8);
- CPPUNIT_TEST(testFormatInteger9);
- CPPUNIT_TEST(testFormatInteger10);
- CPPUNIT_TEST(testFormatInteger11);
- CPPUNIT_TEST(testFormatDate1);
+ LOGUNIT_TEST_SUITE(FileNamePatternTestCase);
+ LOGUNIT_TEST(testFormatInteger1);
+ LOGUNIT_TEST(testFormatInteger2);
+ LOGUNIT_TEST(testFormatInteger3);
+ LOGUNIT_TEST(testFormatInteger4);
+ LOGUNIT_TEST(testFormatInteger5);
+ LOGUNIT_TEST(testFormatInteger6);
+ LOGUNIT_TEST(testFormatInteger7);
+ LOGUNIT_TEST(testFormatInteger8);
+ LOGUNIT_TEST(testFormatInteger9);
+ LOGUNIT_TEST(testFormatInteger10);
+ LOGUNIT_TEST(testFormatInteger11);
+ LOGUNIT_TEST(testFormatDate1);
//
// TODO: Problem with timezone offset
-// CPPUNIT_TEST(testFormatDate2);
-// CPPUNIT_TEST(testFormatDate3);
- CPPUNIT_TEST(testFormatDate4);
- CPPUNIT_TEST(testFormatDate5);
- CPPUNIT_TEST_SUITE_END();
+// LOGUNIT_TEST(testFormatDate2);
+// LOGUNIT_TEST(testFormatDate3);
+ LOGUNIT_TEST(testFormatDate4);
+ LOGUNIT_TEST(testFormatDate5);
+ LOGUNIT_TEST_SUITE_END();
public:
LogString format(const LogString& pattern,
@@ -103,13 +101,13 @@
apr_time_t n;
/*apr_status_t stat = */apr_time_exp_get(&n, &tm);
ObjectPtr obj(new Date(n));
- CPPUNIT_ASSERT_EQUAL(expected, format(pattern, obj));
+ LOGUNIT_ASSERT_EQUAL(expected, format(pattern, obj));
}
void assertIntegerPattern(const LogString& pattern, int value,
const LogString& expected) {
ObjectPtr obj(new Integer(value));
- CPPUNIT_ASSERT_EQUAL(expected, format(pattern, obj));
+ LOGUNIT_ASSERT_EQUAL(expected, format(pattern, obj));
}
void testFormatInteger1() {
@@ -187,5 +185,5 @@
// See bug LOGCXX-204
//
#if !defined(_MSC_VER) || _MSC_VER > 1200
-CPPUNIT_TEST_SUITE_REGISTRATION(FileNamePatternTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(FileNamePatternTestCase);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/rolling/filterbasedrollingtest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rolling/filterbasedrollingtest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rolling/filterbasedrollingtest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rolling/filterbasedrollingtest.cpp Mon Jan 28 10:40:19 2008
@@ -15,10 +15,8 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include "../util/compare.h"
+#include "../logunit.h"
#include "../insertwide.h"
#include <log4cxx/logmanager.h>
#include <log4cxx/xml/domconfigurator.h>
@@ -44,11 +42,11 @@
* @since 1.3
*
*/
-class FilterBasedRollingTest : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(FilterBasedRollingTest);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
- CPPUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(FilterBasedRollingTest) {
+ LOGUNIT_TEST_SUITE(FilterBasedRollingTest);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST_SUITE_END();
public:
void tearDown() {
@@ -133,14 +131,14 @@
//
// test was constructed to mimic SizeBasedRollingTest.test2
//
- CPPUNIT_ASSERT_EQUAL(true,
+ LOGUNIT_ASSERT_EQUAL(true,
Compare::compare(baseName + LOG4CXX_STR(".log"), LogString(LOG4CXX_STR("witness/rolling/sbr-test2.log"))));
- CPPUNIT_ASSERT_EQUAL(true,
+ LOGUNIT_ASSERT_EQUAL(true,
Compare::compare(baseName + LOG4CXX_STR(".0"), LogString(LOG4CXX_STR("witness/rolling/sbr-test2.0"))));
- CPPUNIT_ASSERT_EQUAL(true,
+ LOGUNIT_ASSERT_EQUAL(true,
Compare::compare(baseName + LOG4CXX_STR(".1"), LogString(LOG4CXX_STR("witness/rolling/sbr-test2.1"))));
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(FilterBasedRollingTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(FilterBasedRollingTest);
Modified: logging/log4cxx/trunk/src/test/cpp/rolling/manualrollingtest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rolling/manualrollingtest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rolling/manualrollingtest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rolling/manualrollingtest.cpp Mon Jan 28 10:40:19 2008
@@ -14,11 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include "../util/compare.h"
#include "../insertwide.h"
+#include "../logunit.h"
#include <apr_time.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/xml/domconfigurator.h>
@@ -48,15 +46,15 @@
* @author Curt Arnold
*
*/
- class ManualRollingTest : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(ManualRollingTest);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
+LOGUNIT_CLASS(ManualRollingTest) {
+ LOGUNIT_TEST_SUITE(ManualRollingTest);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
// TODO: Compression not yet implemented
-// CPPUNIT_TEST(test3);
- CPPUNIT_TEST(test4);
- CPPUNIT_TEST(test5);
- CPPUNIT_TEST_SUITE_END();
+// LOGUNIT_TEST(test3);
+ LOGUNIT_TEST(test4);
+ LOGUNIT_TEST(test5);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr root;
LoggerPtr logger;
@@ -119,14 +117,14 @@
common(rfa, p, logger);
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test1.0").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test1.1").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test1.2").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test1.0"),
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test1.0").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test1.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test1.2").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test1.0"),
File("witness/rolling/sbr-test2.log")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test1.1"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test1.1"),
File("witness/rolling/sbr-test2.0")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test1.2"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test1.2"),
File("witness/rolling/sbr-test2.1")));
}
@@ -147,15 +145,15 @@
common(rfa, p, logger);
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test2.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test2.log.1").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test2.log.2").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test2.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test2.log.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test2.log.2").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test2.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test2.log"),
File("witness/rolling/sbr-test2.log")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test2.log.1"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test2.log.1"),
File("witness/rolling/sbr-test2.0")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test2.log.2"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test2.log.2"),
File("witness/rolling/sbr-test2.1")));
}
@@ -181,13 +179,13 @@
common(rfa, p, logger);
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test3.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test3.0.gz").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test3.1.gz").exists(p));
-
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test3.log"), File("witness/rolling/sbr-test3.log")));
- CPPUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.0.gz").length(p), File("output/manual-test3.0.gz").length(p));
- CPPUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.1.gz").length(p), File("output/manual-test3.1.gz").length(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test3.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test3.0.gz").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test3.1.gz").exists(p));
+
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test3.log"), File("witness/rolling/sbr-test3.log")));
+ LOGUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.0.gz").length(p), File("output/manual-test3.0.gz").length(p));
+ LOGUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.1.gz").length(p), File("output/manual-test3.1.gz").length(p));
}
/**
@@ -218,9 +216,9 @@
common(rfa, p, logger);
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test4.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test4.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test4.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test4.log"),
File("witness/rolling/sbr-test4.log")));
}
@@ -264,17 +262,17 @@
//
// looks like platform where open files can be renamed
//
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.0").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.1").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.2").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.3").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.0").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.2").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.3").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.log"),
File("witness/rolling/sbr-test2.log")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.0"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.0"),
File("witness/rolling/sbr-test2.0")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.1"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.1"),
File("witness/rolling/sbr-test2.1")));
} else {
@@ -283,11 +281,11 @@
// so initial log file should have all log content
// open file should be unaffected
// stray file should have only been moved one slot.
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.0").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/manual-test5.2").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.0").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/manual-test5.2").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/manual-test5.log"),
File("witness/rolling/sbr-test4.log")));
}
}
@@ -295,4 +293,4 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(ManualRollingTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(ManualRollingTest);
Modified: logging/log4cxx/trunk/src/test/cpp/rolling/obsoletedailyrollingfileappendertest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rolling/obsoletedailyrollingfileappendertest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rolling/obsoletedailyrollingfileappendertest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rolling/obsoletedailyrollingfileappendertest.cpp Mon Jan 28 10:40:19 2008
@@ -15,11 +15,9 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include "../util/compare.h"
#include "../insertwide.h"
+#include "../logunit.h"
#include <apr_time.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/xml/domconfigurator.h>
@@ -48,11 +46,11 @@
* @author Curt Arnold
*
*/
-class ObsoleteDailyRollingFileAppenderTest : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(ObsoleteDailyRollingFileAppenderTest);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
- CPPUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(ObsoleteDailyRollingFileAppenderTest) {
+ LOGUNIT_TEST_SUITE(ObsoleteDailyRollingFileAppenderTest);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -81,7 +79,7 @@
}
int postCount = getFileCount("output", LOG4CXX_STR("obsoleteDRFA-test1.log."));
- CPPUNIT_ASSERT_EQUAL(true, postCount > preCount);
+ LOGUNIT_ASSERT_EQUAL(true, postCount > preCount);
}
/**
@@ -114,7 +112,7 @@
}
int postCount = getFileCount("output", LOG4CXX_STR("obsoleteDRFA-test2.log."));
- CPPUNIT_ASSERT_EQUAL(true, postCount > preCount);
+ LOGUNIT_ASSERT_EQUAL(true, postCount > preCount);
}
private:
@@ -133,5 +131,5 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(ObsoleteDailyRollingFileAppenderTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(ObsoleteDailyRollingFileAppenderTest);
Modified: logging/log4cxx/trunk/src/test/cpp/rolling/obsoleterollingfileappendertest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rolling/obsoleterollingfileappendertest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rolling/obsoleterollingfileappendertest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rolling/obsoleterollingfileappendertest.cpp Mon Jan 28 10:40:19 2008
@@ -14,11 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include "../util/compare.h"
#include "../insertwide.h"
+#include "../logunit.h"
#include <apr_time.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/xml/domconfigurator.h>
@@ -44,13 +42,13 @@
* @author Curt Arnold
*
*/
- class ObsoleteRollingFileAppenderTest : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(ObsoleteRollingFileAppenderTest);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
- CPPUNIT_TEST(testIsOptionHandler);
- CPPUNIT_TEST(testClassForName);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_CLASS(ObsoleteRollingFileAppenderTest) {
+ LOGUNIT_TEST_SUITE(ObsoleteRollingFileAppenderTest);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST(testIsOptionHandler);
+ LOGUNIT_TEST(testClassForName);
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -83,8 +81,8 @@
}
Pool p;
- CPPUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test1.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test1.log.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test1.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test1.log.1").exists(p));
}
/**
@@ -122,8 +120,8 @@
}
}
- CPPUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test2.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test2.log.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test2.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/obsoleteRFA-test2.log.1").exists(p));
}
/**
@@ -132,15 +130,15 @@
*/
void testIsOptionHandler() {
RollingFileAppenderPtr rfa(new RollingFileAppender());
- CPPUNIT_ASSERT_EQUAL(true, rfa->instanceof(log4cxx::spi::OptionHandler::getStaticClass()));
+ LOGUNIT_ASSERT_EQUAL(true, rfa->instanceof(log4cxx::spi::OptionHandler::getStaticClass()));
}
void testClassForName() {
LogString className(LOG4CXX_STR("org.apache.log4j.RollingFileAppender"));
const Class& myclass = Class::forName(className);
- CPPUNIT_ASSERT_EQUAL(className, LogString(myclass.getName()));
+ LOGUNIT_ASSERT_EQUAL(className, LogString(myclass.getName()));
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(ObsoleteRollingFileAppenderTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(ObsoleteRollingFileAppenderTest);
Modified: logging/log4cxx/trunk/src/test/cpp/rolling/sizebasedrollingtest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rolling/sizebasedrollingtest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rolling/sizebasedrollingtest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rolling/sizebasedrollingtest.cpp Mon Jan 28 10:40:19 2008
@@ -14,11 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include "../util/compare.h"
#include "../insertwide.h"
+#include "../logunit.h"
#include <apr_time.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/xml/domconfigurator.h>
@@ -49,15 +47,15 @@
* @author Ceki Gülcü
*
*/
- class SizeBasedRollingTest : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(SizeBasedRollingTest);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
- CPPUNIT_TEST(test3);
- CPPUNIT_TEST(test4);
- CPPUNIT_TEST(test5);
- CPPUNIT_TEST(test6);
- CPPUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(SizeBasedRollingTest) {
+ LOGUNIT_TEST_SUITE(SizeBasedRollingTest);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST(test3);
+ LOGUNIT_TEST(test4);
+ LOGUNIT_TEST(test5);
+ LOGUNIT_TEST(test6);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr root;
LoggerPtr logger;
@@ -122,14 +120,14 @@
common(logger, 0);
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test1.0").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test1.1").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test1.2").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test1.0"),
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test1.0").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test1.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test1.2").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test1.0"),
File("witness/rolling/sbr-test2.log")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test1.1"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test1.1"),
File("witness/rolling/sbr-test2.0")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test1.2"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test1.2"),
File("witness/rolling/sbr-test2.1")));
}
@@ -161,15 +159,15 @@
common(logger, 0);
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test2.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test2.0").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test2.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test2.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test2.0").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test2.1").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test2.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test2.log"),
File("witness/rolling/sbr-test2.log")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test2.0"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test2.0"),
File("witness/rolling/sbr-test2.0")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test2.1"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test2.1"),
File("witness/rolling/sbr-test2.1")));
}
@@ -198,13 +196,13 @@
common(logger, 100);
- CPPUNIT_ASSERT_EQUAL(true, File("output/sbr-test3.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sbr-test3.0.gz").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sbr-test3.1.gz").exists(p));
-
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sbr-test3.log"), File("witness/rolling/sbr-test3.log")));
- CPPUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.0.gz").length(p), File("output/sbr-test3.0.gz").length(p));
- CPPUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.1.gz").length(p), File("output/sbr-test3.1.gz").length(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sbr-test3.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sbr-test3.0.gz").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sbr-test3.1.gz").exists(p));
+
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sbr-test3.log"), File("witness/rolling/sbr-test3.log")));
+ LOGUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.0.gz").length(p), File("output/sbr-test3.0.gz").length(p));
+ LOGUNIT_ASSERT_EQUAL(File("witness/rolling/sbr-test3.1.gz").length(p), File("output/sbr-test3.1.gz").length(p));
}
/**
@@ -238,9 +236,9 @@
common(logger, 0);
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test4.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test4.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test4.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test4.log"),
File("witness/rolling/sbr-test4.log")));
}
@@ -287,17 +285,17 @@
//
// looks like platform where open files can be renamed
//
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.0").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.1").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.2").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.3").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.0").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.1").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.2").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.3").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.log"),
File("witness/rolling/sbr-test2.log")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.0"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.0"),
File("witness/rolling/sbr-test2.0")));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.1"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.1"),
File("witness/rolling/sbr-test2.1")));
} else {
@@ -306,11 +304,11 @@
// so initial log file should have all log content
// open file should be unaffected
// stray file should have only been moved one slot.
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.0").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.2").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.0").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sizeBased-test5.2").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.log"),
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sizeBased-test5.log"),
File("witness/rolling/sbr-test4.log")));
}
}
@@ -340,14 +338,14 @@
common(logger, 100);
- CPPUNIT_ASSERT_EQUAL(true, File("output/sbr-test6.log").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sbr-test6.0.zip").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File("output/sbr-test6.1.zip").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sbr-test6.log").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sbr-test6.0.zip").exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File("output/sbr-test6.1.zip").exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sbr-test6.log"), File("witness/rolling/sbr-test3.log")));
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File("output/sbr-test6.log"), File("witness/rolling/sbr-test3.log")));
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(SizeBasedRollingTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(SizeBasedRollingTest);
Modified: logging/log4cxx/trunk/src/test/cpp/rolling/timebasedrollingtest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rolling/timebasedrollingtest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rolling/timebasedrollingtest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rolling/timebasedrollingtest.cpp Mon Jan 28 10:40:19 2008
@@ -15,8 +15,6 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/rolling/rollingfileappender.h>
#include <log4cxx/logger.h>
#include <log4cxx/consoleappender.h>
@@ -27,6 +25,7 @@
#include <iostream>
#include <log4cxx/helpers/stringhelper.h>
#include "../util/compare.h"
+#include "../logunit.h"
#include <apr_strings.h>
@@ -62,16 +61,16 @@
* </pre>
* @author Ceki Gülcü
*/
-class TimeBasedRollingTest : public CppUnit::TestFixture {
+LOGUNIT_CLASS(TimeBasedRollingTest) {
- CPPUNIT_TEST_SUITE(TimeBasedRollingTest);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
- CPPUNIT_TEST(test3);
- CPPUNIT_TEST(test4);
- CPPUNIT_TEST(test5);
- CPPUNIT_TEST(test6);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(TimeBasedRollingTest);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST(test3);
+ LOGUNIT_TEST(test4);
+ LOGUNIT_TEST(test5);
+ LOGUNIT_TEST(test6);
+ LOGUNIT_TEST_SUITE_END();
static LoggerPtr logger;
@@ -131,7 +130,7 @@
for (int i = 0; i < 4; i++) {
LogString witness(LOG4CXX_STR("witness/rolling/tbr-test1."));
StringHelper::toString(i, pool, witness);
- CPPUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
+ LOGUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
}
}
@@ -197,7 +196,7 @@
for (int i = 0; i < 4; i++) {
LogString witness(LOG4CXX_STR("witness/rolling/tbr-test2."));
StringHelper::toString(i, pool, witness);
- CPPUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
+ LOGUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
}
}
@@ -242,11 +241,11 @@
apr_sleep(APR_USEC_PER_SEC/2);
} }
- CPPUNIT_ASSERT_EQUAL(true, File(filenames[0]).exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File(filenames[1]).exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File(filenames[2]).exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File(filenames[0]).exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File(filenames[1]).exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File(filenames[2]).exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File(filenames[3]), File(LOG4CXX_STR("witness/rolling/tbr-test3.3"))));
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File(filenames[3]), File(LOG4CXX_STR("witness/rolling/tbr-test3.3"))));
}
/**
@@ -316,7 +315,7 @@
for (int i = 0; i < 4; i++) {
LogString witness(LOG4CXX_STR("witness/rolling/tbr-test4."));
StringHelper::toString(i, pool, witness);
- CPPUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
+ LOGUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
}
}
@@ -365,7 +364,7 @@
for (int i = 0; i < 4; i++) {
LogString witness(LOG4CXX_STR("witness/rolling/tbr-test5."));
StringHelper::toString(i, pool, witness);
- CPPUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
+ LOGUNIT_ASSERT(Compare::compare(filenames[i], File(witness)));
}
}
@@ -411,11 +410,11 @@
apr_sleep(APR_USEC_PER_SEC/2);
} }
- CPPUNIT_ASSERT_EQUAL(true, File(filenames[0]).exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File(filenames[1]).exists(p));
- CPPUNIT_ASSERT_EQUAL(true, File(filenames[2]).exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File(filenames[0]).exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File(filenames[1]).exists(p));
+ LOGUNIT_ASSERT_EQUAL(true, File(filenames[2]).exists(p));
- CPPUNIT_ASSERT_EQUAL(true, Compare::compare(File(filenames[3]), File(LOG4CXX_STR("witness/rolling/tbr-test6.3"))));
+ LOGUNIT_ASSERT_EQUAL(true, Compare::compare(File(filenames[3]), File(LOG4CXX_STR("witness/rolling/tbr-test6.3"))));
}
@@ -440,4 +439,4 @@
LoggerPtr TimeBasedRollingTest::logger(Logger::getLogger("org.apache.log4j.TimeBasedRollingTest"));
-//CPPUNIT_TEST_SUITE_REGISTRATION(TimeBasedRollingTest);
+//LOGUNIT_TEST_SUITE_REGISTRATION(TimeBasedRollingTest);
Modified: logging/log4cxx/trunk/src/test/cpp/rollingfileappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/rollingfileappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/rollingfileappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/rollingfileappendertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -15,8 +15,6 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/rolling/rollingfileappender.h>
#include "fileappendertestcase.h"
@@ -28,14 +26,14 @@
*/
class RollingFileAppenderTestCase : public FileAppenderAbstractTestCase
{
- CPPUNIT_TEST_SUITE(RollingFileAppenderTestCase);
+ LOGUNIT_TEST_SUITE(RollingFileAppenderTestCase);
//
// tests inherited from AppenderSkeletonTestCase
//
- CPPUNIT_TEST(testDefaultThreshold);
- CPPUNIT_TEST(testSetOptionThreshold);
+ LOGUNIT_TEST(testDefaultThreshold);
+ LOGUNIT_TEST(testSetOptionThreshold);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -45,4 +43,4 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(RollingFileAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(RollingFileAppenderTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/spi/loggingeventtest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/spi/loggingeventtest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/spi/loggingeventtest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/spi/loggingeventtest.cpp Mon Jan 28 10:40:19 2008
@@ -14,14 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/spi/loggingevent.h>
#include "../util/serializationtesthelper.h"
#include <log4cxx/logmanager.h>
#include <log4cxx/ndc.h>
#include <log4cxx/mdc.h>
+#include "../logunit.h"
using namespace log4cxx;
using namespace log4cxx::helpers;
@@ -33,14 +31,14 @@
/**
Unit tests for LoggingEvent
*/
-class LoggingEventTest : public CppUnit::TestFixture
+LOGUNIT_CLASS(LoggingEventTest)
{
- CPPUNIT_TEST_SUITE(LoggingEventTest);
- CPPUNIT_TEST(testSerializationSimple);
- CPPUNIT_TEST(testSerializationWithLocation);
- CPPUNIT_TEST(testSerializationNDC);
- CPPUNIT_TEST(testSerializationMDC);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(LoggingEventTest);
+ LOGUNIT_TEST(testSerializationSimple);
+ LOGUNIT_TEST(testSerializationWithLocation);
+ LOGUNIT_TEST(testSerializationNDC);
+ LOGUNIT_TEST(testSerializationMDC);
+ LOGUNIT_TEST_SUITE_END();
public:
void setUp() {
@@ -67,7 +65,7 @@
new LoggingEvent(
root, Level::getInfo(), LOG4CXX_STR("Hello, world."), LocationInfo::getLocationUnavailable());
- CPPUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
+ LOGUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
"witness/serialization/simple.bin", event, 237));
}
@@ -84,7 +82,7 @@
new LoggingEvent(
root, Level::getInfo(), LOG4CXX_STR("Hello, world."), LOG4CXX_LOCATION);
- CPPUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
+ LOGUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
"witness/serialization/location.bin", event, 237));
}
@@ -101,7 +99,7 @@
new LoggingEvent(
root, Level::getInfo(), LOG4CXX_STR("Hello, world."), LocationInfo::getLocationUnavailable());
- CPPUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
+ LOGUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
"witness/serialization/ndc.bin", event, 237));
}
@@ -118,10 +116,10 @@
new LoggingEvent(
root, Level::getInfo(), LOG4CXX_STR("Hello, world."), LocationInfo::getLocationUnavailable());
- CPPUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
+ LOGUNIT_ASSERT_EQUAL(true, SerializationTestHelper::compare(
"witness/serialization/mdc.bin", event, 237));
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(LoggingEventTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(LoggingEventTest);
Modified: logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,14 +16,13 @@
*/
#include <ostream>
#include <iomanip>
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
#include "vectorappender.h"
#include <log4cxx/logmanager.h>
#include <log4cxx/simplelayout.h>
#include <log4cxx/spi/loggingevent.h>
#include "insertwide.h"
+#include "logunit.h"
#include <log4cxx/stream.h>
#if LOG4CXX_CFSTRING_API
@@ -56,67 +55,67 @@
/**
Unit tests for the optional stream-like interface for log4cxx
*/
-class StreamTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(StreamTestCase)
{
- CPPUNIT_TEST_SUITE(StreamTestCase);
- CPPUNIT_TEST(testSimple);
- CPPUNIT_TEST(testMultiple);
- CPPUNIT_TEST(testShortCircuit);
- CPPUNIT_TEST_EXCEPTION(testInsertException, std::exception);
- CPPUNIT_TEST(testScientific);
- CPPUNIT_TEST(testPrecision);
- CPPUNIT_TEST(testWidth);
+ LOGUNIT_TEST_SUITE(StreamTestCase);
+ LOGUNIT_TEST(testSimple);
+ LOGUNIT_TEST(testMultiple);
+ LOGUNIT_TEST(testShortCircuit);
+ LOGUNIT_TEST_EXCEPTION(testInsertException, std::exception);
+ LOGUNIT_TEST(testScientific);
+ LOGUNIT_TEST(testPrecision);
+ LOGUNIT_TEST(testWidth);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(testWide);
- CPPUNIT_TEST(testWideAppend);
- CPPUNIT_TEST(testWideWidth);
+ LOGUNIT_TEST(testWide);
+ LOGUNIT_TEST(testWideAppend);
+ LOGUNIT_TEST(testWideWidth);
#endif
- CPPUNIT_TEST(testBaseFlags);
- CPPUNIT_TEST(testBasePrecisionAndWidth);
- CPPUNIT_TEST(testLogStreamSimple);
- CPPUNIT_TEST(testLogStreamMultiple);
- CPPUNIT_TEST(testLogStreamShortCircuit);
- CPPUNIT_TEST_EXCEPTION(testLogStreamInsertException, std::exception);
- CPPUNIT_TEST(testLogStreamScientific);
- CPPUNIT_TEST(testLogStreamPrecision);
- CPPUNIT_TEST(testLogStreamWidth);
- CPPUNIT_TEST(testLogStreamDelegate);
- CPPUNIT_TEST(testLogStreamFormattingPersists);
- CPPUNIT_TEST(testSetWidthInsert);
+ LOGUNIT_TEST(testBaseFlags);
+ LOGUNIT_TEST(testBasePrecisionAndWidth);
+ LOGUNIT_TEST(testLogStreamSimple);
+ LOGUNIT_TEST(testLogStreamMultiple);
+ LOGUNIT_TEST(testLogStreamShortCircuit);
+ LOGUNIT_TEST_EXCEPTION(testLogStreamInsertException, std::exception);
+ LOGUNIT_TEST(testLogStreamScientific);
+ LOGUNIT_TEST(testLogStreamPrecision);
+ LOGUNIT_TEST(testLogStreamWidth);
+ LOGUNIT_TEST(testLogStreamDelegate);
+ LOGUNIT_TEST(testLogStreamFormattingPersists);
+ LOGUNIT_TEST(testSetWidthInsert);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(testWLogStreamSimple);
- CPPUNIT_TEST(testWLogStreamMultiple);
- CPPUNIT_TEST(testWLogStreamShortCircuit);
- CPPUNIT_TEST_EXCEPTION(testWLogStreamInsertException, std::exception);
- CPPUNIT_TEST(testWLogStreamScientific);
- CPPUNIT_TEST(testWLogStreamPrecision);
- CPPUNIT_TEST(testWLogStreamWidth);
- CPPUNIT_TEST(testWLogStreamDelegate);
- CPPUNIT_TEST(testWLogStreamFormattingPersists);
- CPPUNIT_TEST(testWSetWidthInsert);
+ LOGUNIT_TEST(testWLogStreamSimple);
+ LOGUNIT_TEST(testWLogStreamMultiple);
+ LOGUNIT_TEST(testWLogStreamShortCircuit);
+ LOGUNIT_TEST_EXCEPTION(testWLogStreamInsertException, std::exception);
+ LOGUNIT_TEST(testWLogStreamScientific);
+ LOGUNIT_TEST(testWLogStreamPrecision);
+ LOGUNIT_TEST(testWLogStreamWidth);
+ LOGUNIT_TEST(testWLogStreamDelegate);
+ LOGUNIT_TEST(testWLogStreamFormattingPersists);
+ LOGUNIT_TEST(testWSetWidthInsert);
#endif
#if LOG4CXX_UNICHAR_API
- CPPUNIT_TEST(testUniChar);
- CPPUNIT_TEST(testUniCharAppend);
-// CPPUNIT_TEST(testUniCharWidth);
- CPPUNIT_TEST(testULogStreamSimple);
- CPPUNIT_TEST(testULogStreamMultiple);
- CPPUNIT_TEST(testULogStreamShortCircuit);
- CPPUNIT_TEST_EXCEPTION(testULogStreamInsertException, std::exception);
-// CPPUNIT_TEST(testULogStreamScientific);
-// CPPUNIT_TEST(testULogStreamPrecision);
-// CPPUNIT_TEST(testULogStreamWidth);
- CPPUNIT_TEST(testULogStreamDelegate);
-// CPPUNIT_TEST(testULogStreamFormattingPersists);
-// CPPUNIT_TEST(testUSetWidthInsert);
+ LOGUNIT_TEST(testUniChar);
+ LOGUNIT_TEST(testUniCharAppend);
+// LOGUNIT_TEST(testUniCharWidth);
+ LOGUNIT_TEST(testULogStreamSimple);
+ LOGUNIT_TEST(testULogStreamMultiple);
+ LOGUNIT_TEST(testULogStreamShortCircuit);
+ LOGUNIT_TEST_EXCEPTION(testULogStreamInsertException, std::exception);
+// LOGUNIT_TEST(testULogStreamScientific);
+// LOGUNIT_TEST(testULogStreamPrecision);
+// LOGUNIT_TEST(testULogStreamWidth);
+ LOGUNIT_TEST(testULogStreamDelegate);
+// LOGUNIT_TEST(testULogStreamFormattingPersists);
+// LOGUNIT_TEST(testUSetWidthInsert);
#endif
#if LOG4CXX_CFSTRING_API
- CPPUNIT_TEST(testCFString);
- CPPUNIT_TEST(testCFStringAppend);
- CPPUNIT_TEST(testULogStreamCFString);
- CPPUNIT_TEST(testULogStreamCFString2);
+ LOGUNIT_TEST(testCFString);
+ LOGUNIT_TEST(testCFStringAppend);
+ LOGUNIT_TEST(testULogStreamCFString);
+ LOGUNIT_TEST(testULogStreamCFString2);
#endif
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE_END();
VectorAppenderPtr vectorAppender;
@@ -136,13 +135,13 @@
void testSimple() {
LoggerPtr root(Logger::getRootLogger());
LOG4CXX_INFO(root, "This is a test");
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testMultiple() {
LoggerPtr root(Logger::getRootLogger());
LOG4CXX_INFO(root, "This is a test" << ": Details to follow");
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testShortCircuit() {
@@ -150,7 +149,7 @@
logger->setLevel(Level::getInfo());
ExceptionOnInsert someObj;
LOG4CXX_DEBUG(logger, someObj);
- CPPUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
}
void testInsertException() {
@@ -164,7 +163,7 @@
LOG4CXX_INFO(root, std::scientific << 0.000001115);
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
msg.find(LOG4CXX_STR("E-")) != LogString::npos);
}
@@ -173,7 +172,7 @@
LOG4CXX_INFO(root, std::setprecision(4) << 1.000001);
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
}
@@ -182,7 +181,7 @@
LOG4CXX_INFO(root, '[' << std::fixed << std::setprecision(2) << std::setw(7) << std::right << std::setfill('_') << 10.0 << ']');
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
}
void testBaseFlags() {
@@ -196,12 +195,12 @@
if (base1.set_stream_state(os1b, fillchar)) {
os1b.fill(fillchar);
}
- CPPUNIT_ASSERT_EQUAL(os1a.flags(), os1b.flags());
+ LOGUNIT_ASSERT_EQUAL(os1a.flags(), os1b.flags());
os2a << std::noboolalpha;
if (base2.set_stream_state(os2b, fillchar)) {
os2b.fill(fillchar);
}
- CPPUNIT_ASSERT_EQUAL(os2a.flags(), os2b.flags());
+ LOGUNIT_ASSERT_EQUAL(os2a.flags(), os2b.flags());
}
@@ -220,19 +219,19 @@
os2 << 3.1415926;
string expected(os1.str());
string actual(os2.str());
- CPPUNIT_ASSERT_EQUAL(expected, actual);
+ LOGUNIT_ASSERT_EQUAL(expected, actual);
}
void testLogStreamSimple() {
logstream root(Logger::getRootLogger(), Level::getInfo());
root << "This is a test" << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testLogStreamMultiple() {
logstream root(Logger::getRootLogger(), Level::getInfo());
root << "This is a test" << ": Details to follow" << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testLogStreamShortCircuit() {
@@ -241,7 +240,7 @@
logstream os(logger, Level::getDebug());
ExceptionOnInsert someObj;
os << someObj << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
}
void testLogStreamInsertException() {
@@ -257,7 +256,7 @@
os << std::scientific << 0.000001115 << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
msg.find(LOG4CXX_STR("E-")) != LogString::npos);
}
@@ -267,7 +266,7 @@
os << std::setprecision(4) << 1.000001 << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
}
@@ -277,7 +276,7 @@
os << '[' << std::fixed << std::setprecision(2) << std::setw(7) << std::right << std::setfill('_') << 10.0 << ']' << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
}
void report(std::ostream& os) {
@@ -289,7 +288,7 @@
logstream root(Logger::getRootLogger(), Level::getInfo());
report(root);
root << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testLogStreamFormattingPersists() {
@@ -300,7 +299,7 @@
os << Level::getInfo() << 16 << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("10")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("10")), msg);
}
void testSetWidthInsert() {
@@ -308,7 +307,7 @@
root->setLevel(Level::getInfo());
logstream os(root, Level::getInfo());
os << std::setw(5);
- CPPUNIT_ASSERT_EQUAL(5, os.width());
+ LOGUNIT_ASSERT_EQUAL(5, os.width());
}
@@ -317,13 +316,13 @@
void testWide() {
LoggerPtr root(Logger::getRootLogger());
LOG4CXX_INFO(root, L"This is a test");
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testWideAppend() {
LoggerPtr root(Logger::getRootLogger());
LOG4CXX_INFO(root, L"This is a test" << L": Details to follow");
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testWideWidth() {
@@ -331,19 +330,19 @@
LOG4CXX_INFO(root, L'[' << std::fixed << std::setprecision(2) << std::setw(7) << std::right << std::setfill(L'_') << 10.0 << L"]");
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
}
void testWLogStreamSimple() {
wlogstream root(Logger::getRootLogger(), Level::getInfo());
root << L"This is a test" << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testWLogStreamMultiple() {
wlogstream root(Logger::getRootLogger(), Level::getInfo());
root << L"This is a test" << L": Details to follow" << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testWLogStreamShortCircuit() {
@@ -352,7 +351,7 @@
wlogstream os(logger, Level::getDebug());
ExceptionOnInsert someObj;
os << someObj << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
}
void testWLogStreamInsertException() {
@@ -368,7 +367,7 @@
os << std::scientific << 0.000001115 << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
msg.find(LOG4CXX_STR("E-")) != LogString::npos);
}
@@ -378,7 +377,7 @@
os << std::setprecision(4) << 1.000001 << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
}
@@ -388,7 +387,7 @@
os << L"[" << std::fixed << std::setprecision(2) << std::setw(7) << std::right << std::setfill(L'_') << 10.0 << L"]" << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
}
void wreport(std::basic_ostream<wchar_t>& os) {
@@ -400,7 +399,7 @@
wlogstream root(Logger::getRootLogger(), Level::getInfo());
wreport(root);
root << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testWLogStreamFormattingPersists() {
@@ -411,7 +410,7 @@
os << Level::getInfo() << 16 << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("10")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("10")), msg);
}
void testWSetWidthInsert() {
@@ -419,7 +418,7 @@
root->setLevel(Level::getInfo());
wlogstream os(root, Level::getInfo());
os << std::setw(5);
- CPPUNIT_ASSERT_EQUAL(5, os.width());
+ LOGUNIT_ASSERT_EQUAL(5, os.width());
}
#endif
@@ -429,7 +428,7 @@
LoggerPtr root(Logger::getRootLogger());
const UniChar msg[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
LOG4CXX_INFO(root, msg);
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testUniCharAppend() {
@@ -437,7 +436,7 @@
const UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
const UniChar msg2[] = { ':', ' ', 'D', 'e', 't', 'a', 'i', 'l', 's', ' ', 't', 'o', ' ', 'f', 'o', 'l', 'l', 'o', 'w', 0 };
LOG4CXX_INFO(root, msg1 << msg2);
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testUniCharWidth() {
@@ -447,14 +446,14 @@
LOG4CXX_INFO(root, openBracket << std::fixed << std::setprecision(2) << std::setw(7) << std::right << std::setfill((UniChar) '_') << 10.0 << closeBracket);
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
}
void testULogStreamSimple() {
ulogstream root(Logger::getRootLogger(), Level::getInfo());
const UniChar msg[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
root << msg << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testULogStreamMultiple() {
@@ -462,7 +461,7 @@
const UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
const UniChar msg2[] = { ':', ' ', 'D', 'e', 't', 'a', 'i', 'l', 's', ' ', 't', 'o', ' ', 'f', 'o', 'l', 'l', 'o', 'w', 0 };
root << msg1 << msg2 << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testULogStreamShortCircuit() {
@@ -471,7 +470,7 @@
ulogstream os(logger, Level::getDebug());
ExceptionOnInsert someObj;
os << someObj << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
}
void testULogStreamInsertException() {
@@ -485,10 +484,10 @@
LoggerPtr root(Logger::getRootLogger());
ulogstream os(root, Level::getInfo());
os << std::scientific << 0.000001115 << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("e-")) != LogString::npos ||
msg.find(LOG4CXX_STR("E-")) != LogString::npos);
}
@@ -496,10 +495,10 @@
LoggerPtr root(Logger::getRootLogger());
ulogstream os(root, Level::getInfo());
os << std::setprecision(4) << 1.000001 << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
+ LOGUNIT_ASSERT(msg.find(LOG4CXX_STR("1.00000")) == LogString::npos);
}
@@ -511,10 +510,10 @@
os << openBracket << std::fixed << std::setprecision(2) << std::setw(7) << std::right
<< std::setfill((UniChar) '_') << 10.0 << closeBracket << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
}
void ureport(std::basic_ostream<UniChar>& os) {
@@ -528,7 +527,7 @@
ulogstream root(Logger::getRootLogger(), Level::getInfo());
ureport(root);
root << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testULogStreamFormattingPersists() {
@@ -537,10 +536,10 @@
ulogstream os(root, Level::getDebug());
os << std::hex << 20 << LOG4CXX_ENDMSG;
os << Level::getInfo() << 16 << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("10")), msg);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("10")), msg);
}
void testUSetWidthInsert() {
@@ -548,7 +547,7 @@
root->setLevel(Level::getInfo());
ulogstream os(root, Level::getInfo());
os << std::setw(5);
- CPPUNIT_ASSERT_EQUAL(5, os.width());
+ LOGUNIT_ASSERT_EQUAL(5, os.width());
}
#endif
@@ -557,31 +556,31 @@
void testCFString() {
LoggerPtr root(Logger::getRootLogger());
LOG4CXX_INFO(root, CFSTR("This is a test"));
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testCFStringAppend() {
LoggerPtr root(Logger::getRootLogger());
LOG4CXX_INFO(root, CFSTR("This is a test") << CFSTR(": Details to follow"));
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testULogStreamCFString() {
ulogstream root(Logger::getRootLogger(), Level::getInfo());
root << CFSTR("This is a test") << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testULogStreamCFString2() {
ulogstream root(Logger::getRootLogger(), Level::getInfo());
root << CFSTR("This is a test") << CFSTR(": Details to follow") << LOG4CXX_ENDMSG;
- CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
#endif
};
-CPPUNIT_TEST_SUITE_REGISTRATION(StreamTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(StreamTestCase);
#if !LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE
Modified: logging/log4cxx/trunk/src/test/cpp/util/binarycompare.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/util/binarycompare.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/util/binarycompare.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/util/binarycompare.cpp Mon Jan 28 10:40:19 2008
@@ -1,8 +1,7 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
+ * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
@@ -18,7 +17,7 @@
#include "binarycompare.h"
#include <apr_file_io.h>
#include <log4cxx/helpers/pool.h>
-#include <cppunit/extensions/HelperMacros.h>
+#include "../logunit.h"
#include <apr_pools.h>
#include <apr_strings.h>
@@ -36,14 +35,14 @@
apr_status_t stat1 = apr_file_open(&file1,
filename1, flags, perm, (apr_pool_t*) pool);
if (stat1 != APR_SUCCESS) {
- CPPUNIT_FAIL(std::string("Unable to open ") + filename1);
+ LOGUNIT_FAIL(std::string("Unable to open ") + filename1);
}
apr_file_t* file2;
apr_status_t stat2 = apr_file_open(&file2,
filename2, flags, perm, (apr_pool_t*) pool);
if (stat2 != APR_SUCCESS) {
- CPPUNIT_FAIL(std::string("Unable to open ") + filename2);
+ LOGUNIT_FAIL(std::string("Unable to open ") + filename2);
}
enum { BUFSIZE = 1024 };
@@ -56,12 +55,12 @@
stat1 = apr_file_read(file1, contents1, &bytesRead1);
if (stat1 != APR_SUCCESS) {
- CPPUNIT_FAIL(std::string("Unable to read ") + filename1);
+ LOGUNIT_FAIL(std::string("Unable to read ") + filename1);
}
stat2 = apr_file_read(file2, contents2, &bytesRead2);
if (stat2 != APR_SUCCESS) {
- CPPUNIT_FAIL(std::string("Unable to read ") + filename2);
+ LOGUNIT_FAIL(std::string("Unable to read ") + filename2);
}
for (int i = 0; i < BUFSIZE; i++) {
@@ -77,7 +76,7 @@
msg += "] has ";
msg += apr_itoa(pool, contents2[i]);
msg += ".";
- CPPUNIT_FAIL(msg);
+ LOGUNIT_FAIL(msg);
}
}
}
Modified: logging/log4cxx/trunk/src/test/cpp/varia/errorhandlertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/varia/errorhandlertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/varia/errorhandlertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/varia/errorhandlertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -18,13 +18,9 @@
#define LOG4CXX_TEST 1
#include <log4cxx/private/log4cxx_private.h>
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/xml/domconfigurator.h>
-
+#include "../logunit.h"
#include "../util/transformer.h"
#include "../util/compare.h"
#include "../util/controlfilter.h"
@@ -43,11 +39,11 @@
"^[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\},[0-9]\\{3\\} " \
"\\[main]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message [0-9]"
-class ErrorHandlerTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(ErrorHandlerTestCase)
{
- CPPUNIT_TEST_SUITE(ErrorHandlerTestCase);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(ErrorHandlerTestCase);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr root;
LoggerPtr logger;
@@ -97,7 +93,7 @@
}
const File witness("witness/fallback");
- CPPUNIT_ASSERT(Compare::compare(FILTERED, witness));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, witness));
}
void common()
@@ -134,7 +130,7 @@
//TODO: Not sure this test ever worked. 0.9.7 didn't call common
// had nothing that attempted to dispatch any log events
-//CPPUNIT_TEST_SUITE_REGISTRATION(ErrorHandlerTestCase);
+//LOGUNIT_TEST_SUITE_REGISTRATION(ErrorHandlerTestCase);
const File ErrorHandlerTestCase::TEMP("output/temp");
const File ErrorHandlerTestCase::FILTERED("output/filtered");
Modified: logging/log4cxx/trunk/src/test/cpp/varia/levelmatchfiltertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/varia/levelmatchfiltertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/varia/levelmatchfiltertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/varia/levelmatchfiltertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -15,8 +15,7 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
+#include "../logunit.h"
#include <log4cxx/logger.h>
#include <log4cxx/simplelayout.h>
@@ -37,12 +36,12 @@
using namespace log4cxx::helpers;
using namespace log4cxx::filter;
-class LevelMatchFilterTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(LevelMatchFilterTestCase)
{
- CPPUNIT_TEST_SUITE(LevelMatchFilterTestCase);
- CPPUNIT_TEST(accept);
- CPPUNIT_TEST(deny);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(LevelMatchFilterTestCase);
+ LOGUNIT_TEST(accept);
+ LOGUNIT_TEST(deny);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr root;
LoggerPtr logger;
@@ -99,7 +98,7 @@
common(sbuf);
}
- CPPUNIT_ASSERT(Compare::compare(ACCEPT_FILE, ACCEPT_WITNESS));
+ LOGUNIT_ASSERT(Compare::compare(ACCEPT_FILE, ACCEPT_WITNESS));
}
void deny()
@@ -139,7 +138,7 @@
common(sbuf);
}
- CPPUNIT_ASSERT(Compare::compare(DENY_FILE, DENY_WITNESS));
+ LOGUNIT_ASSERT(Compare::compare(DENY_FILE, DENY_WITNESS));
}
void common(const LogString& msg)
@@ -166,4 +165,4 @@
const LogString LevelMatchFilterTestCase::DENY_WITNESS(LOG4CXX_STR("witness/LevelMatchFilter_deny"));
-CPPUNIT_TEST_SUITE_REGISTRATION(LevelMatchFilterTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(LevelMatchFilterTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/varia/levelrangefiltertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/varia/levelrangefiltertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/varia/levelrangefiltertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/varia/levelrangefiltertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -15,9 +15,6 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/simplelayout.h>
#include <log4cxx/fileappender.h>
@@ -30,6 +27,7 @@
#include <log4cxx/helpers/stringhelper.h>
#include <log4cxx/helpers/transcoder.h>
#include "../testchar.h"
+#include "../logunit.h"
#include <log4cxx/spi/loggerrepository.h>
using namespace log4cxx;
@@ -38,12 +36,12 @@
-class LevelRangeFilterTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(LevelRangeFilterTestCase)
{
- CPPUNIT_TEST_SUITE(LevelRangeFilterTestCase);
- CPPUNIT_TEST(accept);
- CPPUNIT_TEST(neutral);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(LevelRangeFilterTestCase);
+ LOGUNIT_TEST(accept);
+ LOGUNIT_TEST(neutral);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr root;
LoggerPtr logger;
@@ -143,7 +141,7 @@
}
- CPPUNIT_ASSERT(Compare::compare(ACCEPT_FILE, ACCEPT_WITNESS));
+ LOGUNIT_ASSERT(Compare::compare(ACCEPT_FILE, ACCEPT_WITNESS));
}
void neutral()
@@ -230,7 +228,7 @@
}
}
- CPPUNIT_ASSERT(Compare::compare(NEUTRAL_FILE, NEUTRAL_WITNESS));
+ LOGUNIT_ASSERT(Compare::compare(NEUTRAL_FILE, NEUTRAL_WITNESS));
}
void common(const LogString& msg)
@@ -256,4 +254,4 @@
const LogString LevelRangeFilterTestCase::NEUTRAL_FILE(LOG4CXX_STR("output/LevelRangeFilter_neutral"));
const LogString LevelRangeFilterTestCase::NEUTRAL_WITNESS(LOG4CXX_STR("witness/LevelRangeFilter_neutral"));
-CPPUNIT_TEST_SUITE_REGISTRATION(LevelRangeFilterTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(LevelRangeFilterTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,7 +16,6 @@
*/
#include "writerappendertestcase.h"
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/helpers/objectptr.h>
#include <log4cxx/writerappender.h>
Modified: logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.h?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.h (original)
+++ logging/log4cxx/trunk/src/test/cpp/writerappendertestcase.h Mon Jan 28 10:40:19 2008
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
#include <log4cxx/writerappender.h>
#include "appenderskeletontestcase.h"