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 [2/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/helpers/optionconvertertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.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/helpers/optionconverter.h>
#include <log4cxx/helpers/properties.h>
#include <log4cxx/helpers/system.h>
@@ -25,6 +22,7 @@
#include <log4cxx/helpers/pool.h>
#include "../testchar.h"
#include "../insertwide.h"
+#include "../logunit.h"
#include <stdlib.h>
#include <apr_pools.h>
#include <apr_file_io.h>
@@ -38,21 +36,21 @@
#define MAX 1000
-class OptionConverterTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(OptionConverterTestCase)
{
- CPPUNIT_TEST_SUITE(OptionConverterTestCase);
- CPPUNIT_TEST(varSubstTest1);
- CPPUNIT_TEST(varSubstTest2);
- CPPUNIT_TEST(varSubstTest3);
- CPPUNIT_TEST(varSubstTest4);
- CPPUNIT_TEST(varSubstTest5);
- CPPUNIT_TEST(testTmpDir);
+ LOGUNIT_TEST_SUITE(OptionConverterTestCase);
+ LOGUNIT_TEST(varSubstTest1);
+ LOGUNIT_TEST(varSubstTest2);
+ LOGUNIT_TEST(varSubstTest3);
+ LOGUNIT_TEST(varSubstTest4);
+ LOGUNIT_TEST(varSubstTest5);
+ LOGUNIT_TEST(testTmpDir);
#if APR_HAS_USER
- CPPUNIT_TEST(testUserHome);
- CPPUNIT_TEST(testUserName);
+ LOGUNIT_TEST(testUserHome);
+ LOGUNIT_TEST(testUserName);
#endif
- CPPUNIT_TEST(testUserDir);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST(testUserDir);
+ LOGUNIT_TEST_SUITE_END();
Properties props;
Properties nullProperties;
@@ -75,29 +73,29 @@
char* toto;
apr_status_t stat = apr_env_get(&toto, "TOTO",
(apr_pool_t*) p.getAPRPool());
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
- CPPUNIT_ASSERT_EQUAL(std::string("wonderful"), (std::string) toto);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(std::string("wonderful"), (std::string) toto);
char* key1;
stat = apr_env_get(&key1, "key1",
(apr_pool_t*) p.getAPRPool());
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
- CPPUNIT_ASSERT_EQUAL(std::string("value1"), (std::string) key1);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(std::string("value1"), (std::string) key1);
char* key2;
stat = apr_env_get(&key2, "key2",
(apr_pool_t*) p.getAPRPool());
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
- CPPUNIT_ASSERT_EQUAL(std::string("value2"), (std::string) key2);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(std::string("value2"), (std::string) key2);
}
void varSubstTest1()
{
envCheck();
LogString r(OptionConverter::substVars(LOG4CXX_STR("hello world."), nullProperties));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello world."), r);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello world."), r);
r = OptionConverter::substVars(LOG4CXX_STR("hello ${TOTO} world."), nullProperties);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello wonderful world."), r);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello wonderful world."), r);
}
@@ -106,7 +104,7 @@
envCheck();
LogString r(OptionConverter::substVars(LOG4CXX_STR("Test2 ${key1} mid ${key2} end."),
nullProperties));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test2 value1 mid value2 end."), r);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test2 value1 mid value2 end."), r);
}
@@ -115,7 +113,7 @@
envCheck();
LogString r(OptionConverter::substVars(
LOG4CXX_STR("Test3 ${unset} mid ${key1} end."), nullProperties));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test3 mid value1 end."), r);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test3 mid value1 end."), r);
}
@@ -130,7 +128,7 @@
catch(IllegalArgumentException& e)
{
std::string witness("\"Test4 ${incomplete \" has no closing brace. Opening brace at position 6.");
- CPPUNIT_ASSERT_EQUAL(witness, (std::string) e.what());
+ LOGUNIT_ASSERT_EQUAL(witness, (std::string) e.what());
}
}
@@ -141,7 +139,7 @@
props1.setProperty(LOG4CXX_STR("p1"), LOG4CXX_STR("x1"));
props1.setProperty(LOG4CXX_STR("p2"), LOG4CXX_STR("${p1}"));
LogString res = OptionConverter::substVars(LOG4CXX_STR("${p2}"), props1);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("x1"), res);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("x1"), res);
}
void testTmpDir()
@@ -150,15 +148,15 @@
LOG4CXX_STR("${java.io.tmpdir}"), nullProperties));
apr_pool_t* p;
apr_status_t stat = apr_pool_create(&p, NULL);
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
const char* tmpdir = NULL;
stat = apr_temp_dir_get(&tmpdir, p);
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
LogString expected;
Transcoder::decode(tmpdir, expected);
apr_pool_destroy(p);
- CPPUNIT_ASSERT_EQUAL(expected, actual);
+ LOGUNIT_ASSERT_EQUAL(expected, actual);
}
#if APR_HAS_USER
@@ -167,7 +165,7 @@
LOG4CXX_STR("${user.home}"), nullProperties));
apr_pool_t* p;
apr_status_t stat = apr_pool_create(&p, NULL);
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
apr_uid_t userid;
apr_gid_t groupid;
@@ -181,7 +179,7 @@
if (stat == APR_SUCCESS) {
LogString expected;
Transcoder::decode(dirname, expected);
- CPPUNIT_ASSERT_EQUAL(expected, actual);
+ LOGUNIT_ASSERT_EQUAL(expected, actual);
}
}
}
@@ -194,7 +192,7 @@
LOG4CXX_STR("${user.name}"), nullProperties));
apr_pool_t* p;
apr_status_t stat = apr_pool_create(&p, NULL);
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
apr_uid_t userid;
apr_gid_t groupid;
@@ -205,7 +203,7 @@
if (stat == APR_SUCCESS) {
LogString expected;
Transcoder::decode(username, expected);
- CPPUNIT_ASSERT_EQUAL(expected, actual);
+ LOGUNIT_ASSERT_EQUAL(expected, actual);
}
}
apr_pool_destroy(p);
@@ -217,18 +215,18 @@
LOG4CXX_STR("${user.dir}"), nullProperties));
apr_pool_t* p;
apr_status_t stat = apr_pool_create(&p, NULL);
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
char* dirname = NULL;
stat = apr_filepath_get(&dirname, APR_FILEPATH_NATIVE, p);
- CPPUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+ LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
LogString expected;
Transcoder::decode(dirname, expected);
apr_pool_destroy(p);
- CPPUNIT_ASSERT_EQUAL(expected, actual);
+ LOGUNIT_ASSERT_EQUAL(expected, actual);
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(OptionConverterTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(OptionConverterTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/propertiestestcase.cpp Mon Jan 28 10:40:19 2008
@@ -15,20 +15,20 @@
* limitations under the License.
*/
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/helpers/properties.h>
#include <log4cxx/helpers/fileinputstream.h>
#include "../insertwide.h"
+#include "../logunit.h"
using namespace log4cxx;
using namespace log4cxx::helpers;
-class PropertiesTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(PropertiesTestCase)
{
- CPPUNIT_TEST_SUITE(PropertiesTestCase);
- CPPUNIT_TEST(testLoad1);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(PropertiesTestCase);
+ LOGUNIT_TEST(testLoad1);
+ LOGUNIT_TEST_SUITE_END();
public:
void testLoad1() {
@@ -39,9 +39,9 @@
Properties properties;
properties.load(propFile);
LogString pattern(properties.getProperty(LOG4CXX_STR("log4j.appender.testAppender.layout.ConversionPattern")));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("%-5p - %m%n"), pattern);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("%-5p - %m%n"), pattern);
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(PropertiesTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(PropertiesTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/relativetimedateformattestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/relativetimedateformattestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/relativetimedateformattestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/relativetimedateformattestcase.cpp Mon Jan 28 10:40:19 2008
@@ -18,10 +18,10 @@
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/relativetimedateformat.h>
#include <log4cxx/spi/loggingevent.h>
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/helpers/pool.h>
#include <log4cxx/helpers/stringhelper.h>
#include "../insertwide.h"
+#include "../logunit.h"
#include <log4cxx/helpers/date.h>
@@ -35,12 +35,12 @@
Unit test {@link RelativeTimeDateFormat} class.
@author Curt Arnold
@since 1.3.0 */
-class RelativeTimeDateFormatTestCase : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(RelativeTimeDateFormatTestCase);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
- CPPUNIT_TEST(test3);
- CPPUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(RelativeTimeDateFormatTestCase) {
+ LOGUNIT_TEST_SUITE(RelativeTimeDateFormatTestCase);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST(test3);
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -63,8 +63,8 @@
log4cxx_time_t elapsed = log4cxx::helpers::StringHelper::toInt64(actual);
- CPPUNIT_ASSERT(preStartTime + elapsed*1000 > jan2 - 2000);
- CPPUNIT_ASSERT(preStartTime + elapsed*1000 < jan2 + 2000);
+ LOGUNIT_ASSERT(preStartTime + elapsed*1000 > jan2 - 2000);
+ LOGUNIT_ASSERT(preStartTime + elapsed*1000 < jan2 + 2000);
}
@@ -76,7 +76,7 @@
Pool p;
RelativeTimeDateFormat formatter;
formatter.numberFormat(numb, 87, p);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
}
@@ -90,5 +90,5 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(RelativeTimeDateFormatTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(RelativeTimeDateFormatTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/stringhelpertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/stringhelpertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/stringhelpertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/stringhelpertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -17,8 +17,8 @@
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/stringhelper.h>
-#include <cppunit/extensions/HelperMacros.h>
#include "../insertwide.h"
+#include "../logunit.h"
using namespace log4cxx;
@@ -31,18 +31,18 @@
*/
class StringHelperTestCase : public CppUnit::TestFixture
{
- CPPUNIT_TEST_SUITE( StringHelperTestCase );
- CPPUNIT_TEST( testStartsWith1 );
- CPPUNIT_TEST( testStartsWith2 );
- CPPUNIT_TEST( testStartsWith3 );
- CPPUNIT_TEST( testStartsWith4 );
- CPPUNIT_TEST( testStartsWith5 );
- CPPUNIT_TEST( testEndsWith1 );
- CPPUNIT_TEST( testEndsWith2 );
- CPPUNIT_TEST( testEndsWith3 );
- CPPUNIT_TEST( testEndsWith4 );
- CPPUNIT_TEST( testEndsWith5 );
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE( StringHelperTestCase );
+ LOGUNIT_TEST( testStartsWith1 );
+ LOGUNIT_TEST( testStartsWith2 );
+ LOGUNIT_TEST( testStartsWith3 );
+ LOGUNIT_TEST( testStartsWith4 );
+ LOGUNIT_TEST( testStartsWith5 );
+ LOGUNIT_TEST( testEndsWith1 );
+ LOGUNIT_TEST( testEndsWith2 );
+ LOGUNIT_TEST( testEndsWith3 );
+ LOGUNIT_TEST( testEndsWith4 );
+ LOGUNIT_TEST( testEndsWith5 );
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -51,35 +51,35 @@
* Check that startsWith("foobar", "foo") returns true.
*/
void testStartsWith1() {
- CPPUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foo")));
+ LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foo")));
}
/**
* Check that startsWith("bar", "foobar") returns false.
*/
void testStartsWith2() {
- CPPUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foo"), LOG4CXX_STR("foobar")));
+ LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foo"), LOG4CXX_STR("foobar")));
}
/**
* Check that startsWith("foobar", "foobar") returns true.
*/
void testStartsWith3() {
- CPPUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
+ LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
}
/**
* Check that startsWith("foobar", "") returns true.
*/
void testStartsWith4() {
- CPPUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
+ LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
}
/**
* Check that startsWith("foobar", "abc") returns false.
*/
void testStartsWith5() {
- CPPUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
+ LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
}
@@ -88,39 +88,39 @@
* Check that endsWith("foobar", "bar") returns true.
*/
void testEndsWith1() {
- CPPUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("bar")));
+ LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("bar")));
}
/**
* Check that endsWith("bar", "foobar") returns false.
*/
void testEndsWith2() {
- CPPUNIT_ASSERT_EQUAL(false, StringHelper::endsWith(LOG4CXX_STR("bar"), LOG4CXX_STR("foobar")));
+ LOGUNIT_ASSERT_EQUAL(false, StringHelper::endsWith(LOG4CXX_STR("bar"), LOG4CXX_STR("foobar")));
}
/**
* Check that endsWith("foobar", "foobar") returns true.
*/
void testEndsWith3() {
- CPPUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
+ LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
}
/**
* Check that endsWith("foobar", "") returns true.
*/
void testEndsWith4() {
- CPPUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
+ LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
}
/**
* Check that endsWith("foobar", "abc") returns false.
*/
void testEndsWith5() {
- CPPUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
+ LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(StringHelperTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(StringHelperTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/stringtokenizertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/stringtokenizertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/stringtokenizertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/stringtokenizertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,28 +16,27 @@
*/
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/stringtokenizer.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
+#include "../logunit.h"
#include "../insertwide.h"
using namespace log4cxx;
using namespace log4cxx::helpers;
-class StringTokenizerTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(StringTokenizerTestCase)
{
- CPPUNIT_TEST_SUITE(StringTokenizerTestCase);
- CPPUNIT_TEST(testNextTokenEmptyString);
- CPPUNIT_TEST(testHasMoreTokensEmptyString);
- CPPUNIT_TEST(testNextTokenAllDelim);
- CPPUNIT_TEST(testHasMoreTokensAllDelim);
- 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(StringTokenizerTestCase);
+ LOGUNIT_TEST(testNextTokenEmptyString);
+ LOGUNIT_TEST(testHasMoreTokensEmptyString);
+ LOGUNIT_TEST(testNextTokenAllDelim);
+ LOGUNIT_TEST(testHasMoreTokensAllDelim);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
+ LOGUNIT_TEST(test3);
+ LOGUNIT_TEST(test4);
+ LOGUNIT_TEST(test5);
+ LOGUNIT_TEST(test6);
+ LOGUNIT_TEST_SUITE_END();
public:
void testNextTokenEmptyString() {
@@ -49,14 +48,14 @@
} catch (NoSuchElementException &ex) {
return;
}
- CPPUNIT_ASSERT(false);
+ LOGUNIT_ASSERT(false);
}
void testHasMoreTokensEmptyString() {
LogString src;
LogString delim(LOG4CXX_STR(" "));
StringTokenizer tokenizer(src, delim);
- CPPUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
+ LOGUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
}
void testNextTokenAllDelim() {
@@ -68,31 +67,31 @@
} catch (NoSuchElementException &ex) {
return;
}
- CPPUNIT_ASSERT(false);
+ LOGUNIT_ASSERT(false);
}
void testHasMoreTokensAllDelim() {
LogString src(LOG4CXX_STR("==="));
LogString delim(LOG4CXX_STR("="));
StringTokenizer tokenizer(src, delim);
- CPPUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
+ LOGUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
}
void testBody(const LogString& src, const LogString& delim) {
StringTokenizer tokenizer(src, delim);
- CPPUNIT_ASSERT_EQUAL(true, tokenizer.hasMoreTokens());
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("log4j"), tokenizer.nextToken());
- CPPUNIT_ASSERT_EQUAL(true, tokenizer.hasMoreTokens());
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("properties"), tokenizer.nextToken());
- CPPUNIT_ASSERT_EQUAL(true, tokenizer.hasMoreTokens());
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("txt"), tokenizer.nextToken());
- CPPUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
+ LOGUNIT_ASSERT_EQUAL(true, tokenizer.hasMoreTokens());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("log4j"), tokenizer.nextToken());
+ LOGUNIT_ASSERT_EQUAL(true, tokenizer.hasMoreTokens());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("properties"), tokenizer.nextToken());
+ LOGUNIT_ASSERT_EQUAL(true, tokenizer.hasMoreTokens());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("txt"), tokenizer.nextToken());
+ LOGUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
try {
LogString token(tokenizer.nextToken());
} catch (NoSuchElementException& ex) {
return;
}
- CPPUNIT_ASSERT(false);
+ LOGUNIT_ASSERT(false);
}
void test1() {
@@ -133,4 +132,4 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(StringTokenizerTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(StringTokenizerTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/syslogwritertest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/syslogwritertest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/syslogwritertest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/syslogwritertest.cpp Mon Jan 28 10:40:19 2008
@@ -15,18 +15,18 @@
* limitations under the License.
*/
-#include <cppunit/extensions/HelperMacros.h>
+#include "../logunit.h"
#include <log4cxx/helpers/syslogwriter.h>
using namespace log4cxx;
using namespace log4cxx::helpers;
-class SyslogWriterTest : public CppUnit::TestFixture
+LOGUNIT_CLASS(SyslogWriterTest)
{
- CPPUNIT_TEST_SUITE(SyslogWriterTest);
- CPPUNIT_TEST(testUnknownHost);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(SyslogWriterTest);
+ LOGUNIT_TEST(testUnknownHost);
+ LOGUNIT_TEST_SUITE_END();
public:
/**
@@ -40,5 +40,5 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(SyslogWriterTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(SyslogWriterTest);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/timezonetestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/timezonetestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/timezonetestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/timezonetestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,8 +16,8 @@
*/
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/timezone.h>
-#include <cppunit/extensions/HelperMacros.h>
#include "../insertwide.h"
+#include "../logunit.h"
#include <apr_time.h>
using namespace log4cxx;
@@ -33,17 +33,17 @@
Unit test {@link TimeZone}.
@author Curt Arnold
@since 0.98 */
-class TimeZoneTestCase : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(TimeZoneTestCase);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST(test2);
+LOGUNIT_CLASS(TimeZoneTestCase) {
+ LOGUNIT_TEST_SUITE(TimeZoneTestCase);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST(test2);
#if !defined(__BORLANDC__)
- CPPUNIT_TEST(test3);
+ LOGUNIT_TEST(test3);
#endif
- CPPUNIT_TEST(test4);
- CPPUNIT_TEST(test5);
- CPPUNIT_TEST(test6);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST(test4);
+ LOGUNIT_TEST(test5);
+ LOGUNIT_TEST(test6);
+ LOGUNIT_TEST_SUITE_END();
#define MICROSECONDS_PER_DAY APR_INT64_C(86400000000)
@@ -54,7 +54,7 @@
*/
void test1() {
TimeZonePtr tz(TimeZone::getGMT());
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT"), tz->getID());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT"), tz->getID());
}
/**
@@ -62,13 +62,13 @@
*/
void test2() {
TimeZonePtr tz(TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT-06:00"), tz->getID());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT-06:00"), tz->getID());
apr_time_t jan2 = MICROSECONDS_PER_DAY * 12420;
apr_time_exp_t exploded;
tz->explode(&exploded, jan2);
- CPPUNIT_ASSERT_EQUAL(-6 * 3600, exploded.tm_gmtoff);
- CPPUNIT_ASSERT_EQUAL(18, exploded.tm_hour);
+ LOGUNIT_ASSERT_EQUAL(-6 * 3600, exploded.tm_gmtoff);
+ LOGUNIT_ASSERT_EQUAL(18, exploded.tm_hour);
}
/**
@@ -77,7 +77,7 @@
void test3() {
TimeZonePtr tz(TimeZone::getDefault());
LogString tzName(tz->getID());
- CPPUNIT_ASSERT(tzName.length() > 0);
+ LOGUNIT_ASSERT(tzName.length() > 0);
}
@@ -86,14 +86,14 @@
*/
void test4() {
TimeZonePtr tz(TimeZone::getTimeZone(LOG4CXX_STR("GMT+0010")));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT+00:10"), tz->getID());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT+00:10"), tz->getID());
apr_time_t jan2 = MICROSECONDS_PER_DAY * 12420;
apr_time_exp_t exploded;
tz->explode(&exploded, jan2);
- CPPUNIT_ASSERT_EQUAL(600, exploded.tm_gmtoff);
- CPPUNIT_ASSERT_EQUAL(0, exploded.tm_hour);
- CPPUNIT_ASSERT_EQUAL(10, exploded.tm_min);
+ LOGUNIT_ASSERT_EQUAL(600, exploded.tm_gmtoff);
+ LOGUNIT_ASSERT_EQUAL(0, exploded.tm_hour);
+ LOGUNIT_ASSERT_EQUAL(10, exploded.tm_min);
}
@@ -102,13 +102,13 @@
*/
void test5() {
TimeZonePtr tz(TimeZone::getTimeZone(LOG4CXX_STR("GMT+6")));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT+06:00"), tz->getID());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT+06:00"), tz->getID());
apr_time_t jan2 = MICROSECONDS_PER_DAY * 12420;
apr_time_exp_t exploded;
tz->explode(&exploded, jan2);
- CPPUNIT_ASSERT_EQUAL(6 * 3600, exploded.tm_gmtoff);
- CPPUNIT_ASSERT_EQUAL(6, exploded.tm_hour);
+ LOGUNIT_ASSERT_EQUAL(6 * 3600, exploded.tm_gmtoff);
+ LOGUNIT_ASSERT_EQUAL(6, exploded.tm_hour);
}
/**
@@ -116,11 +116,11 @@
*/
void test6() {
TimeZonePtr tz(TimeZone::getTimeZone(LOG4CXX_STR("GMT")));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT"), tz->getID());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("GMT"), tz->getID());
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(TimeZoneTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(TimeZoneTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -15,55 +15,53 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/helpers/transcoder.h>
#include "../insertwide.h"
+#include "../logunit.h"
using namespace log4cxx;
using namespace log4cxx::helpers;
-class TranscoderTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(TranscoderTestCase)
{
- CPPUNIT_TEST_SUITE(TranscoderTestCase);
- CPPUNIT_TEST(decode1);
+ LOGUNIT_TEST_SUITE(TranscoderTestCase);
+ LOGUNIT_TEST(decode1);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(decode2);
+ LOGUNIT_TEST(decode2);
#endif
- CPPUNIT_TEST(decode3);
+ LOGUNIT_TEST(decode3);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(decode4);
+ LOGUNIT_TEST(decode4);
#endif
- CPPUNIT_TEST(decode7);
- CPPUNIT_TEST(decode8);
+ LOGUNIT_TEST(decode7);
+ LOGUNIT_TEST(decode8);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(encode1);
+ LOGUNIT_TEST(encode1);
#endif
- CPPUNIT_TEST(encode2);
+ LOGUNIT_TEST(encode2);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(encode3);
+ LOGUNIT_TEST(encode3);
#endif
- CPPUNIT_TEST(encode4);
+ LOGUNIT_TEST(encode4);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(encode5);
+ LOGUNIT_TEST(encode5);
#endif
- CPPUNIT_TEST(encode6);
- CPPUNIT_TEST(testDecodeUTF8_1);
- CPPUNIT_TEST(testDecodeUTF8_2);
- CPPUNIT_TEST(testDecodeUTF8_3);
- CPPUNIT_TEST(testDecodeUTF8_4);
+ LOGUNIT_TEST(encode6);
+ LOGUNIT_TEST(testDecodeUTF8_1);
+ LOGUNIT_TEST(testDecodeUTF8_2);
+ LOGUNIT_TEST(testDecodeUTF8_3);
+ LOGUNIT_TEST(testDecodeUTF8_4);
#if LOG4CXX_UNICHAR_API
- CPPUNIT_TEST(udecode2);
- CPPUNIT_TEST(udecode4);
- CPPUNIT_TEST(uencode1);
- CPPUNIT_TEST(uencode3);
- CPPUNIT_TEST(uencode5);
+ LOGUNIT_TEST(udecode2);
+ LOGUNIT_TEST(udecode4);
+ LOGUNIT_TEST(uencode1);
+ LOGUNIT_TEST(uencode3);
+ LOGUNIT_TEST(uencode5);
#endif
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -71,7 +69,7 @@
const char* greeting = "Hello, World";
LogString decoded(LOG4CXX_STR("foo\n"));
Transcoder::decode(greeting, decoded);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\nHello, World"), decoded);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\nHello, World"), decoded);
}
#if LOG4CXX_WCHAR_T_API
@@ -79,7 +77,7 @@
const wchar_t* greeting = L"Hello, World";
LogString decoded(LOG4CXX_STR("foo\n"));
Transcoder::decode(greeting, decoded);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\nHello, World"), decoded);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\nHello, World"), decoded);
}
#endif
@@ -87,7 +85,7 @@
const char* nothing = "";
LogString decoded(LOG4CXX_STR("foo\n"));
Transcoder::decode(nothing, decoded);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\n"), decoded);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\n"), decoded);
}
#if LOG4CXX_WCHAR_T_API
@@ -95,7 +93,7 @@
const wchar_t* nothing = L"";
LogString decoded(LOG4CXX_STR("foo\n"));
Transcoder::decode(nothing, decoded);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\n"), decoded);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\n"), decoded);
}
#endif
@@ -110,10 +108,10 @@
longMsg.append("Hello");
LogString decoded;
Transcoder::decode(longMsg, decoded);
- CPPUNIT_ASSERT_EQUAL((size_t) BUFSIZE + 3, decoded.length());
- CPPUNIT_ASSERT_EQUAL(LogString(BUFSIZE -2, LOG4CXX_STR('A')),
+ LOGUNIT_ASSERT_EQUAL((size_t) BUFSIZE + 3, decoded.length());
+ LOGUNIT_ASSERT_EQUAL(LogString(BUFSIZE -2, LOG4CXX_STR('A')),
decoded.substr(0, BUFSIZE - 2));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Hello"),
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Hello"),
decoded.substr(BUFSIZE -2 ));
}
@@ -122,7 +120,7 @@
LogString actual;
Transcoder::decode(msg, actual);
LogString expected(LOG4CXX_STR("Hello, World."));
- CPPUNIT_ASSERT_EQUAL(expected, actual);
+ LOGUNIT_ASSERT_EQUAL(expected, actual);
}
@@ -131,7 +129,7 @@
const LogString greeting(LOG4CXX_STR("Hello, World"));
std::wstring encoded;
Transcoder::encode(greeting, encoded);
- CPPUNIT_ASSERT_EQUAL((std::wstring) L"Hello, World", encoded);
+ LOGUNIT_ASSERT_EQUAL((std::wstring) L"Hello, World", encoded);
}
#endif
@@ -139,7 +137,7 @@
const LogString greeting(LOG4CXX_STR("Hello, World"));
std::string encoded;
Transcoder::encode(greeting, encoded);
- CPPUNIT_ASSERT_EQUAL((std::string) "Hello, World", encoded);
+ LOGUNIT_ASSERT_EQUAL((std::string) "Hello, World", encoded);
}
#if LOG4CXX_WCHAR_T_API
@@ -149,8 +147,8 @@
std::wstring encoded;
Transcoder::encode(greeting, encoded);
std::wstring manyAs(BUFSIZE - 3, L'A');
- CPPUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
- CPPUNIT_ASSERT_EQUAL(std::wstring(L"Hello"), encoded.substr(BUFSIZE - 3));
+ LOGUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
+ LOGUNIT_ASSERT_EQUAL(std::wstring(L"Hello"), encoded.substr(BUFSIZE - 3));
}
#endif
@@ -160,8 +158,8 @@
std::string encoded;
Transcoder::encode(greeting, encoded);
std::string manyAs(BUFSIZE - 3, 'A');
- CPPUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
- CPPUNIT_ASSERT_EQUAL(std::string("Hello"), encoded.substr(BUFSIZE - 3));
+ LOGUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
+ LOGUNIT_ASSERT_EQUAL(std::string("Hello"), encoded.substr(BUFSIZE - 3));
}
#if LOG4CXX_WCHAR_T_API
@@ -182,7 +180,7 @@
//
// should be lossless
//
- CPPUNIT_ASSERT_EQUAL((std::wstring) greeting, encoded);
+ LOGUNIT_ASSERT_EQUAL((std::wstring) greeting, encoded);
}
#endif
@@ -222,21 +220,21 @@
std::string src("a");
LogString out;
Transcoder::decodeUTF8(src, out);
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("a")), out);
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("a")), out);
}
void testDecodeUTF8_2() {
std::string src(1, 0x80);
LogString out;
Transcoder::decodeUTF8(src, out);
- CPPUNIT_ASSERT_EQUAL(LogString(1, Transcoder::LOSSCHAR), out);
+ LOGUNIT_ASSERT_EQUAL(LogString(1, Transcoder::LOSSCHAR), out);
}
void testDecodeUTF8_3() {
std::string src("\xC2");
LogString out;
Transcoder::decodeUTF8(src, out);
- CPPUNIT_ASSERT_EQUAL(LogString(1, Transcoder::LOSSCHAR), out);
+ LOGUNIT_ASSERT_EQUAL(LogString(1, Transcoder::LOSSCHAR), out);
}
void testDecodeUTF8_4() {
@@ -245,8 +243,8 @@
Transcoder::decodeUTF8(src, out);
LogString::const_iterator iter = out.begin();
unsigned int sv = Transcoder::decode(out, iter);
- CPPUNIT_ASSERT_EQUAL((unsigned int) 0xA9, sv);
- CPPUNIT_ASSERT_EQUAL(true, iter == out.end());
+ LOGUNIT_ASSERT_EQUAL((unsigned int) 0xA9, sv);
+ LOGUNIT_ASSERT_EQUAL(true, iter == out.end());
}
@@ -255,14 +253,14 @@
const UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
LogString decoded(LOG4CXX_STR("foo\n"));
Transcoder::decode(greeting, decoded);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\nHello, World"), decoded);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\nHello, World"), decoded);
}
void udecode4() {
const UniChar nothing[] = { 0 };
LogString decoded(LOG4CXX_STR("foo\n"));
Transcoder::decode(nothing, decoded);
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\n"), decoded);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("foo\n"), decoded);
}
void uencode1() {
@@ -270,7 +268,7 @@
std::basic_string<UniChar> encoded;
Transcoder::encode(greeting, encoded);
const UniChar expected[] = { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
- CPPUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(expected), encoded);
+ LOGUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(expected), encoded);
}
void uencode3() {
@@ -279,9 +277,9 @@
std::basic_string<UniChar> encoded;
Transcoder::encode(greeting, encoded);
std::basic_string<UniChar> manyAs(BUFSIZE - 3, 'A');
- CPPUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
+ LOGUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
const UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
- CPPUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(hello), encoded.substr(BUFSIZE - 3));
+ LOGUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(hello), encoded.substr(BUFSIZE - 3));
}
void uencode5() {
@@ -301,11 +299,11 @@
//
// should be lossless
//
- CPPUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(greeting), encoded);
+ LOGUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(greeting), encoded);
}
#endif
};
-CPPUNIT_TEST_SUITE_REGISTRATION(TranscoderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(TranscoderTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/hierarchytest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/hierarchytest.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/hierarchytest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/hierarchytest.cpp Mon Jan 28 10:40:19 2008
@@ -16,11 +16,9 @@
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/hierarchy.h>
+#include "logunit.h"
#include "insertwide.h"
using namespace log4cxx;
@@ -29,10 +27,10 @@
* Tests hierarchy.
* @author Curt Arnold
*/
-class HierarchyTest : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(HierarchyTest);
- CPPUNIT_TEST(testGetParent);
- CPPUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(HierarchyTest) {
+ LOGUNIT_TEST_SUITE(HierarchyTest);
+ LOGUNIT_TEST(testGetParent);
+ LOGUNIT_TEST_SUITE_END();
public:
/**
@@ -43,17 +41,17 @@
// Note: test inspired by LOGCXX-118.
//
LoggerPtr logger1(Logger::getLogger("HierarchyTest_testGetParent.logger1"));
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("root")), logger1->getParent()->getName());
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("root")), logger1->getParent()->getName());
LoggerPtr logger2(Logger::getLogger("HierarchyTest_testGetParent.logger2"));
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("root")), logger1->getParent()->getName());
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("root")), logger1->getParent()->getName());
LoggerPtr logger3(Logger::getLogger("HierarchyTest_testGetParent"));
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("HierarchyTest_testGetParent")),
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("HierarchyTest_testGetParent")),
logger1->getParent()->getName());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("HierarchyTest_testGetParent")),
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("HierarchyTest_testGetParent")),
logger2->getParent()->getName());
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(HierarchyTest);
+LOGUNIT_TEST_SUITE_REGISTRATION(HierarchyTest);
Modified: logging/log4cxx/trunk/src/test/cpp/hierarchythresholdtestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/hierarchythresholdtestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/hierarchythresholdtestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/hierarchythresholdtestcase.cpp Mon Jan 28 10:40:19 2008
@@ -15,13 +15,11 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/propertyconfigurator.h>
#include "util/compare.h"
#include "xml/xlevel.h"
+#include "logunit.h"
#include "testchar.h"
#include <log4cxx/spi/loggerrepository.h>
@@ -30,18 +28,18 @@
/**
Test the configuration of the hierarchy-wide threshold.
*/
-class HierarchyThresholdTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(HierarchyThresholdTestCase)
{
- CPPUNIT_TEST_SUITE(HierarchyThresholdTestCase);
- 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_SUITE_END();
+ LOGUNIT_TEST_SUITE(HierarchyThresholdTestCase);
+ 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_SUITE_END();
public:
@@ -58,56 +56,56 @@
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold1.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.1")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.1")));
}
void test2()
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold2.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.2")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.2")));
}
void test3()
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold3.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.3")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.3")));
}
void test4()
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold4.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.4")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.4")));
}
void test5()
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold5.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.5")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.5")));
}
void test6()
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold6.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.6")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.6")));
}
void test7()
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold7.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.7")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.7")));
}
void test8()
{
PropertyConfigurator::configure(LOG4CXX_FILE("input/hierarchyThreshold8.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.8")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, LOG4CXX_FILE("witness/hierarchyThreshold.8")));
}
static void common()
@@ -130,4 +128,4 @@
LoggerPtr HierarchyThresholdTestCase::logger =
Logger::getLogger(LOG4CXX_TEST_STR("HierarchyThresholdTestCase"));
-CPPUNIT_TEST_SUITE_REGISTRATION(HierarchyThresholdTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(HierarchyThresholdTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/l7dtestcase.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/helpers/propertyresourcebundle.h>
@@ -29,6 +26,7 @@
#include <sstream>
#include "testchar.h"
+#include "logunit.h"
#include <log4cxx/spi/loggerrepository.h>
@@ -37,11 +35,11 @@
using namespace log4cxx;
using namespace log4cxx::helpers;
-class L7dTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(L7dTestCase)
{
- CPPUNIT_TEST_SUITE(L7dTestCase);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(L7dTestCase);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST_SUITE_END();
LoggerPtr root;
ResourceBundlePtr bundles[3];
@@ -52,17 +50,17 @@
Locale localeUS(LOG4CXX_STR("en"), LOG4CXX_STR("US"));
bundles[0] =
ResourceBundle::getBundle(LOG4CXX_STR("L7D"), localeUS);
- CPPUNIT_ASSERT(bundles[0] != 0);
+ LOGUNIT_ASSERT(bundles[0] != 0);
Locale localeFR(LOG4CXX_STR("fr"), LOG4CXX_STR("FR"));
bundles[1] =
ResourceBundle::getBundle(LOG4CXX_STR("L7D"), localeFR);
- CPPUNIT_ASSERT(bundles[1] != 0);
+ LOGUNIT_ASSERT(bundles[1] != 0);
Locale localeCH(LOG4CXX_STR("fr"), LOG4CXX_STR("CH"));
bundles[2] =
ResourceBundle::getBundle(LOG4CXX_STR("L7D"), localeCH);
- CPPUNIT_ASSERT(bundles[2] != 0);
+ LOGUNIT_ASSERT(bundles[2] != 0);
root = Logger::getRootLogger();
}
@@ -98,10 +96,10 @@
LOG4CXX_L7DLOG(root, Level::getInfo(), LOG4CXX_TEST_STR("bogus2"));
}
- CPPUNIT_ASSERT(Compare::compare(LOG4CXX_FILE("output/temp"),
+ LOGUNIT_ASSERT(Compare::compare(LOG4CXX_FILE("output/temp"),
LOG4CXX_FILE("witness/l7d.1")));
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(L7dTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(L7dTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,11 +16,9 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/level.h>
#include "testchar.h"
+#include "logunit.h"
#if LOG4CXX_CFSTRING_API
#include <CoreFoundation/CFString.h>
@@ -28,46 +26,46 @@
using namespace log4cxx;
-class LevelTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(LevelTestCase)
{
- CPPUNIT_TEST_SUITE(LevelTestCase);
- CPPUNIT_TEST(testToLevelFatal);
- CPPUNIT_TEST(testTraceInt);
- CPPUNIT_TEST(testTrace);
- CPPUNIT_TEST(testIntToTrace);
- CPPUNIT_TEST(testStringToTrace);
+ LOGUNIT_TEST_SUITE(LevelTestCase);
+ LOGUNIT_TEST(testToLevelFatal);
+ LOGUNIT_TEST(testTraceInt);
+ LOGUNIT_TEST(testTrace);
+ LOGUNIT_TEST(testIntToTrace);
+ LOGUNIT_TEST(testStringToTrace);
#if LOG4CXX_WCHAR_T_API
- CPPUNIT_TEST(testWideStringToTrace);
+ LOGUNIT_TEST(testWideStringToTrace);
#endif
#if LOG4CXX_UNICHAR_API
- CPPUNIT_TEST(testUniCharStringToTrace);
+ LOGUNIT_TEST(testUniCharStringToTrace);
#endif
#if LOG4CXX_CFSTRING_API
- CPPUNIT_TEST(testCFStringToTrace);
+ LOGUNIT_TEST(testCFStringToTrace);
#endif
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE_END();
public:
void testToLevelFatal()
{
LevelPtr level(Level::toLevel(LOG4CXX_TEST_STR("fATal")));
- CPPUNIT_ASSERT_EQUAL((int) Level::FATAL_INT, level->toInt());
+ LOGUNIT_ASSERT_EQUAL((int) Level::FATAL_INT, level->toInt());
}
/**
* Tests Level::TRACE_INT.
*/
void testTraceInt() {
- CPPUNIT_ASSERT_EQUAL(5000, (int) Level::TRACE_INT);
+ LOGUNIT_ASSERT_EQUAL(5000, (int) Level::TRACE_INT);
}
/**
* Tests Level.TRACE.
*/
void testTrace() {
- CPPUNIT_ASSERT(Level::getTrace()->toString() == LOG4CXX_STR("TRACE"));
- CPPUNIT_ASSERT_EQUAL(5000, Level::getTrace()->toInt());
- CPPUNIT_ASSERT_EQUAL(7, Level::getTrace()->getSyslogEquivalent());
+ LOGUNIT_ASSERT(Level::getTrace()->toString() == LOG4CXX_STR("TRACE"));
+ LOGUNIT_ASSERT_EQUAL(5000, Level::getTrace()->toInt());
+ LOGUNIT_ASSERT_EQUAL(7, Level::getTrace()->getSyslogEquivalent());
}
/**
@@ -75,7 +73,7 @@
*/
void testIntToTrace() {
LevelPtr trace(Level::toLevel(5000));
- CPPUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
+ LOGUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
}
/**
@@ -83,7 +81,7 @@
*/
void testStringToTrace() {
LevelPtr trace(Level::toLevel("TRACE"));
- CPPUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
+ LOGUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
}
#if LOG4CXX_WCHAR_T_API
@@ -92,7 +90,7 @@
*/
void testWideStringToTrace() {
LevelPtr trace(Level::toLevel(L"TRACE"));
- CPPUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
+ LOGUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
}
#endif
@@ -103,7 +101,7 @@
void testUniCharStringToTrace() {
const UniChar name[] = { 'T', 'R', 'A', 'C', 'E', 0 };
LevelPtr trace(Level::toLevel(name));
- CPPUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
+ LOGUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
}
#endif
@@ -113,11 +111,11 @@
*/
void testCFStringToTrace() {
LevelPtr trace(Level::toLevel(CFSTR("TRACE")));
- CPPUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
+ LOGUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
}
#endif
};
-CPPUNIT_TEST_SUITE_REGISTRATION(LevelTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(LevelTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/loggertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/loggertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/loggertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/loggertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,9 +16,6 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/fileappender.h>
#include <log4cxx/appenderskeleton.h>
@@ -30,6 +27,7 @@
#include <log4cxx/helpers/propertyresourcebundle.h>
#include "insertwide.h"
#include "testchar.h"
+#include "logunit.h"
#include <log4cxx/helpers/locale.h>
#include "vectorappender.h"
@@ -58,23 +56,23 @@
{ return true; }
};
-class LoggerTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(LoggerTestCase)
{
- CPPUNIT_TEST_SUITE(LoggerTestCase);
- CPPUNIT_TEST(testAppender1);
- CPPUNIT_TEST(testAppender2);
- CPPUNIT_TEST(testAdditivity1);
- CPPUNIT_TEST(testAdditivity2);
- CPPUNIT_TEST(testAdditivity3);
- CPPUNIT_TEST(testDisable1);
-// CPPUNIT_TEST(testRB1);
-// CPPUNIT_TEST(testRB2); //TODO restore
-// CPPUNIT_TEST(testRB3);
- CPPUNIT_TEST(testExists);
- CPPUNIT_TEST(testHierarchy1);
- CPPUNIT_TEST(testTrace);
- CPPUNIT_TEST(testIsTraceEnabled);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(LoggerTestCase);
+ LOGUNIT_TEST(testAppender1);
+ LOGUNIT_TEST(testAppender2);
+ LOGUNIT_TEST(testAdditivity1);
+ LOGUNIT_TEST(testAdditivity2);
+ LOGUNIT_TEST(testAdditivity3);
+ LOGUNIT_TEST(testDisable1);
+// LOGUNIT_TEST(testRB1);
+// LOGUNIT_TEST(testRB2); //TODO restore
+// LOGUNIT_TEST(testRB3);
+ LOGUNIT_TEST(testExists);
+ LOGUNIT_TEST(testHierarchy1);
+ LOGUNIT_TEST(testTrace);
+ LOGUNIT_TEST(testIsTraceEnabled);
+ LOGUNIT_TEST_SUITE_END();
public:
void setUp()
@@ -101,7 +99,7 @@
AppenderList list = logger->getAllAppenders();
AppenderPtr aHat = list.front();
- CPPUNIT_ASSERT_EQUAL(a1, aHat);
+ LOGUNIT_ASSERT_EQUAL(a1, aHat);
}
/**
@@ -122,8 +120,8 @@
AppenderList list = logger->getAllAppenders();
AppenderPtr aHat = list.front();
- CPPUNIT_ASSERT_EQUAL(a2, aHat);
- CPPUNIT_ASSERT(list.size() == 1);
+ LOGUNIT_ASSERT_EQUAL(a2, aHat);
+ LOGUNIT_ASSERT(list.size() == 1);
}
/**
@@ -136,15 +134,15 @@
CountingAppenderPtr ca = new CountingAppender();
a->addAppender(ca);
- CPPUNIT_ASSERT_EQUAL(ca->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(ca->counter, 0);
ab->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(ca->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(ca->counter, 1);
ab->info(MSG);
- CPPUNIT_ASSERT_EQUAL(ca->counter, 2);
+ LOGUNIT_ASSERT_EQUAL(ca->counter, 2);
ab->warn(MSG);
- CPPUNIT_ASSERT_EQUAL(ca->counter, 3);
+ LOGUNIT_ASSERT_EQUAL(ca->counter, 3);
ab->error(MSG);
- CPPUNIT_ASSERT_EQUAL(ca->counter, 4);
+ LOGUNIT_ASSERT_EQUAL(ca->counter, 4);
}
/**
@@ -163,20 +161,20 @@
a->addAppender(ca1);
abc->addAppender(ca2);
- CPPUNIT_ASSERT_EQUAL(ca1->counter, 0);
- CPPUNIT_ASSERT_EQUAL(ca2->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(ca1->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(ca2->counter, 0);
ab->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(ca1->counter, 1);
- CPPUNIT_ASSERT_EQUAL(ca2->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(ca1->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(ca2->counter, 0);
abc->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(ca1->counter, 2);
- CPPUNIT_ASSERT_EQUAL(ca2->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(ca1->counter, 2);
+ LOGUNIT_ASSERT_EQUAL(ca2->counter, 1);
x->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(ca1->counter, 2);
- CPPUNIT_ASSERT_EQUAL(ca2->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(ca1->counter, 2);
+ LOGUNIT_ASSERT_EQUAL(ca2->counter, 1);
}
/**
@@ -198,26 +196,26 @@
a->addAppender(caA);
abc->addAppender(caABC);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0);
- CPPUNIT_ASSERT_EQUAL(caA->counter, 0);
- CPPUNIT_ASSERT_EQUAL(caABC->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(caA->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(caABC->counter, 0);
ab->setAdditivity(false);
a->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1);
- CPPUNIT_ASSERT_EQUAL(caA->counter, 1);
- CPPUNIT_ASSERT_EQUAL(caABC->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caA->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caABC->counter, 0);
ab->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1);
- CPPUNIT_ASSERT_EQUAL(caA->counter, 1);
- CPPUNIT_ASSERT_EQUAL(caABC->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caA->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caABC->counter, 0);
abc->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1);
- CPPUNIT_ASSERT_EQUAL(caA->counter, 1);
- CPPUNIT_ASSERT_EQUAL(caABC->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caA->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caABC->counter, 1);
}
void testDisable1()
@@ -230,59 +228,59 @@
//h.disableDebug();
h->setThreshold(Level::getInfo());
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 0);
root->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 0);
root->info(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 1);
root->log(Level::getWarn(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 2);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 2);
root->warn(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 3);
//h.disableInfo();
h->setThreshold(Level::getWarn());
root->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 3);
root->info(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 3);
root->log(Level::getWarn(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 4);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 4);
root->error(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 5);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 5);
root->log(Level::getError(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
//h.disableAll();
h->setThreshold(Level::getOff());
root->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->info(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->log(Level::getWarn(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->error(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->log(Level::getFatal(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->log(Level::getFatal(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
//h.disable(Level::getFatalLevel());
h->setThreshold(Level::getOff());
root->debug(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->info(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->log(Level::getWarn(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->error(MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->log(Level::getWarn(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->log(Level::getFatal(), MSG);
- CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
+ LOGUNIT_ASSERT_EQUAL(caRoot->counter, 6);
}
@@ -291,7 +289,7 @@
Locale l(lang, region);
ResourceBundlePtr bundle(
PropertyResourceBundle::getBundle(LOG4CXX_STR("L7D"),l));
- CPPUNIT_ASSERT(bundle != 0);
+ LOGUNIT_ASSERT(bundle != 0);
return bundle;
}
@@ -305,18 +303,18 @@
root->setResourceBundle(rbUS);
ResourceBundlePtr t = root->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
LoggerPtr x = Logger::getLogger(LOG4CXX_TEST_STR("x"));
LoggerPtr x_y = Logger::getLogger(LOG4CXX_TEST_STR("x.y"));
LoggerPtr x_y_z = Logger::getLogger(LOG4CXX_TEST_STR("x.y.z"));
t = x->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
t = x_y->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
t = x_y_z->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
}
void testRB2()
@@ -329,7 +327,7 @@
root->setResourceBundle(rbUS);
ResourceBundlePtr t = root->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
LoggerPtr x = Logger::getLogger(LOG4CXX_TEST_STR("x"));
LoggerPtr x_y = Logger::getLogger(LOG4CXX_TEST_STR("x.y"));
@@ -337,11 +335,11 @@
x_y->setResourceBundle(rbFR);
t = x->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
t = x_y->getResourceBundle();
- CPPUNIT_ASSERT(t == rbFR);
+ LOGUNIT_ASSERT(t == rbFR);
t = x_y_z->getResourceBundle();
- CPPUNIT_ASSERT(t == rbFR);
+ LOGUNIT_ASSERT(t == rbFR);
}
void testRB3()
@@ -354,7 +352,7 @@
root->setResourceBundle(rbUS);
ResourceBundlePtr t = root->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
LoggerPtr x = Logger::getLogger(LOG4CXX_TEST_STR("x"));
LoggerPtr x_y = Logger::getLogger(LOG4CXX_TEST_STR("x.y"));
@@ -363,11 +361,11 @@
x_y->setResourceBundle(rbFR);
x_y_z->setResourceBundle(rbCH);
t = x->getResourceBundle();
- CPPUNIT_ASSERT(t == rbUS);
+ LOGUNIT_ASSERT(t == rbUS);
t = x_y->getResourceBundle();
- CPPUNIT_ASSERT(t == rbFR);
+ LOGUNIT_ASSERT(t == rbFR);
t = x_y_z->getResourceBundle();
- CPPUNIT_ASSERT(t == rbCH);
+ LOGUNIT_ASSERT(t == rbCH);
}
void testExists()
@@ -378,13 +376,13 @@
LoggerPtr t;
t = LogManager::exists(LOG4CXX_TEST_STR("xx"));
- CPPUNIT_ASSERT(t == 0);
+ LOGUNIT_ASSERT(t == 0);
t = LogManager::exists(LOG4CXX_TEST_STR("a"));
- CPPUNIT_ASSERT_EQUAL(a, t);
+ LOGUNIT_ASSERT_EQUAL(a, t);
t = LogManager::exists(LOG4CXX_TEST_STR("a.b"));
- CPPUNIT_ASSERT_EQUAL(a_b, t);
+ LOGUNIT_ASSERT_EQUAL(a_b, t);
t = LogManager::exists(LOG4CXX_TEST_STR("a.b.c"));
- CPPUNIT_ASSERT_EQUAL(a_b_c, t);
+ LOGUNIT_ASSERT_EQUAL(a_b_c, t);
}
void testHierarchy1()
@@ -393,12 +391,12 @@
LoggerPtr root(h->getRootLogger());
root->setLevel(Level::getError());
LoggerPtr a0 = h->getLogger(LOG4CXX_STR("a"));
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("a"), a0->getName());
- CPPUNIT_ASSERT(a0->getLevel() == 0);
- CPPUNIT_ASSERT(Level::getError() == a0->getEffectiveLevel());
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("a"), a0->getName());
+ LOGUNIT_ASSERT(a0->getLevel() == 0);
+ LOGUNIT_ASSERT(Level::getError() == a0->getEffectiveLevel());
LoggerPtr a11 = h->getLogger(LOG4CXX_STR("a"));
- CPPUNIT_ASSERT_EQUAL(a0, a11);
+ LOGUNIT_ASSERT_EQUAL(a0, a11);
}
void compileTestForLOGCXX202() const {
@@ -432,10 +430,10 @@
LOG4CXX_TRACE(root, "Discarded Message");
std::vector<LoggingEventPtr> msgs(appender->vector);
- CPPUNIT_ASSERT_EQUAL((size_t) 1, msgs.size());
+ LOGUNIT_ASSERT_EQUAL((size_t) 1, msgs.size());
LoggingEventPtr event = msgs[0];
- CPPUNIT_ASSERT_EQUAL((int) Level::TRACE_INT, event->getLevel()->toInt());
- CPPUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("Message 1")), event->getMessage());
+ LOGUNIT_ASSERT_EQUAL((int) Level::TRACE_INT, event->getLevel()->toInt());
+ LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("Message 1")), event->getMessage());
}
/**
@@ -451,8 +449,8 @@
LoggerPtr tracer = Logger::getLogger("com.example.Tracer");
tracer->setLevel(Level::getTrace());
- CPPUNIT_ASSERT_EQUAL(true, tracer->isTraceEnabled());
- CPPUNIT_ASSERT_EQUAL(false, root->isTraceEnabled());
+ LOGUNIT_ASSERT_EQUAL(true, tracer->isTraceEnabled());
+ LOGUNIT_ASSERT_EQUAL(false, root->isTraceEnabled());
}
protected:
@@ -464,4 +462,4 @@
LogString LoggerTestCase::MSG(LOG4CXX_STR("M"));
-CPPUNIT_TEST_SUITE_REGISTRATION(LoggerTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(LoggerTestCase);
Added: logging/log4cxx/trunk/src/test/cpp/logunit.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.cpp?rev=615984&view=auto
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.cpp (added)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.cpp Mon Jan 28 10:40:19 2008
@@ -0,0 +1,19 @@
+/*
+ * 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
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "logunit.h"
+
Added: logging/log4cxx/trunk/src/test/cpp/logunit.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.h?rev=615984&view=auto
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.h (added)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.h Mon Jan 28 10:40:19 2008
@@ -0,0 +1,35 @@
+/*
+ * 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
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if !defined(_LOG4CXX_LOGUNIT_H)
+#define _LOG4CXX_LOGUNIT_H
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#define LOGUNIT_TEST_SUITE(x) CPPUNIT_TEST_SUITE(x)
+#define LOGUNIT_TEST(x) CPPUNIT_TEST(x)
+#define LOGUNIT_TEST_SUITE_END(x) CPPUNIT_TEST_SUITE_END(x)
+#define LOGUNIT_ASSERT(x) CPPUNIT_ASSERT(x)
+#define LOGUNIT_ASSERT_EQUAL(x, y) CPPUNIT_ASSERT_EQUAL(x, y)
+#define LOGUNIT_CLASS(x) class x : public CppUnit::TestFixture
+#define LOGUNIT_TEST_SUITE_REGISTRATION(x) CPPUNIT_TEST_SUITE_REGISTRATION(x)
+#define LOGUNIT_TEST_SUITE_REGISTRATION_NO_AUTO_RUN(x) CPPUNIT_NS::Test* create ## x () { return x :: suite(); }
+#define LOGUNIT_FAIL(msg) CPPUNIT_FAIL(msg)
+#define LOGUNIT_TEST_EXCEPTION(t, x) CPPUNIT_TEST_EXCEPTION(t, x)
+
+#endif
\ No newline at end of file
Modified: logging/log4cxx/trunk/src/test/cpp/minimumtestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/minimumtestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/minimumtestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/minimumtestcase.cpp Mon Jan 28 10:40:19 2008
@@ -14,10 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
+#include "logunit.h"
#include <log4cxx/logger.h>
#include <log4cxx/simplelayout.h>
#include <log4cxx/ttcclayout.h>
@@ -53,12 +50,12 @@
"Messages should bear numbers 0 through 23\\."
-class MinimumTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(MinimumTestCase)
{
- CPPUNIT_TEST_SUITE(MinimumTestCase);
- CPPUNIT_TEST(simple);
- CPPUNIT_TEST(ttcc);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(MinimumTestCase);
+ LOGUNIT_TEST(simple);
+ LOGUNIT_TEST(ttcc);
+ LOGUNIT_TEST_SUITE_END();
public:
void setUp()
@@ -79,7 +76,7 @@
root->addAppender(appender);
common();
- CPPUNIT_ASSERT(Compare::compare(LOG4CXX_FILE("output/simple"), LOG4CXX_FILE("witness/simple")));
+ LOGUNIT_ASSERT(Compare::compare(LOG4CXX_FILE("output/simple"), LOG4CXX_FILE("witness/simple")));
}
void ttcc()
@@ -112,7 +109,7 @@
}
const File witness("witness/ttcc");
- CPPUNIT_ASSERT(Compare::compare(FILTERED, witness));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, witness));
}
std::string createMessage(int i, Pool& pool) {
@@ -248,4 +245,4 @@
const File MinimumTestCase::FILTERED("output/filtered");
-CPPUNIT_TEST_SUITE_REGISTRATION(MinimumTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(MinimumTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/ndctestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/ndctestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/ndctestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/ndctestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,29 +16,27 @@
* limitations under the License.
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/ndc.h>
#include <log4cxx/file.h>
#include <log4cxx/logger.h>
#include <log4cxx/propertyconfigurator.h>
#include "insertwide.h"
+#include "logunit.h"
#include "util/compare.h"
using namespace log4cxx;
-class NDCTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(NDCTestCase)
{
static File TEMP;
static LoggerPtr logger;
- CPPUNIT_TEST_SUITE(NDCTestCase);
- CPPUNIT_TEST(testPushPop);
- CPPUNIT_TEST(test1);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST_SUITE(NDCTestCase);
+ LOGUNIT_TEST(testPushPop);
+ LOGUNIT_TEST(test1);
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -56,14 +54,14 @@
{
NDC::push("trivial context");
LogString actual(NDC::pop());
- CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("trivial context"), actual);
+ LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("trivial context"), actual);
}
void test1() {
PropertyConfigurator::configure(File("input/ndc/NDC1.properties"));
common();
- CPPUNIT_ASSERT(Compare::compare(TEMP, File("witness/ndc/NDC.1")));
+ LOGUNIT_ASSERT(Compare::compare(TEMP, File("witness/ndc/NDC.1")));
}
static void common() {
@@ -93,4 +91,4 @@
File NDCTestCase::TEMP("output/temp");
LoggerPtr NDCTestCase::logger(Logger::getLogger("org.apache.log4j.NDCTestCase"));
-CPPUNIT_TEST_SUITE_REGISTRATION(NDCTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(NDCTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/net/smtpappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/net/smtpappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/net/smtpappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/net/smtpappendertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -20,8 +20,6 @@
#if LOG4CXX_HAVE_SMTP
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/net/smtpappender.h>
#include "../appenderskeletontestcase.h"
#include <log4cxx/xml/domconfigurator.h>
@@ -69,15 +67,15 @@
*/
class SMTPAppenderTestCase : public AppenderSkeletonTestCase
{
- CPPUNIT_TEST_SUITE(SMTPAppenderTestCase);
+ LOGUNIT_TEST_SUITE(SMTPAppenderTestCase);
//
// tests inherited from AppenderSkeletonTestCase
//
- CPPUNIT_TEST(testDefaultThreshold);
- CPPUNIT_TEST(testSetOptionThreshold);
- CPPUNIT_TEST(testTrigger);
- CPPUNIT_TEST(testInvalid);
- CPPUNIT_TEST_SUITE_END();
+ LOGUNIT_TEST(testDefaultThreshold);
+ LOGUNIT_TEST(testSetOptionThreshold);
+ LOGUNIT_TEST(testTrigger);
+ LOGUNIT_TEST(testInvalid);
+ LOGUNIT_TEST_SUITE_END();
public:
@@ -100,7 +98,7 @@
DOMConfigurator::configure("input/xml/smtpAppender1.xml");
SMTPAppenderPtr appender(Logger::getRootLogger()->getAppender(LOG4CXX_STR("A1")));
TriggeringEventEvaluatorPtr evaluator(appender->getEvaluator());
- CPPUNIT_ASSERT_EQUAL(true, evaluator->instanceof(MockTriggeringEventEvaluator::getStaticClass()));
+ LOGUNIT_ASSERT_EQUAL(true, evaluator->instanceof(MockTriggeringEventEvaluator::getStaticClass()));
}
void testInvalid() {
@@ -119,6 +117,6 @@
};
-CPPUNIT_TEST_SUITE_REGISTRATION(SMTPAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(SMTPAppenderTestCase);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/net/socketappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/net/socketappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/net/socketappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/net/socketappendertestcase.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/net/socketappender.h>
#include "../appenderskeletontestcase.h"
@@ -29,14 +27,14 @@
*/
class SocketAppenderTestCase : public AppenderSkeletonTestCase
{
- CPPUNIT_TEST_SUITE(SocketAppenderTestCase);
+ LOGUNIT_TEST_SUITE(SocketAppenderTestCase);
//
// 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:
@@ -46,5 +44,5 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(SocketAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(SocketAppenderTestCase);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/net/sockethubappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/net/sockethubappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/net/sockethubappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/net/sockethubappendertestcase.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/net/sockethubappender.h>
#include "../appenderskeletontestcase.h"
@@ -29,14 +27,14 @@
*/
class SocketHubAppenderTestCase : public AppenderSkeletonTestCase
{
- CPPUNIT_TEST_SUITE(SocketHubAppenderTestCase);
+ LOGUNIT_TEST_SUITE(SocketHubAppenderTestCase);
//
// 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:
@@ -46,5 +44,5 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(SocketHubAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(SocketHubAppenderTestCase);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/net/socketservertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/net/socketservertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/net/socketservertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/net/socketservertestcase.cpp Mon Jan 28 10:40:19 2008
@@ -16,9 +16,6 @@
*/
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <log4cxx/logger.h>
#include <log4cxx/net/socketappender.h>
#include <log4cxx/ndc.h>
@@ -38,6 +35,7 @@
#include <log4cxx/helpers/transcoder.h>
#include <log4cxx/helpers/stringhelper.h>
#include "../testchar.h"
+#include "../logunit.h"
#include <log4cxx/spi/loggerrepository.h>
@@ -98,18 +96,18 @@
* class from log4j. That class must be started externally to this class
* for this test to succeed.
*/
-class SocketServerTestCase : public CppUnit::TestFixture
+LOGUNIT_CLASS(SocketServerTestCase)
{
- CPPUNIT_TEST_SUITE(SocketServerTestCase);
- 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_SUITE_END();
+ LOGUNIT_TEST_SUITE(SocketServerTestCase);
+ 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_SUITE_END();
SocketAppenderPtr socketAppender;
LoggerPtr logger;
@@ -169,7 +167,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.1")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.1")));
}
void test2()
@@ -204,7 +202,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.2")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.2")));
}
void test3()
@@ -239,7 +237,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.3")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.3")));
}
void test4()
@@ -271,7 +269,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.4")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.4")));
}
void test5()
@@ -307,7 +305,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.5")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.5")));
}
void test6()
@@ -345,7 +343,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.6")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.6")));
}
void test7()
@@ -383,7 +381,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.7")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.7")));
}
void test8()
@@ -417,7 +415,7 @@
throw;
}
- CPPUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.8")));
+ LOGUNIT_ASSERT(Compare::compare(FILTERED, LOG4CXX_FILE("witness/socketServer.8")));
}
void common(const std::string& testName, const LogString& dc, const LogString& key, const LogString& val)
@@ -480,7 +478,4 @@
const File SocketServerTestCase::TEMP("output/temp");
const File SocketServerTestCase::FILTERED("output/filtered");
-
-CPPUNIT_NS::Test* createSocketServerTestCase() {
- return SocketServerTestCase::suite();
-}
+LOGUNIT_TEST_SUITE_REGISTRATION_NO_AUTO_RUN(SocketServerTestCase)
Modified: logging/log4cxx/trunk/src/test/cpp/net/syslogappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/net/syslogappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/net/syslogappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/net/syslogappendertestcase.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/helpers/datagramsocket.h>
#include <log4cxx/net/syslogappender.h>
#include "../appenderskeletontestcase.h"
@@ -29,14 +27,14 @@
*/
class SyslogAppenderTestCase : public AppenderSkeletonTestCase
{
- CPPUNIT_TEST_SUITE(SyslogAppenderTestCase);
+ LOGUNIT_TEST_SUITE(SyslogAppenderTestCase);
//
// 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:
@@ -46,4 +44,4 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(SyslogAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(SyslogAppenderTestCase);
Modified: logging/log4cxx/trunk/src/test/cpp/net/telnetappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/net/telnetappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/net/telnetappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/net/telnetappendertestcase.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/net/telnetappender.h>
#include "../appenderskeletontestcase.h"
@@ -29,14 +27,14 @@
*/
class TelnetAppenderTestCase : public AppenderSkeletonTestCase
{
- CPPUNIT_TEST_SUITE(TelnetAppenderTestCase);
+ LOGUNIT_TEST_SUITE(TelnetAppenderTestCase);
//
// 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:
@@ -46,5 +44,5 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(TelnetAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(TelnetAppenderTestCase);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/net/xmlsocketappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/net/xmlsocketappendertestcase.cpp?rev=615984&r1=615983&r2=615984&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/net/xmlsocketappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/net/xmlsocketappendertestcase.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/net/xmlsocketappender.h>
#include "../appenderskeletontestcase.h"
@@ -29,14 +27,14 @@
*/
class XMLSocketAppenderTestCase : public AppenderSkeletonTestCase
{
- CPPUNIT_TEST_SUITE(XMLSocketAppenderTestCase);
+ LOGUNIT_TEST_SUITE(XMLSocketAppenderTestCase);
//
// 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:
@@ -46,5 +44,5 @@
}
};
-CPPUNIT_TEST_SUITE_REGISTRATION(XMLSocketAppenderTestCase);
+LOGUNIT_TEST_SUITE_REGISTRATION(XMLSocketAppenderTestCase);
#endif