You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ts...@apache.org on 2020/02/10 09:04:14 UTC

[logging-log4cxx] 07/07: Reformatted the tests using AStyle and the settings used for other source case in the past already. The tests were very inconsistent and that makes adding new code unnecessary difficult. As nobody objected for the past applied code style, I'm using it again.

This is an automated email from the ASF dual-hosted git repository.

tschoening pushed a commit to branch ghpr_14_replace-ant-build-with-cmake
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git

commit c84678223d8578c5cb056b639e15d0b29207bea4
Author: Thorsten Schöning <ts...@am-soft.de>
AuthorDate: Mon Feb 10 10:03:57 2020 +0100

    Reformatted the tests using AStyle and the settings used for other source case in the past already. The tests were very inconsistent and that makes adding new code unnecessary difficult. As nobody objected for the past applied code style, I'm using it again.
---
 .astylerc                                          |    1 +
 src/test/cpp/abts.cpp                              |  834 +++++++------
 src/test/cpp/abts.h                                |   75 +-
 src/test/cpp/appenderskeletontestcase.cpp          |   20 +-
 src/test/cpp/appenderskeletontestcase.h            |    6 +-
 src/test/cpp/asyncappendertestcase.cpp             |  488 ++++----
 src/test/cpp/consoleappendertestcase.cpp           |   52 +-
 src/test/cpp/customlogger/xlogger.cpp              |   82 +-
 src/test/cpp/customlogger/xlogger.h                |  184 +--
 src/test/cpp/customlogger/xloggertestcase.cpp      |   86 +-
 src/test/cpp/db/odbcappendertestcase.cpp           |   23 +-
 src/test/cpp/decodingtest.cpp                      |  178 +--
 src/test/cpp/defaultinit/testcase1.cpp             |   44 +-
 src/test/cpp/defaultinit/testcase2.cpp             |   48 +-
 src/test/cpp/defaultinit/testcase3.cpp             |   54 +-
 src/test/cpp/defaultinit/testcase4.cpp             |   50 +-
 src/test/cpp/encodingtest.cpp                      |  298 ++---
 src/test/cpp/fileappendertest.cpp                  |   92 +-
 src/test/cpp/fileappendertestcase.cpp              |  153 +--
 src/test/cpp/fileappendertestcase.h                |    6 +-
 src/test/cpp/filetestcase.cpp                      |  263 +++--
 src/test/cpp/filter/andfiltertest.cpp              |  277 ++---
 src/test/cpp/filter/denyallfiltertest.cpp          |   42 +-
 src/test/cpp/filter/levelmatchfiltertest.cpp       |  184 +--
 src/test/cpp/filter/levelrangefiltertest.cpp       |  225 ++--
 src/test/cpp/filter/loggermatchfiltertest.cpp      |  147 +--
 src/test/cpp/filter/stringmatchfiltertest.cpp      |  186 +--
 .../cpp/helpers/absolutetimedateformattestcase.cpp |  276 ++---
 src/test/cpp/helpers/cacheddateformattestcase.cpp  | 1232 ++++++++++----------
 src/test/cpp/helpers/charsetdecodertestcase.cpp    |  101 +-
 src/test/cpp/helpers/charsetencodertestcase.cpp    |  532 +++++----
 src/test/cpp/helpers/cyclicbuffertestcase.cpp      |  261 +++--
 .../cpp/helpers/datetimedateformattestcase.cpp     |  327 +++---
 src/test/cpp/helpers/filewatchdogtest.cpp          |   65 +-
 src/test/cpp/helpers/inetaddresstestcase.cpp       |  109 +-
 src/test/cpp/helpers/iso8601dateformattestcase.cpp |  241 ++--
 src/test/cpp/helpers/localechanger.cpp             |   39 +-
 src/test/cpp/helpers/localechanger.h               |   70 +-
 src/test/cpp/helpers/messagebuffertest.cpp         |  292 ++---
 src/test/cpp/helpers/optionconvertertestcase.cpp   |  343 +++---
 src/test/cpp/helpers/propertiestestcase.cpp        |  449 +++----
 .../cpp/helpers/relativetimedateformattestcase.cpp |   82 +-
 src/test/cpp/helpers/stringhelpertestcase.cpp      |  182 +--
 src/test/cpp/helpers/stringtokenizertestcase.cpp   |  230 ++--
 src/test/cpp/helpers/syslogwritertest.cpp          |   23 +-
 src/test/cpp/helpers/threadtestcase.cpp            |   65 +-
 src/test/cpp/helpers/timezonetestcase.cpp          |  169 +--
 src/test/cpp/helpers/transcodertestcase.cpp        |  546 +++++----
 src/test/cpp/hierarchytest.cpp                     |   46 +-
 src/test/cpp/hierarchythresholdtestcase.cpp        |  174 +--
 src/test/cpp/insertwide.h                          |    4 +-
 src/test/cpp/jsonlayouttest.cpp                    |  146 +--
 src/test/cpp/l7dtestcase.cpp                       |  124 +-
 src/test/cpp/leveltestcase.cpp                     |  164 +--
 src/test/cpp/loggertestcase.cpp                    |  819 ++++++-------
 src/test/cpp/logunit.cpp                           |  346 +++---
 src/test/cpp/logunit.h                             |  403 ++++---
 src/test/cpp/mdctestcase.cpp                       |   46 +-
 src/test/cpp/minimumtestcase.cpp                   |  377 +++---
 src/test/cpp/ndctestcase.cpp                       |  138 +--
 src/test/cpp/net/smtpappendertestcase.cpp          |  153 +--
 src/test/cpp/net/socketappendertestcase.cpp        |   23 +-
 src/test/cpp/net/sockethubappendertestcase.cpp     |   85 +-
 src/test/cpp/net/socketserverstarter.cpp           |  297 ++---
 src/test/cpp/net/socketservertestcase.cpp          |  780 +++++++------
 src/test/cpp/net/socketservertestcase.h            |    6 +-
 src/test/cpp/net/syslogappendertestcase.cpp        |   23 +-
 src/test/cpp/net/telnetappendertestcase.cpp        |   99 +-
 src/test/cpp/net/xmlsocketappendertestcase.cpp     |   23 +-
 src/test/cpp/nt/nteventlogappendertestcase.cpp     |  126 +-
 src/test/cpp/pattern/num343patternconverter.cpp    |   18 +-
 src/test/cpp/pattern/num343patternconverter.h      |   31 +-
 src/test/cpp/pattern/patternparsertestcase.cpp     |  340 +++---
 src/test/cpp/patternlayouttest.cpp                 |  925 +++++++--------
 src/test/cpp/propertyconfiguratortest.cpp          |  103 +-
 src/test/cpp/rolling/filenamepatterntestcase.cpp   |  303 ++---
 src/test/cpp/rolling/filterbasedrollingtest.cpp    |  196 ++--
 src/test/cpp/rolling/manualrollingtest.cpp         |  508 ++++----
 .../obsoletedailyrollingfileappendertest.cpp       |  166 +--
 .../rolling/obsoleterollingfileappendertest.cpp    |  216 ++--
 src/test/cpp/rolling/sizebasedrollingtest.cpp      |  616 +++++-----
 src/test/cpp/rolling/timebasedrollingtest.cpp      |  258 ++--
 src/test/cpp/rollingfileappendertestcase.cpp       |   23 +-
 src/test/cpp/spi/loggingeventtest.cpp              |  165 +--
 src/test/cpp/streamtestcase.cpp                    | 1109 +++++++++---------
 src/test/cpp/testchar.h                            |    8 +-
 src/test/cpp/util/absolutedateandtimefilter.cpp    |    2 +-
 src/test/cpp/util/absolutedateandtimefilter.h      |   10 +-
 src/test/cpp/util/absolutetimefilter.cpp           |    2 +-
 src/test/cpp/util/absolutetimefilter.h             |   10 +-
 src/test/cpp/util/binarycompare.cpp                |  107 +-
 src/test/cpp/util/binarycompare.h                  |   27 +-
 src/test/cpp/util/compare.cpp                      |  273 +++--
 src/test/cpp/util/compare.h                        |   35 +-
 src/test/cpp/util/controlfilter.cpp                |    2 +-
 src/test/cpp/util/controlfilter.h                  |   12 +-
 src/test/cpp/util/filenamefilter.cpp               |   33 +-
 src/test/cpp/util/filenamefilter.h                 |   12 +-
 src/test/cpp/util/filter.h                         |   48 +-
 src/test/cpp/util/iso8601filter.h                  |   10 +-
 src/test/cpp/util/linenumberfilter.cpp             |    4 +-
 src/test/cpp/util/linenumberfilter.h               |   10 +-
 src/test/cpp/util/relativetimefilter.cpp           |    4 +-
 src/test/cpp/util/relativetimefilter.h             |   10 +-
 src/test/cpp/util/serializationtesthelper.cpp      |   87 +-
 src/test/cpp/util/serializationtesthelper.h        |   32 +-
 src/test/cpp/util/threadfilter.h                   |   10 +-
 src/test/cpp/util/transformer.cpp                  |  360 +++---
 src/test/cpp/util/transformer.h                    |   50 +-
 src/test/cpp/util/utilfilter.cpp                   |    7 +-
 src/test/cpp/util/xmlfilenamefilter.cpp            |   13 +-
 src/test/cpp/util/xmlfilenamefilter.h              |   10 +-
 src/test/cpp/util/xmllineattributefilter.cpp       |    5 +-
 src/test/cpp/util/xmllineattributefilter.h         |   10 +-
 src/test/cpp/util/xmlthreadfilter.cpp              |    3 +-
 src/test/cpp/util/xmlthreadfilter.h                |   10 +-
 src/test/cpp/util/xmltimestampfilter.cpp           |    2 +-
 src/test/cpp/util/xmltimestampfilter.h             |   10 +-
 src/test/cpp/varia/errorhandlertestcase.cpp        |  154 +--
 src/test/cpp/varia/levelmatchfiltertestcase.cpp    |  225 ++--
 src/test/cpp/varia/levelrangefiltertestcase.cpp    |  412 +++----
 src/test/cpp/vectorappender.cpp                    |   26 +-
 src/test/cpp/vectorappender.h                      |   72 +-
 src/test/cpp/writerappendertestcase.cpp            |    5 +-
 src/test/cpp/writerappendertestcase.h              |    6 +-
 src/test/cpp/xml/customleveltestcase.cpp           |  152 +--
 src/test/cpp/xml/domtestcase.cpp                   |  302 ++---
 src/test/cpp/xml/xlevel.cpp                        |   71 +-
 src/test/cpp/xml/xlevel.h                          |   70 +-
 src/test/cpp/xml/xmllayouttest.cpp                 |  745 ++++++------
 src/test/cpp/xml/xmllayouttestcase.cpp             |  548 ++++-----
 131 files changed, 12095 insertions(+), 11032 deletions(-)

diff --git a/.astylerc b/.astylerc
index 5459711..eee1b59 100644
--- a/.astylerc
+++ b/.astylerc
@@ -10,6 +10,7 @@
 # Example invocation:
 #
 # astyle --project src/main/include/*.h src/main/cpp/*.cpp
+# astyle --project src/test/cpp/*.h src/test/cpp/*.cpp
 #
 
 --add-braces
diff --git a/src/test/cpp/abts.cpp b/src/test/cpp/abts.cpp
index 489e5dc..5524c9b 100644
--- a/src/test/cpp/abts.cpp
+++ b/src/test/cpp/abts.cpp
@@ -30,422 +30,584 @@ static int exclude = 0;
 static int quiet = 0;
 static int list_tests = 0;
 
-const char **testlist = NULL;
+const char** testlist = NULL;
 //  defined in logunit.cpp
 abts_suite* abts_run_suites(abts_suite*);
 
-static int find_test_name(const char *testname) {
-    int i;
-    for (i = 0; testlist[i] != NULL; i++) {
-        if (!strcmp(testlist[i], testname)) {
-            return 1;
-        }
-    }
-    return 0;
+static int find_test_name(const char* testname)
+{
+	int i;
+
+	for (i = 0; testlist[i] != NULL; i++)
+	{
+		if (!strcmp(testlist[i], testname))
+		{
+			return 1;
+		}
+	}
+
+	return 0;
 }
 
 /* Determine if the test should be run at all */
-static int should_test_run(const char *testname) {
-    int found = 0;
-    if (list_tests == 1) {
-        return 0;
-    }
-    if (testlist == NULL) {
-        return 1;
-    }
-    found = find_test_name(testname);
-    if ((found && !exclude) || (!found && exclude)) {
-        return 1;
-    }
-    return 0;
+static int should_test_run(const char* testname)
+{
+	int found = 0;
+
+	if (list_tests == 1)
+	{
+		return 0;
+	}
+
+	if (testlist == NULL)
+	{
+		return 1;
+	}
+
+	found = find_test_name(testname);
+
+	if ((found && !exclude) || (!found && exclude))
+	{
+		return 1;
+	}
+
+	return 0;
 }
 
 static void reset_status(void)
 {
-    curr_char = 0;
+	curr_char = 0;
 }
 
 static void update_status(void)
 {
-    if (!quiet) {
-        curr_char = (curr_char + 1) % ABTS_STAT_SIZE;
-        fprintf(stdout, "\b%c", status[curr_char]);
-        fflush(stdout);
-    }
+	if (!quiet)
+	{
+		curr_char = (curr_char + 1) % ABTS_STAT_SIZE;
+		fprintf(stdout, "\b%c", status[curr_char]);
+		fflush(stdout);
+	}
 }
 
-static void end_suite(abts_suite *suite)
+static void end_suite(abts_suite* suite)
 {
-    if (suite != NULL) {
-        sub_suite *last = suite->tail;
-        if (!quiet) {
-            fprintf(stdout, "\b");
-            fflush(stdout);
-        }
-        if (last->failed == 0) {
-            fprintf(stdout, "SUCCESS\n");
-            fflush(stdout);
-        }
-        else {
-            fprintf(stdout, "FAILED %d of %d\n", last->failed, last->num_test);
-            fflush(stdout);
-        }
-    }
+	if (suite != NULL)
+	{
+		sub_suite* last = suite->tail;
+
+		if (!quiet)
+		{
+			fprintf(stdout, "\b");
+			fflush(stdout);
+		}
+
+		if (last->failed == 0)
+		{
+			fprintf(stdout, "SUCCESS\n");
+			fflush(stdout);
+		}
+		else
+		{
+			fprintf(stdout, "FAILED %d of %d\n", last->failed, last->num_test);
+			fflush(stdout);
+		}
+	}
 }
 
-abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full)
+abts_suite* abts_add_suite(abts_suite* suite, const char* suite_name_full)
 {
-    sub_suite *subsuite;
-    const char *p;
-    const char *suite_name;
-    curr_char = 0;
-    
-    /* Only end the suite if we actually ran it */
-    if (suite && suite->tail &&!suite->tail->not_run) {
-        end_suite(suite);
-    }
-
-    subsuite = (sub_suite*) malloc(sizeof(*subsuite));
-    subsuite->num_test = 0;
-    subsuite->failed = 0;
-    subsuite->next = NULL;
-    /* suite_name_full may be an absolute path depending on __FILE__ 
-     * expansion */
-    suite_name = strrchr(suite_name_full, '/');
-    if (suite_name) {
-        suite_name++;
-    } else {
-        suite_name = suite_name_full;
-    }
-    p = strrchr(suite_name, '.');
-    if (p) {
-        subsuite->name = (const char*) memcpy(calloc(p - suite_name + 1, 1),
-                                suite_name, p - suite_name);
-    }
-    else {
-        subsuite->name = suite_name;
-    }
-
-    if (list_tests) {
-        fprintf(stdout, "%s\n", subsuite->name);
-    }
-    
-    subsuite->not_run = 0;
-
-    if (suite == NULL) {
-        suite = (abts_suite*) malloc(sizeof(*suite));
-        suite->head = subsuite;
-        suite->tail = subsuite;
-    }
-    else {
-        suite->tail->next = subsuite;
-        suite->tail = subsuite;
-    }
-
-    if (!should_test_run(subsuite->name)) {
-        subsuite->not_run = 1;
-        return suite;
-    }
-
-    reset_status();
-    fprintf(stdout, "%-20s:  ", subsuite->name);
-    update_status();
-    fflush(stdout);
-
-    return suite;
+	sub_suite* subsuite;
+	const char* p;
+	const char* suite_name;
+	curr_char = 0;
+
+	/* Only end the suite if we actually ran it */
+	if (suite && suite->tail && !suite->tail->not_run)
+	{
+		end_suite(suite);
+	}
+
+	subsuite = (sub_suite*) malloc(sizeof(*subsuite));
+	subsuite->num_test = 0;
+	subsuite->failed = 0;
+	subsuite->next = NULL;
+	/* suite_name_full may be an absolute path depending on __FILE__
+	 * expansion */
+	suite_name = strrchr(suite_name_full, '/');
+
+	if (suite_name)
+	{
+		suite_name++;
+	}
+	else
+	{
+		suite_name = suite_name_full;
+	}
+
+	p = strrchr(suite_name, '.');
+
+	if (p)
+	{
+		subsuite->name = (const char*) memcpy(calloc(p - suite_name + 1, 1),
+				suite_name, p - suite_name);
+	}
+	else
+	{
+		subsuite->name = suite_name;
+	}
+
+	if (list_tests)
+	{
+		fprintf(stdout, "%s\n", subsuite->name);
+	}
+
+	subsuite->not_run = 0;
+
+	if (suite == NULL)
+	{
+		suite = (abts_suite*) malloc(sizeof(*suite));
+		suite->head = subsuite;
+		suite->tail = subsuite;
+	}
+	else
+	{
+		suite->tail->next = subsuite;
+		suite->tail = subsuite;
+	}
+
+	if (!should_test_run(subsuite->name))
+	{
+		subsuite->not_run = 1;
+		return suite;
+	}
+
+	reset_status();
+	fprintf(stdout, "%-20s:  ", subsuite->name);
+	update_status();
+	fflush(stdout);
+
+	return suite;
 }
 
-void abts_run_test(abts_suite *ts, test_func f, void *value)
+void abts_run_test(abts_suite* ts, test_func f, void* value)
 {
-    abts_case tc;
-    sub_suite *ss;
-
-    if (!should_test_run(ts->tail->name)) {
-        return;
-    }
-    ss = ts->tail;
-
-    tc.failed = 0;
-    tc.suite = ss;
-    
-    ss->num_test++;
-    update_status();
-
-    f(&tc, value);
-    
-    if (tc.failed) {
-        ss->failed++;
-    }
+	abts_case tc;
+	sub_suite* ss;
+
+	if (!should_test_run(ts->tail->name))
+	{
+		return;
+	}
+
+	ss = ts->tail;
+
+	tc.failed = 0;
+	tc.suite = ss;
+
+	ss->num_test++;
+	update_status();
+
+	f(&tc, value);
+
+	if (tc.failed)
+	{
+		ss->failed++;
+	}
 }
 
-static int report(abts_suite *suite)
+static int report(abts_suite* suite)
 {
-    int count = 0;
-    sub_suite *dptr;
-
-    if (suite && suite->tail &&!suite->tail->not_run) {
-        end_suite(suite);
-    }
-
-    for (dptr = suite->head; dptr; dptr = dptr->next) {
-        count += dptr->failed;
-    }
-
-    if (list_tests) {
-        return 0;
-    }
-
-    if (count == 0) {
-        printf("All tests passed.\n");
-        return 0;
-    }
-
-    dptr = suite->head;
-    fprintf(stdout, "%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests");
-    fprintf(stdout, "===================================================\n");
-    while (dptr != NULL) {
-        if (dptr->failed != 0) {
-            float percent = ((float)dptr->failed / (float)dptr->num_test);
-            fprintf(stdout, "%-15s\t\t%5d\t%4d\t%6.2f%%\n", dptr->name, 
-                    dptr->num_test, dptr->failed, percent * 100);
-        }
-        dptr = dptr->next;
-    }
-    return 1;
+	int count = 0;
+	sub_suite* dptr;
+
+	if (suite && suite->tail && !suite->tail->not_run)
+	{
+		end_suite(suite);
+	}
+
+	for (dptr = suite->head; dptr; dptr = dptr->next)
+	{
+		count += dptr->failed;
+	}
+
+	if (list_tests)
+	{
+		return 0;
+	}
+
+	if (count == 0)
+	{
+		printf("All tests passed.\n");
+		return 0;
+	}
+
+	dptr = suite->head;
+	fprintf(stdout, "%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests");
+	fprintf(stdout, "===================================================\n");
+
+	while (dptr != NULL)
+	{
+		if (dptr->failed != 0)
+		{
+			float percent = ((float)dptr->failed / (float)dptr->num_test);
+			fprintf(stdout, "%-15s\t\t%5d\t%4d\t%6.2f%%\n", dptr->name,
+				dptr->num_test, dptr->failed, percent * 100);
+		}
+
+		dptr = dptr->next;
+	}
+
+	return 1;
 }
 
-void abts_log_message(const char *fmt, ...)
+void abts_log_message(const char* fmt, ...)
 {
-    va_list args;
-    update_status();
-
-    if (verbose) {
-        va_start(args, fmt);
-        vfprintf(stderr, fmt, args);
-        va_end(args);
-        fprintf(stderr, "\n");
-        fflush(stderr);
-    }
+	va_list args;
+	update_status();
+
+	if (verbose)
+	{
+		va_start(args, fmt);
+		vfprintf(stderr, fmt, args);
+		va_end(args);
+		fprintf(stderr, "\n");
+		fflush(stderr);
+	}
 }
 
-void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno)
+void abts_int_equal(abts_case* tc, const int expected, const int actual, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
+	update_status();
 
-    if (expected == actual) return;
+	if (tc->failed)
+	{
+		return;
+	}
 
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual);
-        fflush(stderr);
-    }
+	if (expected == actual)
+	{
+		return;
+	}
+
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual);
+		fflush(stderr);
+	}
 }
 
-void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno)
+void abts_int_nequal(abts_case* tc, const int expected, const int actual, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
+	update_status();
+
+	if (tc->failed)
+	{
+		return;
+	}
+
+	if (expected != actual)
+	{
+		return;
+	}
 
-    if (expected != actual) return;
+	tc->failed = TRUE;
 
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual);
-        fflush(stderr);
-    }
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual);
+		fflush(stderr);
+	}
 }
 
-void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno)
+void abts_size_equal(abts_case* tc, size_t expected, size_t actual, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
-
-    if (expected == actual) return;
-
-    tc->failed = TRUE;
-    if (verbose) {
-        /* Note that the comparison is type-exact, reporting must be a best-fit */
-        fprintf(stderr, "Line %d: expected %lu, but saw %lu\n", lineno, 
-                (unsigned long)expected, (unsigned long)actual);
-        fflush(stderr);
-    }
+	update_status();
+
+	if (tc->failed)
+	{
+		return;
+	}
+
+	if (expected == actual)
+	{
+		return;
+	}
+
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		/* Note that the comparison is type-exact, reporting must be a best-fit */
+		fprintf(stderr, "Line %d: expected %lu, but saw %lu\n", lineno,
+			(unsigned long)expected, (unsigned long)actual);
+		fflush(stderr);
+	}
 }
 
-void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno)
+void abts_str_equal(abts_case* tc, const char* expected, const char* actual, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
-
-    if (!expected && !actual) return;
-    if (expected && actual)
-        if (!strcmp(expected, actual)) return;
-
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual);
-        fflush(stderr);
-    }
+	update_status();
+
+	if (tc->failed)
+	{
+		return;
+	}
+
+	if (!expected && !actual)
+	{
+		return;
+	}
+
+	if (expected && actual)
+		if (!strcmp(expected, actual))
+		{
+			return;
+		}
+
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual);
+		fflush(stderr);
+	}
 }
 
-void abts_str_nequal(abts_case *tc, const char *expected, const char *actual,
-                       size_t n, int lineno)
+void abts_str_nequal(abts_case* tc, const char* expected, const char* actual,
+	size_t n, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
+	update_status();
 
-    if (!strncmp(expected, actual, n)) return;
+	if (tc->failed)
+	{
+		return;
+	}
 
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual);
-        fflush(stderr);
-    }
+	if (!strncmp(expected, actual, n))
+	{
+		return;
+	}
+
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual);
+		fflush(stderr);
+	}
 }
 
-void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno)
+void abts_ptr_notnull(abts_case* tc, const void* ptr, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
+	update_status();
+
+	if (tc->failed)
+	{
+		return;
+	}
 
-    if (ptr != NULL) return;
+	if (ptr != NULL)
+	{
+		return;
+	}
 
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: Expected NULL, but saw <%p>\n", lineno, ptr);
-        fflush(stderr);
-    }
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: Expected NULL, but saw <%p>\n", lineno, ptr);
+		fflush(stderr);
+	}
 }
- 
-void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual, int lineno)
+
+void abts_ptr_equal(abts_case* tc, const void* expected, const void* actual, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
+	update_status();
 
-    if (expected == actual) return;
+	if (tc->failed)
+	{
+		return;
+	}
 
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: expected <%p>, but saw <%p>\n", lineno, expected, actual);
-        fflush(stderr);
-    }
+	if (expected == actual)
+	{
+		return;
+	}
+
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: expected <%p>, but saw <%p>\n", lineno, expected, actual);
+		fflush(stderr);
+	}
 }
 
-void abts_fail(abts_case *tc, const char *message, int lineno)
+void abts_fail(abts_case* tc, const char* message, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
-
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: %s\n", lineno, message);
-        fflush(stderr);
-    }
+	update_status();
+
+	if (tc->failed)
+	{
+		return;
+	}
+
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: %s\n", lineno, message);
+		fflush(stderr);
+	}
 }
- 
-void abts_assert(abts_case *tc, const char *message, int condition, int lineno)
+
+void abts_assert(abts_case* tc, const char* message, int condition, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
+	update_status();
+
+	if (tc->failed)
+	{
+		return;
+	}
 
-    if (condition) return;
+	if (condition)
+	{
+		return;
+	}
 
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: %s\n", lineno, message);
-        fflush(stderr);
-    }
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: %s\n", lineno, message);
+		fflush(stderr);
+	}
 }
 
-void abts_true(abts_case *tc, int condition, int lineno)
+void abts_true(abts_case* tc, int condition, int lineno)
 {
-    update_status();
-    if (tc->failed) return;
+	update_status();
+
+	if (tc->failed)
+	{
+		return;
+	}
 
-    if (condition) return;
+	if (condition)
+	{
+		return;
+	}
 
-    tc->failed = TRUE;
-    if (verbose) {
-        fprintf(stderr, "Line %d: Condition is false, but expected true\n", lineno);
-        fflush(stderr);
-    }
+	tc->failed = TRUE;
+
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: Condition is false, but expected true\n", lineno);
+		fflush(stderr);
+	}
 }
 
-void abts_not_impl(abts_case *tc, const char *message, int lineno)
+void abts_not_impl(abts_case* tc, const char* message, int lineno)
 {
-    update_status();
+	update_status();
+
+	tc->suite->not_impl++;
 
-    tc->suite->not_impl++;
-    if (verbose) {
-        fprintf(stderr, "Line %d: %s\n", lineno, message);
-        fflush(stderr);
-    }
+	if (verbose)
+	{
+		fprintf(stderr, "Line %d: %s\n", lineno, message);
+		fflush(stderr);
+	}
 }
 
-int main(int argc, const char *const argv[]) {
-    int i;
-    int rv;
-    int list_provided = 0;
-    abts_suite *suite = NULL;
-   
-    initialize();
+int main(int argc, const char* const argv[])
+{
+	int i;
+	int rv;
+	int list_provided = 0;
+	abts_suite* suite = NULL;
+
+	initialize();
 
 #if defined(_MSC_VER)
-   quiet = 1;
+	quiet = 1;
 #else
-    quiet = !isatty(STDOUT_FILENO);
+	quiet = !isatty(STDOUT_FILENO);
 #endif
 
-    for (i = 1; i < argc; i++) {
-        if (!strcmp(argv[i], "-v")) {
-            verbose = 1;
-            continue;
-        }
-        if (!strcmp(argv[i], "-x")) {
-            exclude = 1;
-            continue;
-        }
-        if (!strcmp(argv[i], "-l")) {
-            list_tests = 1;
-            continue;
-        }
-        if (!strcmp(argv[i], "-q")) {
-            quiet = 1;
-            continue;
-        }
-        if (argv[i][0] == '-') {
-            fprintf(stderr, "Invalid option: `%s'\n", argv[i]);
-            exit(1);
-        }
-        list_provided = 1;
-    }
-
-    if (list_provided) {
-        /* Waste a little space here, because it is easier than counting the
-         * number of tests listed.  Besides it is at most three char *.
-         */
-        testlist = (const char**) calloc(argc + 1, sizeof(char *));
-        for (i = 1; i < argc; i++) {
-            testlist[i - 1] = argv[i];
-        }
-    }
-
-    suite = abts_run_suites(suite);
-
-    if (suite == 0) {
-        fputs("No tests selected\n", stderr);
-    } else {
-        rv = report(suite);
-        //
-        //    clean up suite
-        //
-        sub_suite* next;
-        for(sub_suite* head = suite->head; head != NULL; head = next) {
-      next = head->next;
-           free((void*) head->name);
-      free(head);
-         }
-         free(suite);
-    }
-    return rv;
+	for (i = 1; i < argc; i++)
+	{
+		if (!strcmp(argv[i], "-v"))
+		{
+			verbose = 1;
+			continue;
+		}
+
+		if (!strcmp(argv[i], "-x"))
+		{
+			exclude = 1;
+			continue;
+		}
+
+		if (!strcmp(argv[i], "-l"))
+		{
+			list_tests = 1;
+			continue;
+		}
+
+		if (!strcmp(argv[i], "-q"))
+		{
+			quiet = 1;
+			continue;
+		}
+
+		if (argv[i][0] == '-')
+		{
+			fprintf(stderr, "Invalid option: `%s'\n", argv[i]);
+			exit(1);
+		}
+
+		list_provided = 1;
+	}
+
+	if (list_provided)
+	{
+		/* Waste a little space here, because it is easier than counting the
+		 * number of tests listed.  Besides it is at most three char *.
+		 */
+		testlist = (const char**) calloc(argc + 1, sizeof(char*));
+
+		for (i = 1; i < argc; i++)
+		{
+			testlist[i - 1] = argv[i];
+		}
+	}
+
+	suite = abts_run_suites(suite);
+
+	if (suite == 0)
+	{
+		fputs("No tests selected\n", stderr);
+	}
+	else
+	{
+		rv = report(suite);
+		//
+		//    clean up suite
+		//
+		sub_suite* next;
+
+		for (sub_suite* head = suite->head; head != NULL; head = next)
+		{
+			next = head->next;
+			free((void*) head->name);
+			free(head);
+		}
+
+		free(suite);
+	}
+
+	return rv;
 }
diff --git a/src/test/cpp/abts.h b/src/test/cpp/abts.h
index 340ab8a..616250b 100644
--- a/src/test/cpp/abts.h
+++ b/src/test/cpp/abts.h
@@ -21,63 +21,66 @@
 #include <apr.h>
 
 #ifdef WIN32
-#include <io.h>
+	#include <io.h>
 #else
-#include <unistd.h>
+	#include <unistd.h>
 #endif
 
 #ifndef ABTS_H
 #define ABTS_H
 
 #ifndef FALSE
-#define FALSE 0
+	#define FALSE 0
 #endif
 #ifndef TRUE
-#define TRUE  1
+	#define TRUE  1
 #endif
 
-struct sub_suite {
-    const char *name;
-    int num_test;
-    int failed;
-    int not_run;
-    int not_impl;
-    struct sub_suite *next;
+struct sub_suite
+{
+	const char* name;
+	int num_test;
+	int failed;
+	int not_run;
+	int not_impl;
+	struct sub_suite* next;
 };
 typedef struct sub_suite sub_suite;
 
-struct abts_suite {
-    sub_suite *head;
-    sub_suite *tail;
+struct abts_suite
+{
+	sub_suite* head;
+	sub_suite* tail;
 };
 typedef struct abts_suite abts_suite;
 
-struct abts_case {
-    int failed;
-    sub_suite *suite;
+struct abts_case
+{
+	int failed;
+	sub_suite* suite;
 };
 typedef struct abts_case abts_case;
 
-typedef void (*test_func)(abts_case *tc, void *data);
+typedef void (*test_func)(abts_case* tc, void* data);
 
 #define ADD_SUITE(suite) abts_add_suite(suite, __FILE__);
 
-abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name);
-void abts_run_test(abts_suite *ts, test_func f, void *value);
-void abts_log_message(const char *fmt, ...);
-
-void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno);
-void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno);
-void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno);
-void abts_str_nequal(abts_case *tc, const char *expected, const char *actual,
-                       size_t n, int lineno);
-void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno);
-void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual, int lineno);
-void abts_true(abts_case *tc, int condition, int lineno);
-void abts_fail(abts_case *tc, const char *message, int lineno);
-void abts_not_impl(abts_case *tc, const char *message, int lineno);
-void abts_assert(abts_case *tc, const char *message, int condition, int lineno);
-void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno);
+abts_suite* abts_add_suite(abts_suite* suite, const char* suite_name);
+void abts_run_test(abts_suite* ts, test_func f, void* value);
+void abts_log_message(const char* fmt, ...);
+
+void abts_int_equal(abts_case* tc, const int expected, const int actual, int lineno);
+void abts_int_nequal(abts_case* tc, const int expected, const int actual, int lineno);
+void abts_str_equal(abts_case* tc, const char* expected, const char* actual, int lineno);
+void abts_str_nequal(abts_case* tc, const char* expected, const char* actual,
+	size_t n, int lineno);
+void abts_ptr_notnull(abts_case* tc, const void* ptr, int lineno);
+void abts_ptr_equal(abts_case* tc, const void* expected, const void* actual, int lineno);
+void abts_true(abts_case* tc, int condition, int lineno);
+void abts_fail(abts_case* tc, const char* message, int lineno);
+void abts_not_impl(abts_case* tc, const char* message, int lineno);
+void abts_assert(abts_case* tc, const char* message, int condition, int lineno);
+void abts_size_equal(abts_case* tc, size_t expected, size_t actual, int lineno);
 
 /* Convenience macros. Ryan hates these! */
 #define ABTS_INT_EQUAL(a, b, c)     abts_int_equal(a, b, c, __LINE__)
@@ -94,8 +97,8 @@ void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno);
 #define ABTS_SIZE_EQUAL(a, b, c)    abts_size_equal(a, b, c, __LINE__)
 
 
-abts_suite *run_tests(abts_suite *suite);
-abts_suite *run_tests1(abts_suite *suite);
+abts_suite* run_tests(abts_suite* suite);
+abts_suite* run_tests1(abts_suite* suite);
 
 
 #endif
diff --git a/src/test/cpp/appenderskeletontestcase.cpp b/src/test/cpp/appenderskeletontestcase.cpp
index 6406c42..631d633 100644
--- a/src/test/cpp/appenderskeletontestcase.cpp
+++ b/src/test/cpp/appenderskeletontestcase.cpp
@@ -25,15 +25,17 @@ using namespace log4cxx;
 using namespace log4cxx::helpers;
 
 
-void AppenderSkeletonTestCase::testDefaultThreshold() {
-   ObjectPtrT<AppenderSkeleton> appender(createAppenderSkeleton());
-   LevelPtr threshold(appender->getThreshold());
-   LOGUNIT_ASSERT_EQUAL(Level::getAll()->toInt(), threshold->toInt());
+void AppenderSkeletonTestCase::testDefaultThreshold()
+{
+	ObjectPtrT<AppenderSkeleton> appender(createAppenderSkeleton());
+	LevelPtr threshold(appender->getThreshold());
+	LOGUNIT_ASSERT_EQUAL(Level::getAll()->toInt(), threshold->toInt());
 }
 
-void AppenderSkeletonTestCase::testSetOptionThreshold() {
-    ObjectPtrT<AppenderSkeleton> appender(createAppenderSkeleton());
-    appender->setOption(LOG4CXX_STR("threshold"), LOG4CXX_STR("debug"));
-    LevelPtr threshold(appender->getThreshold());
-    LOGUNIT_ASSERT_EQUAL(Level::getDebug()->toInt(), threshold->toInt());
+void AppenderSkeletonTestCase::testSetOptionThreshold()
+{
+	ObjectPtrT<AppenderSkeleton> appender(createAppenderSkeleton());
+	appender->setOption(LOG4CXX_STR("threshold"), LOG4CXX_STR("debug"));
+	LevelPtr threshold(appender->getThreshold());
+	LOGUNIT_ASSERT_EQUAL(Level::getDebug()->toInt(), threshold->toInt());
 }
diff --git a/src/test/cpp/appenderskeletontestcase.h b/src/test/cpp/appenderskeletontestcase.h
index 23b8b46..40b01d2 100644
--- a/src/test/cpp/appenderskeletontestcase.h
+++ b/src/test/cpp/appenderskeletontestcase.h
@@ -26,9 +26,9 @@ LOGUNIT_CLASS(AppenderSkeletonTestCase)
 {
 
 public:
-        virtual log4cxx::AppenderSkeleton* createAppenderSkeleton() const = 0;
+	virtual log4cxx::AppenderSkeleton* createAppenderSkeleton() const = 0;
 
-        void testDefaultThreshold();
+	void testDefaultThreshold();
 
-        void testSetOptionThreshold();
+	void testSetOptionThreshold();
 };
diff --git a/src/test/cpp/asyncappendertestcase.cpp b/src/test/cpp/asyncappendertestcase.cpp
index 61853d4..d2b4b41 100644
--- a/src/test/cpp/asyncappendertestcase.cpp
+++ b/src/test/cpp/asyncappendertestcase.cpp
@@ -36,63 +36,74 @@ using namespace log4cxx;
 using namespace log4cxx::helpers;
 using namespace log4cxx::spi;
 
-class NullPointerAppender : public AppenderSkeleton {
-public:
-    NullPointerAppender() {
-    }
+class NullPointerAppender : public AppenderSkeleton
+{
+	public:
+		NullPointerAppender()
+		{
+		}
 
 
-    /**
-     * @{inheritDoc}
-     */
-    void append(const spi::LoggingEventPtr&, log4cxx::helpers::Pool&) {
-         throw NullPointerException(LOG4CXX_STR("Intentional NullPointerException"));
-    }
+		/**
+		 * @{inheritDoc}
+		 */
+		void append(const spi::LoggingEventPtr&, log4cxx::helpers::Pool&)
+		{
+			throw NullPointerException(LOG4CXX_STR("Intentional NullPointerException"));
+		}
 
-    void close() {
-    }
+		void close()
+		{
+		}
 
-    bool requiresLayout() const {
-            return false;
-    }
+		bool requiresLayout() const
+		{
+			return false;
+		}
 };
 
-    /**
-     * Vector appender that can be explicitly blocked.
-     */
-class BlockableVectorAppender : public VectorAppender {
-private:
-      Mutex blocker;
-public:
-      /**
-       * Create new instance.
-       */
-      BlockableVectorAppender() : blocker(pool) {
-      }
-
-      /**
-       * {@inheritDoc}
-       */
-    void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) {
-          synchronized sync(blocker);
-          VectorAppender::append(event, p);
-            //
-            //   if fatal, echo messages for testLoggingInDispatcher
-            //
-            if (event->getLevel() == Level::getInfo()) {
-                LoggerPtr logger = Logger::getLoggerLS(event->getLoggerName());
-                LOG4CXX_LOGLS(logger, Level::getError(), event->getMessage());
-                LOG4CXX_LOGLS(logger, Level::getWarn(), event->getMessage());
-                LOG4CXX_LOGLS(logger, Level::getInfo(), event->getMessage());
-                LOG4CXX_LOGLS(logger, Level::getDebug(), event->getMessage());
-            }
-      }
-      
-      Mutex& getBlocker() {
-          return blocker;
-      }
-
-    };
+/**
+ * Vector appender that can be explicitly blocked.
+ */
+class BlockableVectorAppender : public VectorAppender
+{
+	private:
+		Mutex blocker;
+	public:
+		/**
+		 * Create new instance.
+		 */
+		BlockableVectorAppender() : blocker(pool)
+		{
+		}
+
+		/**
+		 * {@inheritDoc}
+		 */
+		void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p)
+		{
+			synchronized sync(blocker);
+			VectorAppender::append(event, p);
+
+			//
+			//   if fatal, echo messages for testLoggingInDispatcher
+			//
+			if (event->getLevel() == Level::getInfo())
+			{
+				LoggerPtr logger = Logger::getLoggerLS(event->getLoggerName());
+				LOG4CXX_LOGLS(logger, Level::getError(), event->getMessage());
+				LOG4CXX_LOGLS(logger, Level::getWarn(), event->getMessage());
+				LOG4CXX_LOGLS(logger, Level::getInfo(), event->getMessage());
+				LOG4CXX_LOGLS(logger, Level::getDebug(), event->getMessage());
+			}
+		}
+
+		Mutex& getBlocker()
+		{
+			return blocker;
+		}
+
+};
 
 typedef helpers::ObjectPtrT<BlockableVectorAppender> BlockableVectorAppenderPtr;
 
@@ -102,186 +113,201 @@ typedef helpers::ObjectPtrT<BlockableVectorAppender> BlockableVectorAppenderPtr;
  */
 class AsyncAppenderTestCase : public AppenderSkeletonTestCase
 {
-        LOGUNIT_TEST_SUITE(AsyncAppenderTestCase);
-                //
-                //    tests inherited from AppenderSkeletonTestCase
-                //
-                LOGUNIT_TEST(testDefaultThreshold);
-                LOGUNIT_TEST(testSetOptionThreshold);
-
-                LOGUNIT_TEST(closeTest);
-                LOGUNIT_TEST(test2);
-                LOGUNIT_TEST(test3);
-                //
-                //   TODO: test fails on Linux.
-                //LOGUNIT_TEST(testBadAppender);
-                LOGUNIT_TEST(testLocationInfoTrue);
-                LOGUNIT_TEST(testConfiguration);
-        LOGUNIT_TEST_SUITE_END();
-
-
-public:
-        void setUp() {
-           AppenderSkeletonTestCase::setUp();
-        }
-
-        void tearDown()
-        {
-                LogManager::shutdown();
-                AppenderSkeletonTestCase::tearDown();
-        }
-
-        AppenderSkeleton* createAppenderSkeleton() const {
-          return new AsyncAppender();
-        }
-
-        // this test checks whether it is possible to write to a closed AsyncAppender
-        void closeTest() 
-        {
-                LoggerPtr root = Logger::getRootLogger();
-                LayoutPtr layout = new SimpleLayout();
-                VectorAppenderPtr vectorAppender = new VectorAppender();
-                AsyncAppenderPtr asyncAppender = new AsyncAppender();
-                asyncAppender->setName(LOG4CXX_STR("async-CloseTest"));
-                asyncAppender->addAppender(vectorAppender);
-                root->addAppender(asyncAppender);
-
-                root->debug(LOG4CXX_TEST_STR("m1"));
-                asyncAppender->close();
-                root->debug(LOG4CXX_TEST_STR("m2"));
-
-                const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
-                LOGUNIT_ASSERT_EQUAL((size_t) 1, v.size());
-        }
-
-        // this test checks whether appenders embedded within an AsyncAppender are also
-        // closed
-        void test2()
-        {
-                LoggerPtr root = Logger::getRootLogger();
-                LayoutPtr layout = new SimpleLayout();
-                VectorAppenderPtr vectorAppender = new VectorAppender();
-                AsyncAppenderPtr asyncAppender = new AsyncAppender();
-                asyncAppender->setName(LOG4CXX_STR("async-test2"));
-                asyncAppender->addAppender(vectorAppender);
-                root->addAppender(asyncAppender);
-
-                root->debug(LOG4CXX_TEST_STR("m1"));
-                asyncAppender->close();
-                root->debug(LOG4CXX_TEST_STR("m2"));
-
-                const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
-                LOGUNIT_ASSERT_EQUAL((size_t) 1, v.size());
-                LOGUNIT_ASSERT(vectorAppender->isClosed());
-        }
-
-        // this test checks whether appenders embedded within an AsyncAppender are also
-        // closed
-        void test3()
-        {
-                size_t LEN = 200;
-                LoggerPtr root = Logger::getRootLogger();
-                VectorAppenderPtr vectorAppender = new VectorAppender();
-                AsyncAppenderPtr asyncAppender = new AsyncAppender();
-                asyncAppender->setName(LOG4CXX_STR("async-test3"));
-                asyncAppender->addAppender(vectorAppender);
-                root->addAppender(asyncAppender);
-
-                for (size_t i = 0; i < LEN; i++) {
-                        LOG4CXX_DEBUG(root, "message" << i);
-                }
-
-                asyncAppender->close();
-                root->debug(LOG4CXX_TEST_STR("m2"));
-
-                const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
-                LOGUNIT_ASSERT_EQUAL(LEN, v.size());
-                LOGUNIT_ASSERT_EQUAL(true, vectorAppender->isClosed());
-        }
-        
-    /**
-     * Tests that a bad appender will switch async back to sync.
-     */
-    void testBadAppender() {
-        AppenderPtr nullPointerAppender = new NullPointerAppender();
-        AsyncAppenderPtr asyncAppender = new AsyncAppender();
-        asyncAppender->addAppender(nullPointerAppender);
-        asyncAppender->setBufferSize(5);
-        Pool p;
-        asyncAppender->activateOptions(p);
-        LoggerPtr root = Logger::getRootLogger();
-        root->addAppender(asyncAppender);
-        LOG4CXX_INFO(root, "Message");
-        Thread::sleep(10);
-        try {
-           LOG4CXX_INFO(root, "Message");
-           LOGUNIT_FAIL("Should have thrown exception");
-        } catch(NullPointerException& ex) {
-        }
-    }
-    
-    /**
-     * Tests non-blocking behavior.
-     */
-    void testLocationInfoTrue() {
-        BlockableVectorAppenderPtr blockableAppender = new BlockableVectorAppender();
-        AsyncAppenderPtr async = new AsyncAppender();
-        async->addAppender(blockableAppender);
-        async->setBufferSize(5);
-        async->setLocationInfo(true);
-        async->setBlocking(false);
-        Pool p;
-        async->activateOptions(p);
-        LoggerPtr rootLogger = Logger::getRootLogger();
-        rootLogger->addAppender(async);
-        {
-            synchronized sync(blockableAppender->getBlocker());
-            for (int i = 0; i < 140; i++) {
-                   LOG4CXX_INFO(rootLogger, "Hello, World");
-                   Thread::sleep(1);
-            }
-            LOG4CXX_ERROR(rootLogger, "That's all folks.");
-        }
-        async->close();
-        const std::vector<spi::LoggingEventPtr>& events = blockableAppender->getVector();
-        LOGUNIT_ASSERT(events.size() > 0);
-        LoggingEventPtr initialEvent = events[0];
-        LoggingEventPtr discardEvent = events[events.size() - 1];
-        LOGUNIT_ASSERT(initialEvent->getMessage() == LOG4CXX_STR("Hello, World"));
-        LOGUNIT_ASSERT(discardEvent->getMessage().substr(0,10) == LOG4CXX_STR("Discarded "));
-        LOGUNIT_ASSERT_EQUAL(log4cxx::spi::LocationInfo::getLocationUnavailable().getClassName(), 
-            discardEvent->getLocationInformation().getClassName()); 
-    }
-    
-        void testConfiguration() {
-              log4cxx::xml::DOMConfigurator::configure("input/xml/asyncAppender1.xml");
-              AsyncAppenderPtr asyncAppender(Logger::getRootLogger()->getAppender(LOG4CXX_STR("ASYNC")));
-              LOGUNIT_ASSERT(!(asyncAppender == 0));
-              LOGUNIT_ASSERT_EQUAL(100, asyncAppender->getBufferSize());
-              LOGUNIT_ASSERT_EQUAL(false, asyncAppender->getBlocking());
-              LOGUNIT_ASSERT_EQUAL(true, asyncAppender->getLocationInfo());
-              AppenderList nestedAppenders(asyncAppender->getAllAppenders());
-              //   TODO:
-              //   test seems to work okay, but have not found a working way to 
-              //      get a reference to the nested vector appender 
-              //
-//              LOGUNIT_ASSERT_EQUAL((size_t) 1, nestedAppenders.size());
-//              VectorAppenderPtr vectorAppender(nestedAppenders[0]);
-//              LOGUNIT_ASSERT(0 != vectorAppender);
-              LoggerPtr root(Logger::getRootLogger()); 
-              
-              size_t LEN = 20;
-              for (size_t i = 0; i < LEN; i++) {
-                        LOG4CXX_DEBUG(root, "message" << i);
-              }
-              
-              asyncAppender->close();
-//              const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
-//              LOGUNIT_ASSERT_EQUAL(LEN, v.size());
-//              LOGUNIT_ASSERT_EQUAL(true, vectorAppender->isClosed());
-        }
-
-        
+		LOGUNIT_TEST_SUITE(AsyncAppenderTestCase);
+		//
+		//    tests inherited from AppenderSkeletonTestCase
+		//
+		LOGUNIT_TEST(testDefaultThreshold);
+		LOGUNIT_TEST(testSetOptionThreshold);
+
+		LOGUNIT_TEST(closeTest);
+		LOGUNIT_TEST(test2);
+		LOGUNIT_TEST(test3);
+		//
+		//   TODO: test fails on Linux.
+		//LOGUNIT_TEST(testBadAppender);
+		LOGUNIT_TEST(testLocationInfoTrue);
+		LOGUNIT_TEST(testConfiguration);
+		LOGUNIT_TEST_SUITE_END();
+
+
+	public:
+		void setUp()
+		{
+			AppenderSkeletonTestCase::setUp();
+		}
+
+		void tearDown()
+		{
+			LogManager::shutdown();
+			AppenderSkeletonTestCase::tearDown();
+		}
+
+		AppenderSkeleton* createAppenderSkeleton() const
+		{
+			return new AsyncAppender();
+		}
+
+		// this test checks whether it is possible to write to a closed AsyncAppender
+		void closeTest()
+		{
+			LoggerPtr root = Logger::getRootLogger();
+			LayoutPtr layout = new SimpleLayout();
+			VectorAppenderPtr vectorAppender = new VectorAppender();
+			AsyncAppenderPtr asyncAppender = new AsyncAppender();
+			asyncAppender->setName(LOG4CXX_STR("async-CloseTest"));
+			asyncAppender->addAppender(vectorAppender);
+			root->addAppender(asyncAppender);
+
+			root->debug(LOG4CXX_TEST_STR("m1"));
+			asyncAppender->close();
+			root->debug(LOG4CXX_TEST_STR("m2"));
+
+			const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
+			LOGUNIT_ASSERT_EQUAL((size_t) 1, v.size());
+		}
+
+		// this test checks whether appenders embedded within an AsyncAppender are also
+		// closed
+		void test2()
+		{
+			LoggerPtr root = Logger::getRootLogger();
+			LayoutPtr layout = new SimpleLayout();
+			VectorAppenderPtr vectorAppender = new VectorAppender();
+			AsyncAppenderPtr asyncAppender = new AsyncAppender();
+			asyncAppender->setName(LOG4CXX_STR("async-test2"));
+			asyncAppender->addAppender(vectorAppender);
+			root->addAppender(asyncAppender);
+
+			root->debug(LOG4CXX_TEST_STR("m1"));
+			asyncAppender->close();
+			root->debug(LOG4CXX_TEST_STR("m2"));
+
+			const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
+			LOGUNIT_ASSERT_EQUAL((size_t) 1, v.size());
+			LOGUNIT_ASSERT(vectorAppender->isClosed());
+		}
+
+		// this test checks whether appenders embedded within an AsyncAppender are also
+		// closed
+		void test3()
+		{
+			size_t LEN = 200;
+			LoggerPtr root = Logger::getRootLogger();
+			VectorAppenderPtr vectorAppender = new VectorAppender();
+			AsyncAppenderPtr asyncAppender = new AsyncAppender();
+			asyncAppender->setName(LOG4CXX_STR("async-test3"));
+			asyncAppender->addAppender(vectorAppender);
+			root->addAppender(asyncAppender);
+
+			for (size_t i = 0; i < LEN; i++)
+			{
+				LOG4CXX_DEBUG(root, "message" << i);
+			}
+
+			asyncAppender->close();
+			root->debug(LOG4CXX_TEST_STR("m2"));
+
+			const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
+			LOGUNIT_ASSERT_EQUAL(LEN, v.size());
+			LOGUNIT_ASSERT_EQUAL(true, vectorAppender->isClosed());
+		}
+
+		/**
+		 * Tests that a bad appender will switch async back to sync.
+		 */
+		void testBadAppender()
+		{
+			AppenderPtr nullPointerAppender = new NullPointerAppender();
+			AsyncAppenderPtr asyncAppender = new AsyncAppender();
+			asyncAppender->addAppender(nullPointerAppender);
+			asyncAppender->setBufferSize(5);
+			Pool p;
+			asyncAppender->activateOptions(p);
+			LoggerPtr root = Logger::getRootLogger();
+			root->addAppender(asyncAppender);
+			LOG4CXX_INFO(root, "Message");
+			Thread::sleep(10);
+
+			try
+			{
+				LOG4CXX_INFO(root, "Message");
+				LOGUNIT_FAIL("Should have thrown exception");
+			}
+			catch (NullPointerException& ex)
+			{
+			}
+		}
+
+		/**
+		 * Tests non-blocking behavior.
+		 */
+		void testLocationInfoTrue()
+		{
+			BlockableVectorAppenderPtr blockableAppender = new BlockableVectorAppender();
+			AsyncAppenderPtr async = new AsyncAppender();
+			async->addAppender(blockableAppender);
+			async->setBufferSize(5);
+			async->setLocationInfo(true);
+			async->setBlocking(false);
+			Pool p;
+			async->activateOptions(p);
+			LoggerPtr rootLogger = Logger::getRootLogger();
+			rootLogger->addAppender(async);
+			{
+				synchronized sync(blockableAppender->getBlocker());
+
+				for (int i = 0; i < 140; i++)
+				{
+					LOG4CXX_INFO(rootLogger, "Hello, World");
+					Thread::sleep(1);
+				}
+
+				LOG4CXX_ERROR(rootLogger, "That's all folks.");
+			}
+			async->close();
+			const std::vector<spi::LoggingEventPtr>& events = blockableAppender->getVector();
+			LOGUNIT_ASSERT(events.size() > 0);
+			LoggingEventPtr initialEvent = events[0];
+			LoggingEventPtr discardEvent = events[events.size() - 1];
+			LOGUNIT_ASSERT(initialEvent->getMessage() == LOG4CXX_STR("Hello, World"));
+			LOGUNIT_ASSERT(discardEvent->getMessage().substr(0, 10) == LOG4CXX_STR("Discarded "));
+			LOGUNIT_ASSERT_EQUAL(log4cxx::spi::LocationInfo::getLocationUnavailable().getClassName(),
+				discardEvent->getLocationInformation().getClassName());
+		}
+
+		void testConfiguration()
+		{
+			log4cxx::xml::DOMConfigurator::configure("input/xml/asyncAppender1.xml");
+			AsyncAppenderPtr asyncAppender(Logger::getRootLogger()->getAppender(LOG4CXX_STR("ASYNC")));
+			LOGUNIT_ASSERT(!(asyncAppender == 0));
+			LOGUNIT_ASSERT_EQUAL(100, asyncAppender->getBufferSize());
+			LOGUNIT_ASSERT_EQUAL(false, asyncAppender->getBlocking());
+			LOGUNIT_ASSERT_EQUAL(true, asyncAppender->getLocationInfo());
+			AppenderList nestedAppenders(asyncAppender->getAllAppenders());
+			//   TODO:
+			//   test seems to work okay, but have not found a working way to
+			//      get a reference to the nested vector appender
+			//
+			//              LOGUNIT_ASSERT_EQUAL((size_t) 1, nestedAppenders.size());
+			//              VectorAppenderPtr vectorAppender(nestedAppenders[0]);
+			//              LOGUNIT_ASSERT(0 != vectorAppender);
+			LoggerPtr root(Logger::getRootLogger());
+
+			size_t LEN = 20;
+
+			for (size_t i = 0; i < LEN; i++)
+			{
+				LOG4CXX_DEBUG(root, "message" << i);
+			}
+
+			asyncAppender->close();
+			//              const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
+			//              LOGUNIT_ASSERT_EQUAL(LEN, v.size());
+			//              LOGUNIT_ASSERT_EQUAL(true, vectorAppender->isClosed());
+		}
+
+
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(AsyncAppenderTestCase);
diff --git a/src/test/cpp/consoleappendertestcase.cpp b/src/test/cpp/consoleappendertestcase.cpp
index 2e7522e..5138386 100644
--- a/src/test/cpp/consoleappendertestcase.cpp
+++ b/src/test/cpp/consoleappendertestcase.cpp
@@ -27,31 +27,33 @@ using namespace log4cxx::helpers;
  */
 class ConsoleAppenderTestCase : public WriterAppenderTestCase
 {
-   LOGUNIT_TEST_SUITE(ConsoleAppenderTestCase);
-                //
-                //    tests inherited from AppenderSkeletonTestCase
-                //
-                LOGUNIT_TEST(testDefaultThreshold);
-                LOGUNIT_TEST(testSetOptionThreshold);
-                LOGUNIT_TEST(testNoLayout);
-   LOGUNIT_TEST_SUITE_END();
-
-
-public:
-
-        WriterAppender* createWriterAppender() const {
-          return new log4cxx::ConsoleAppender();
-        }
-        
-        void testNoLayout() {
-            Pool p;
-            ConsoleAppenderPtr appender(new ConsoleAppender());
-            appender->activateOptions(p);
-            LoggerPtr logger(Logger::getRootLogger());
-            logger->addAppender(appender);
-            LOG4CXX_INFO(logger, "No layout specified for ConsoleAppender");
-            logger->removeAppender(appender);
-        }
+		LOGUNIT_TEST_SUITE(ConsoleAppenderTestCase);
+		//
+		//    tests inherited from AppenderSkeletonTestCase
+		//
+		LOGUNIT_TEST(testDefaultThreshold);
+		LOGUNIT_TEST(testSetOptionThreshold);
+		LOGUNIT_TEST(testNoLayout);
+		LOGUNIT_TEST_SUITE_END();
+
+
+	public:
+
+		WriterAppender* createWriterAppender() const
+		{
+			return new log4cxx::ConsoleAppender();
+		}
+
+		void testNoLayout()
+		{
+			Pool p;
+			ConsoleAppenderPtr appender(new ConsoleAppender());
+			appender->activateOptions(p);
+			LoggerPtr logger(Logger::getRootLogger());
+			logger->addAppender(appender);
+			LOG4CXX_INFO(logger, "No layout specified for ConsoleAppender");
+			logger->removeAppender(appender);
+		}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(ConsoleAppenderTestCase);
diff --git a/src/test/cpp/customlogger/xlogger.cpp b/src/test/cpp/customlogger/xlogger.cpp
index a837509..84722b8 100644
--- a/src/test/cpp/customlogger/xlogger.cpp
+++ b/src/test/cpp/customlogger/xlogger.cpp
@@ -32,72 +32,72 @@ XFactoryPtr XLogger::factory = new XFactory();
 
 void XLogger::lethal(const LogString& message, const LocationInfo& locationInfo)
 {
-        if (repository->isDisabled(XLevel::LETHAL_INT))
-        {
-                return;
-        }
-
-        if (XLevel::getLethal()->isGreaterOrEqual(this->getEffectiveLevel()))
-        {
-                forcedLog(XLevel::getLethal(), message, locationInfo);
-        }
+	if (repository->isDisabled(XLevel::LETHAL_INT))
+	{
+		return;
+	}
+
+	if (XLevel::getLethal()->isGreaterOrEqual(this->getEffectiveLevel()))
+	{
+		forcedLog(XLevel::getLethal(), message, locationInfo);
+	}
 }
 
 void XLogger::lethal(const LogString& message)
 {
-        if (repository->isDisabled(XLevel::LETHAL_INT))
-        {
-                return;
-        }
-
-        if (XLevel::getLethal()->isGreaterOrEqual(this->getEffectiveLevel()))
-        {
-                forcedLog(XLevel::getLethal(), message, LocationInfo::getLocationUnavailable());
-        }
+	if (repository->isDisabled(XLevel::LETHAL_INT))
+	{
+		return;
+	}
+
+	if (XLevel::getLethal()->isGreaterOrEqual(this->getEffectiveLevel()))
+	{
+		forcedLog(XLevel::getLethal(), message, LocationInfo::getLocationUnavailable());
+	}
 }
 
 LoggerPtr XLogger::getLogger(const LogString& name)
 {
-        return LogManager::getLogger(name, factory);
+	return LogManager::getLogger(name, factory);
 }
 
 LoggerPtr XLogger::getLogger(const helpers::Class& clazz)
 {
-        return XLogger::getLogger(clazz.getName());
+	return XLogger::getLogger(clazz.getName());
 }
 
 void XLogger::trace(const LogString& message, const LocationInfo& locationInfo)
 {
-        if (repository->isDisabled(XLevel::TRACE_INT))
-        {
-                return;
-        }
-
-        if (XLevel::getTrace()->isGreaterOrEqual(this->getEffectiveLevel()))
-        {
-                forcedLog(XLevel::getTrace(), message, locationInfo);
-        }
+	if (repository->isDisabled(XLevel::TRACE_INT))
+	{
+		return;
+	}
+
+	if (XLevel::getTrace()->isGreaterOrEqual(this->getEffectiveLevel()))
+	{
+		forcedLog(XLevel::getTrace(), message, locationInfo);
+	}
 }
 
 void XLogger::trace(const LogString& message)
 {
-        if (repository->isDisabled(XLevel::TRACE_INT))
-        {
-                return;
-        }
-
-        if (XLevel::getTrace()->isGreaterOrEqual(this->getEffectiveLevel()))
-        {
-                forcedLog(XLevel::getTrace(), message, LocationInfo::getLocationUnavailable());
-        }
+	if (repository->isDisabled(XLevel::TRACE_INT))
+	{
+		return;
+	}
+
+	if (XLevel::getTrace()->isGreaterOrEqual(this->getEffectiveLevel()))
+	{
+		forcedLog(XLevel::getTrace(), message, LocationInfo::getLocationUnavailable());
+	}
 }
 
 XFactory::XFactory()
 {
 }
 
-LoggerPtr XFactory::makeNewLoggerInstance(log4cxx::helpers::Pool& pool, 
-       const LogString& name) const
+LoggerPtr XFactory::makeNewLoggerInstance(log4cxx::helpers::Pool& pool,
+	const LogString& name) const
 {
-        return new XLogger(pool, name);
+	return new XLogger(pool, name);
 }
diff --git a/src/test/cpp/customlogger/xlogger.h b/src/test/cpp/customlogger/xlogger.h
index 0080f48..896e0bc 100644
--- a/src/test/cpp/customlogger/xlogger.h
+++ b/src/test/cpp/customlogger/xlogger.h
@@ -22,94 +22,100 @@
 
 namespace log4cxx
 {
-        namespace spi {
-          namespace location {
-            class LocationInfo;
-          }
-        }
-        // Any sub-class of Logger must also have its own implementation of
-        // LoggerFactory.
-        class XFactory :
-                public virtual spi::LoggerFactory,
-                public virtual helpers::ObjectImpl
-        {
-        public:
-                DECLARE_ABSTRACT_LOG4CXX_OBJECT(XFactory)
-                BEGIN_LOG4CXX_CAST_MAP()
-                        LOG4CXX_CAST_ENTRY(XFactory)
-                        LOG4CXX_CAST_ENTRY(spi::LoggerFactory)
-                END_LOG4CXX_CAST_MAP()
-
-                XFactory();
-                virtual LoggerPtr makeNewLoggerInstance(
-                   log4cxx::helpers::Pool& pool,
-                   const LogString& name) const;
-        };
-
-        typedef helpers::ObjectPtrT<XFactory> XFactoryPtr;
-
-        /**
-        A simple example showing Logger sub-classing. It shows the
-        minimum steps necessary to implement one's {@link LoggerFactory}.
-        Note that sub-classes follow the hierarchy even if its loggers
-        belong to different classes.
-        */
-        class XLogger : public Logger
-        {
-        // It's enough to instantiate a factory once and for all.
-        static XFactoryPtr factory;
-        LogString suffix;
-
-        public:
-                DECLARE_ABSTRACT_LOG4CXX_OBJECT(XLogger)
-                BEGIN_LOG4CXX_CAST_MAP()
-                        LOG4CXX_CAST_ENTRY(XLogger)
-                        LOG4CXX_CAST_ENTRY_CHAIN(Logger)
-                END_LOG4CXX_CAST_MAP()
-
-                /**
-                        Just calls the parent constuctor.
-                */
-                XLogger(log4cxx::helpers::Pool& pool,
-                        const LogString& name1) : Logger(pool, name1) {}
-
-                /**
-                        Nothing to activate.
-                */
-                void activateOptions() {}
-
-
-                /**
-                        We introduce a new printing method in order to support {@link
-                        XLevel#LETHAL}.  */
-                void lethal(const LogString& message, const log4cxx::spi::LocationInfo& location);
-
-                /**
-                        We introduce a new printing method in order to support {@link
-                        XLevel#LETHAL}.  */
-                void lethal(const LogString& message);
-
-                static LoggerPtr getLogger(const LogString& name);
-
-                static LoggerPtr getLogger(const helpers::Class& clazz);
-
-                LogString getSuffix() const
-                        { return suffix; }
-
-                void setSuffix(const LogString& suffix1)
-                        { this->suffix = suffix1; }
-
-                /**
-                        We introduce a new printing method that takes the TRACE level.
-                */
-                void trace(const LogString& message, const log4cxx::spi::LocationInfo& location);
-
-                /**
-                        We introduce a new printing method that takes the TRACE level.
-                */
-                void trace(const LogString& message);
-        };
-
-        typedef helpers::ObjectPtrT<XLogger> XLoggerPtr;
+namespace spi
+{
+namespace location
+{
+class LocationInfo;
+}
+}
+// Any sub-class of Logger must also have its own implementation of
+// LoggerFactory.
+class XFactory :
+	public virtual spi::LoggerFactory,
+	public virtual helpers::ObjectImpl
+{
+	public:
+		DECLARE_ABSTRACT_LOG4CXX_OBJECT(XFactory)
+		BEGIN_LOG4CXX_CAST_MAP()
+		LOG4CXX_CAST_ENTRY(XFactory)
+		LOG4CXX_CAST_ENTRY(spi::LoggerFactory)
+		END_LOG4CXX_CAST_MAP()
+
+		XFactory();
+		virtual LoggerPtr makeNewLoggerInstance(
+			log4cxx::helpers::Pool& pool,
+			const LogString& name) const;
+};
+
+typedef helpers::ObjectPtrT<XFactory> XFactoryPtr;
+
+/**
+A simple example showing Logger sub-classing. It shows the
+minimum steps necessary to implement one's {@link LoggerFactory}.
+Note that sub-classes follow the hierarchy even if its loggers
+belong to different classes.
+*/
+class XLogger : public Logger
+{
+		// It's enough to instantiate a factory once and for all.
+		static XFactoryPtr factory;
+		LogString suffix;
+
+	public:
+		DECLARE_ABSTRACT_LOG4CXX_OBJECT(XLogger)
+		BEGIN_LOG4CXX_CAST_MAP()
+		LOG4CXX_CAST_ENTRY(XLogger)
+		LOG4CXX_CAST_ENTRY_CHAIN(Logger)
+		END_LOG4CXX_CAST_MAP()
+
+		/**
+		        Just calls the parent constuctor.
+		*/
+		XLogger(log4cxx::helpers::Pool& pool,
+			const LogString& name1) : Logger(pool, name1) {}
+
+		/**
+		        Nothing to activate.
+		*/
+		void activateOptions() {}
+
+
+		/**
+		        We introduce a new printing method in order to support {@link
+		        XLevel#LETHAL}.  */
+		void lethal(const LogString& message, const log4cxx::spi::LocationInfo& location);
+
+		/**
+		        We introduce a new printing method in order to support {@link
+		        XLevel#LETHAL}.  */
+		void lethal(const LogString& message);
+
+		static LoggerPtr getLogger(const LogString& name);
+
+		static LoggerPtr getLogger(const helpers::Class& clazz);
+
+		LogString getSuffix() const
+		{
+			return suffix;
+		}
+
+		void setSuffix(const LogString& suffix1)
+		{
+			this->suffix = suffix1;
+		}
+
+		/**
+		        We introduce a new printing method that takes the TRACE level.
+		*/
+		void trace(const LogString& message, const log4cxx::spi::LocationInfo& location);
+
+		/**
+		        We introduce a new printing method that takes the TRACE level.
+		*/
+		void trace(const LogString& message);
+};
+
+typedef helpers::ObjectPtrT<XLogger> XLoggerPtr;
 }
 
diff --git a/src/test/cpp/customlogger/xloggertestcase.cpp b/src/test/cpp/customlogger/xloggertestcase.cpp
index 15c3bcf..500820d 100644
--- a/src/test/cpp/customlogger/xloggertestcase.cpp
+++ b/src/test/cpp/customlogger/xloggertestcase.cpp
@@ -36,55 +36,61 @@ using namespace log4cxx::xml;
 */
 LOGUNIT_CLASS(XLoggerTestCase)
 {
-   LOGUNIT_TEST_SUITE(XLoggerTestCase);
-      LOGUNIT_TEST(test1);
-      LOGUNIT_TEST(test2);
-   LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(XLoggerTestCase);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST_SUITE_END();
 
-   XLoggerPtr logger;
+	XLoggerPtr logger;
 
 public:
-   void setUp()
-   {
-      logger = XLogger::getLogger(
-            LOG4CXX_STR("org.apache.log4j.customLogger.XLoggerTestCase"));
-   }
+	void setUp()
+	{
+		logger = XLogger::getLogger(
+				LOG4CXX_STR("org.apache.log4j.customLogger.XLoggerTestCase"));
+	}
 
-   void tearDown()
-   {
-      logger->getLoggerRepository()->resetConfiguration();
-   }
+	void tearDown()
+	{
+		logger->getLoggerRepository()->resetConfiguration();
+	}
 
-   void test1() { common("1"); }
-   void test2() { common("2"); }
+	void test1()
+	{
+		common("1");
+	}
+	void test2()
+	{
+		common("2");
+	}
 
-   void common(const char* number)
-   {
-        std::string fn("input/xml/customLogger");
-        fn.append(number);
-        fn.append(".xml");
-        DOMConfigurator::configure(fn);
+	void common(const char* number)
+	{
+		std::string fn("input/xml/customLogger");
+		fn.append(number);
+		fn.append(".xml");
+		DOMConfigurator::configure(fn);
 
-        int i = 0;
-        LOG4CXX_LOG(logger, log4cxx::XLevel::getTrace(), "Message " << i);
+		int i = 0;
+		LOG4CXX_LOG(logger, log4cxx::XLevel::getTrace(), "Message " << i);
 
-        i++;
-        LOG4CXX_DEBUG(logger, "Message " << i);
-        i++;
-        LOG4CXX_WARN(logger, "Message " << i);
-        i++;
-        LOG4CXX_ERROR(logger, "Message " << i);
-        i++;
-        LOG4CXX_FATAL(logger, "Message " << i);
-        i++;
-        LOG4CXX_DEBUG(logger, "Message " << i);
+		i++;
+		LOG4CXX_DEBUG(logger, "Message " << i);
+		i++;
+		LOG4CXX_WARN(logger, "Message " << i);
+		i++;
+		LOG4CXX_ERROR(logger, "Message " << i);
+		i++;
+		LOG4CXX_FATAL(logger, "Message " << i);
+		i++;
+		LOG4CXX_DEBUG(logger, "Message " << i);
 
-        const File OUTPUT("output/temp");
-        std::string witness("witness/customLogger.");
-        witness.append(number);
-        const File WITNESS(witness);
-      LOGUNIT_ASSERT(Compare::compare(OUTPUT, WITNESS));
-    }
+		const File OUTPUT("output/temp");
+		std::string witness("witness/customLogger.");
+		witness.append(number);
+		const File WITNESS(witness);
+		LOGUNIT_ASSERT(Compare::compare(OUTPUT, WITNESS));
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(XLoggerTestCase);
diff --git a/src/test/cpp/db/odbcappendertestcase.cpp b/src/test/cpp/db/odbcappendertestcase.cpp
index d0bef0a..155b393 100644
--- a/src/test/cpp/db/odbcappendertestcase.cpp
+++ b/src/test/cpp/db/odbcappendertestcase.cpp
@@ -32,21 +32,22 @@ using namespace log4cxx::helpers;
  */
 class ODBCAppenderTestCase : public AppenderSkeletonTestCase
 {
-   LOGUNIT_TEST_SUITE(ODBCAppenderTestCase);
-                //
-                //    tests inherited from AppenderSkeletonTestCase
-                //
-                LOGUNIT_TEST(testDefaultThreshold);
-                LOGUNIT_TEST(testSetOptionThreshold);
+		LOGUNIT_TEST_SUITE(ODBCAppenderTestCase);
+		//
+		//    tests inherited from AppenderSkeletonTestCase
+		//
+		LOGUNIT_TEST(testDefaultThreshold);
+		LOGUNIT_TEST(testSetOptionThreshold);
 
-   LOGUNIT_TEST_SUITE_END();
+		LOGUNIT_TEST_SUITE_END();
 
 
-public:
+	public:
 
-        AppenderSkeleton* createAppenderSkeleton() const {
-         return new log4cxx::db::ODBCAppender();
-        }
+		AppenderSkeleton* createAppenderSkeleton() const
+		{
+			return new log4cxx::db::ODBCAppender();
+		}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(ODBCAppenderTestCase);
diff --git a/src/test/cpp/decodingtest.cpp b/src/test/cpp/decodingtest.cpp
index 61f90b7..37c00a4 100644
--- a/src/test/cpp/decodingtest.cpp
+++ b/src/test/cpp/decodingtest.cpp
@@ -51,98 +51,106 @@ using namespace log4cxx::helpers;
  * @see LOGCXX-369
  * @see LOGCXX-399
  */
-LOGUNIT_CLASS(DecodingTest) {
-  LOGUNIT_TEST_SUITE(DecodingTest);
+LOGUNIT_CLASS(DecodingTest)
+{
+	LOGUNIT_TEST_SUITE(DecodingTest);
 #if LOG4CXX_CHARSET_USASCII
-          LOGUNIT_TEST(testASCII);
+	LOGUNIT_TEST(testASCII);
 #elif LOG4CXX_CHARSET_ISO88591 || defined(_WIN32_WCE)
-          LOGUNIT_TEST(testLatin1);
+	LOGUNIT_TEST(testLatin1);
 #elif LOG4CXX_CHARSET_UTF8
-          LOGUNIT_TEST(testUtf8);
+	LOGUNIT_TEST(testUtf8);
 #elif LOG4CXX_LOGCHAR_IS_WCHAR && LOG4CXX_HAS_MBSRTOWCS
-          LOGUNIT_TEST(testUtf16);
-          LOGUNIT_TEST(testUtf16LE);
-          LOGUNIT_TEST(testUtf16BE);
+	LOGUNIT_TEST(testUtf16);
+	LOGUNIT_TEST(testUtf16LE);
+	LOGUNIT_TEST(testUtf16BE);
 #else
-          // LocaleCharsetDecoder, so it's difficult to provide a file working for e.g. windows-1252
-          // as well as something completely different.
-          LOGUNIT_TEST(testASCII);
+	// LocaleCharsetDecoder, so it's difficult to provide a file working for e.g. windows-1252
+	// as well as something completely different.
+	LOGUNIT_TEST(testASCII);
 #endif
-  LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE_END();
 public:
-    /**
-     * Test us-ascii decoding.
-     */
-  void testASCII() {
-      const wchar_t witness[] = { L'A', 0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0x0020, 0x003F, 0 };
-
-      testImpl(LOG4CXX_STR("ascii.txt"), witness);
-
-  }
-
-    /**
-     * Test iso-8859-1 decoding.
-     */
-    void testLatin1() {
-      const wchar_t witness[] = { L'A', 0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0x0020, 0x00B9, 0 };
-
-        testImpl(LOG4CXX_STR("latin1.txt"), witness);
-    }
-
-    /**
-     * Test utf-8 decoding.
-     */
-    void testUtf8() {
-        const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
-
-        testImpl(LOG4CXX_STR("UTF-8.txt"), witness);
-    }
-
-    /**
-     * Test utf-16 decoding.
-     */
-    void testUtf16() {
-        const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
-
-        testImpl(LOG4CXX_STR("UTF-16.txt"), witness);
-    }
-
-    /**
-     * Test utf-16be decoding.
-     */
-    void testUtf16BE() {
-        const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
-
-        testImpl(LOG4CXX_STR("UTF-16BE.txt"), witness);
-    }
-
-    /**
-     * Test utf16-le decoding.
-     */
-    void testUtf16LE() {
-        const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
-
-        testImpl(LOG4CXX_STR("UTF-16LE.txt"), witness);
-    }
-
-    private:
-      void testImpl(
-               const LogString& fileName,
-               const wchar_t*   witness) {
-          CharsetDecoderPtr decoder(CharsetDecoder::getDefaultDecoder());
-          LogString         lsContent;
-          std::wstring      wsContent;
-          LogString         path(LOG4CXX_STR("input/decoding/") + fileName);
-          Pool              pool;
-
-          FileInputStreamPtr   fis(     new FileInputStream(path));
-          InputStreamReaderPtr isReader(new InputStreamReader(fis, decoder));
-
-          lsContent.assign(isReader->read(pool));
-          Transcoder::encode(lsContent, wsContent);
-
-          LOGUNIT_ASSERT_EQUAL((std::wstring) witness, wsContent);
-      }
+	/**
+	 * Test us-ascii decoding.
+	 */
+	void testASCII()
+	{
+		const wchar_t witness[] = { L'A', 0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0x0020, 0x003F, 0 };
+
+		testImpl(LOG4CXX_STR("ascii.txt"), witness);
+
+	}
+
+	/**
+	 * Test iso-8859-1 decoding.
+	 */
+	void testLatin1()
+	{
+		const wchar_t witness[] = { L'A', 0x003F, 0x003F, 0x003F, 0x003F, 0x003F, 0x0020, 0x00B9, 0 };
+
+		testImpl(LOG4CXX_STR("latin1.txt"), witness);
+	}
+
+	/**
+	 * Test utf-8 decoding.
+	 */
+	void testUtf8()
+	{
+		const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
+
+		testImpl(LOG4CXX_STR("UTF-8.txt"), witness);
+	}
+
+	/**
+	 * Test utf-16 decoding.
+	 */
+	void testUtf16()
+	{
+		const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
+
+		testImpl(LOG4CXX_STR("UTF-16.txt"), witness);
+	}
+
+	/**
+	 * Test utf-16be decoding.
+	 */
+	void testUtf16BE()
+	{
+		const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
+
+		testImpl(LOG4CXX_STR("UTF-16BE.txt"), witness);
+	}
+
+	/**
+	 * Test utf16-le decoding.
+	 */
+	void testUtf16LE()
+	{
+		const wchar_t witness[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x0400, 0x0020, 0x00B9, 0 };
+
+		testImpl(LOG4CXX_STR("UTF-16LE.txt"), witness);
+	}
+
+private:
+	void testImpl(
+		const LogString & fileName,
+		const wchar_t*   witness)
+	{
+		CharsetDecoderPtr decoder(CharsetDecoder::getDefaultDecoder());
+		LogString         lsContent;
+		std::wstring      wsContent;
+		LogString         path(LOG4CXX_STR("input/decoding/") + fileName);
+		Pool              pool;
+
+		FileInputStreamPtr   fis(     new FileInputStream(path));
+		InputStreamReaderPtr isReader(new InputStreamReader(fis, decoder));
+
+		lsContent.assign(isReader->read(pool));
+		Transcoder::encode(lsContent, wsContent);
+
+		LOGUNIT_ASSERT_EQUAL((std::wstring) witness, wsContent);
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(DecodingTest);
diff --git a/src/test/cpp/defaultinit/testcase1.cpp b/src/test/cpp/defaultinit/testcase1.cpp
index b0059a4..2b56af6 100644
--- a/src/test/cpp/defaultinit/testcase1.cpp
+++ b/src/test/cpp/defaultinit/testcase1.cpp
@@ -5,9 +5,9 @@
  * 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.
@@ -24,27 +24,27 @@ using namespace log4cxx;
 
 LOGUNIT_CLASS(TestCase1)
 {
-   LOGUNIT_TEST_SUITE(TestCase1);
-      LOGUNIT_TEST(noneTest);
-   LOGUNIT_TEST_SUITE_END();
-   
+	LOGUNIT_TEST_SUITE(TestCase1);
+	LOGUNIT_TEST(noneTest);
+	LOGUNIT_TEST_SUITE_END();
+
 public:
-   void setUp()
-   {
-   }
-
-   void tearDown()
-   {
-      LogManager::shutdown();
-   }
-   
-   void noneTest()
-   {
-      LoggerPtr root = Logger::getRootLogger();
-     LOG4CXX_DEBUG(root, "Hello, world");
-      bool rootIsConfigured = !root->getAllAppenders().empty();
-      LOGUNIT_ASSERT(!rootIsConfigured);
-   }
+	void setUp()
+	{
+	}
+
+	void tearDown()
+	{
+		LogManager::shutdown();
+	}
+
+	void noneTest()
+	{
+		LoggerPtr root = Logger::getRootLogger();
+		LOG4CXX_DEBUG(root, "Hello, world");
+		bool rootIsConfigured = !root->getAllAppenders().empty();
+		LOGUNIT_ASSERT(!rootIsConfigured);
+	}
 };
 
 
diff --git a/src/test/cpp/defaultinit/testcase2.cpp b/src/test/cpp/defaultinit/testcase2.cpp
index 1c362c2..c6de497 100644
--- a/src/test/cpp/defaultinit/testcase2.cpp
+++ b/src/test/cpp/defaultinit/testcase2.cpp
@@ -30,35 +30,35 @@ using namespace log4cxx;
 
 LOGUNIT_CLASS(TestCase2)
 {
-   LOGUNIT_TEST_SUITE(TestCase2);
-      LOGUNIT_TEST(xmlTest);
-   LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(TestCase2);
+	LOGUNIT_TEST(xmlTest);
+	LOGUNIT_TEST_SUITE_END();
 
 public:
-   void setUp()
-   {
-      helpers::Pool p;
-      apr_file_copy("input/xml/defaultInit.xml", "log4cxx.xml", APR_FPROT_UREAD|APR_FPROT_UWRITE, p.getAPRPool());
-   }
+	void setUp()
+	{
+		helpers::Pool p;
+		apr_file_copy("input/xml/defaultInit.xml", "log4cxx.xml", APR_FPROT_UREAD | APR_FPROT_UWRITE, p.getAPRPool());
+	}
 
-   void tearDown()
-   {
-      helpers::Pool p;
-      apr_file_remove("log4cxx.xml", p.getAPRPool());
-      LogManager::shutdown();
-   }
+	void tearDown()
+	{
+		helpers::Pool p;
+		apr_file_remove("log4cxx.xml", p.getAPRPool());
+		LogManager::shutdown();
+	}
 
-   void xmlTest()
-   {
-      LoggerPtr root = Logger::getRootLogger();
-      LOG4CXX_DEBUG(root, "Hello, world");
-      bool rootIsConfigured = !root->getAllAppenders().empty();
-      LOGUNIT_ASSERT(rootIsConfigured);
+	void xmlTest()
+	{
+		LoggerPtr root = Logger::getRootLogger();
+		LOG4CXX_DEBUG(root, "Hello, world");
+		bool rootIsConfigured = !root->getAllAppenders().empty();
+		LOGUNIT_ASSERT(rootIsConfigured);
 
-      AppenderList list = root->getAllAppenders();
-      AppenderPtr appender = list.front();
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("D1"), appender->getName());
-   }
+		AppenderList list = root->getAllAppenders();
+		AppenderPtr appender = list.front();
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("D1"), appender->getName());
+	}
 
 };
 
diff --git a/src/test/cpp/defaultinit/testcase3.cpp b/src/test/cpp/defaultinit/testcase3.cpp
index 2b36f28..fd9a9ab 100644
--- a/src/test/cpp/defaultinit/testcase3.cpp
+++ b/src/test/cpp/defaultinit/testcase3.cpp
@@ -26,35 +26,35 @@ using namespace log4cxx;
 
 LOGUNIT_CLASS(TestCase3)
 {
-   LOGUNIT_TEST_SUITE(TestCase3);
-      LOGUNIT_TEST(testProperties);
-   LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(TestCase3);
+	LOGUNIT_TEST(testProperties);
+	LOGUNIT_TEST_SUITE_END();
 
 public:
-   void setUp()
-   {
-      helpers::Pool p;
-      apr_file_copy("input/defaultInit3.properties", "log4cxx.properties", APR_FPROT_UREAD|APR_FPROT_UWRITE, p.getAPRPool());
-   }
-
-   void tearDown()
-   {
-      helpers::Pool p;
-      apr_file_remove("log4cxx.properties", p.getAPRPool());
-      LogManager::shutdown();
-   }
-
-   void testProperties()
-   {
-      LoggerPtr root = Logger::getRootLogger();
-     LOG4CXX_DEBUG(root, "Hello, world");
-      bool rootIsConfigured = !root->getAllAppenders().empty();
-      LOGUNIT_ASSERT(rootIsConfigured);
-
-      AppenderList list = root->getAllAppenders();
-      AppenderPtr appender = list.front();
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("D3"), appender->getName());
-   }
+	void setUp()
+	{
+		helpers::Pool p;
+		apr_file_copy("input/defaultInit3.properties", "log4cxx.properties", APR_FPROT_UREAD | APR_FPROT_UWRITE, p.getAPRPool());
+	}
+
+	void tearDown()
+	{
+		helpers::Pool p;
+		apr_file_remove("log4cxx.properties", p.getAPRPool());
+		LogManager::shutdown();
+	}
+
+	void testProperties()
+	{
+		LoggerPtr root = Logger::getRootLogger();
+		LOG4CXX_DEBUG(root, "Hello, world");
+		bool rootIsConfigured = !root->getAllAppenders().empty();
+		LOGUNIT_ASSERT(rootIsConfigured);
+
+		AppenderList list = root->getAllAppenders();
+		AppenderPtr appender = list.front();
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("D3"), appender->getName());
+	}
 
 };
 
diff --git a/src/test/cpp/defaultinit/testcase4.cpp b/src/test/cpp/defaultinit/testcase4.cpp
index d22806a..21e7f37 100644
--- a/src/test/cpp/defaultinit/testcase4.cpp
+++ b/src/test/cpp/defaultinit/testcase4.cpp
@@ -30,36 +30,36 @@ using namespace log4cxx;
 
 LOGUNIT_CLASS(TestCase4)
 {
-   LOGUNIT_TEST_SUITE(TestCase4);
-      LOGUNIT_TEST(combinedTest);
-   LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(TestCase4);
+	LOGUNIT_TEST(combinedTest);
+	LOGUNIT_TEST_SUITE_END();
 
 public:
-   void setUp()
-   {
-      helpers::Pool p;
-      apr_file_copy("input/xml/defaultInit.xml", "log4cxx.xml", APR_FPROT_UREAD|APR_FPROT_UWRITE, p.getAPRPool());
-   }
+	void setUp()
+	{
+		helpers::Pool p;
+		apr_file_copy("input/xml/defaultInit.xml", "log4cxx.xml", APR_FPROT_UREAD | APR_FPROT_UWRITE, p.getAPRPool());
+	}
 
-   void tearDown()
-   {
-      helpers::Pool p;
-      apr_file_remove("log4cxx.xml", p.getAPRPool());
-      LogManager::shutdown();
-   }
+	void tearDown()
+	{
+		helpers::Pool p;
+		apr_file_remove("log4cxx.xml", p.getAPRPool());
+		LogManager::shutdown();
+	}
 
-   void combinedTest()
-   {
-      LoggerPtr root = Logger::getRootLogger();
-     LOG4CXX_DEBUG(root, "Hello, world");
-      bool rootIsConfigured = !root->getAllAppenders().empty();
-      LOGUNIT_ASSERT(rootIsConfigured);
+	void combinedTest()
+	{
+		LoggerPtr root = Logger::getRootLogger();
+		LOG4CXX_DEBUG(root, "Hello, world");
+		bool rootIsConfigured = !root->getAllAppenders().empty();
+		LOGUNIT_ASSERT(rootIsConfigured);
 
-      AppenderList list = root->getAllAppenders();
-      LOGUNIT_ASSERT_EQUAL((size_t) 1, list.size());
-      AppenderPtr appender = list.front();
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("D1"), appender->getName());
-   }
+		AppenderList list = root->getAllAppenders();
+		LOGUNIT_ASSERT_EQUAL((size_t) 1, list.size());
+		AppenderPtr appender = list.front();
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("D1"), appender->getName());
+	}
 
 };
 
diff --git a/src/test/cpp/encodingtest.cpp b/src/test/cpp/encodingtest.cpp
index 3b04011..b2db84c 100644
--- a/src/test/cpp/encodingtest.cpp
+++ b/src/test/cpp/encodingtest.cpp
@@ -42,151 +42,161 @@ using namespace log4cxx::helpers;
  *
  *
  */
-LOGUNIT_CLASS(EncodingTest) {
-  LOGUNIT_TEST_SUITE(EncodingTest);
-          LOGUNIT_TEST(testASCII);
-          LOGUNIT_TEST(testLatin1);
-          LOGUNIT_TEST(testUtf8);
-          LOGUNIT_TEST(testUtf16);
-          LOGUNIT_TEST(testUtf16LE);
-          LOGUNIT_TEST(testUtf16BE);
-  LOGUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(EncodingTest)
+{
+	LOGUNIT_TEST_SUITE(EncodingTest);
+	LOGUNIT_TEST(testASCII);
+	LOGUNIT_TEST(testLatin1);
+	LOGUNIT_TEST(testUtf8);
+	LOGUNIT_TEST(testUtf16);
+	LOGUNIT_TEST(testUtf16LE);
+	LOGUNIT_TEST(testUtf16BE);
+	LOGUNIT_TEST_SUITE_END();
 public:
-    /**
-     * Resets configuration after each test.
-     */
-    void tearDown() {
-      Logger::getRootLogger()->getLoggerRepository()->resetConfiguration();
-    }
-
-
-    /**
-     * Test us-ascii encoding.
-     */
-  void testASCII() {
-      LoggerPtr root(Logger::getRootLogger());
-
-      configure(root, LOG4CXX_STR("output/encoding/ascii.log"),
-                      LOG4CXX_STR("US-ASCII"));
-      common(root);
-
-      BinaryCompare::compare( "output/encoding/ascii.log",
-                              "witness/encoding/ascii.log");
-  }
-
-    /**
-     * Test iso-8859-1 encoding.
-     */
-    void testLatin1() {
-        LoggerPtr root(Logger::getRootLogger());
-
-        configure(root, LOG4CXX_STR("output/encoding/latin1.log"),
-                        LOG4CXX_STR("iso-8859-1"));
-        common(root);
-
-        BinaryCompare::compare( "output/encoding/latin1.log",
-                                "witness/encoding/latin1.log");
-    }
-
-    /**
-     * Test utf-8 encoding.
-     */
-    void testUtf8() {
-        LoggerPtr root(Logger::getRootLogger());
-
-        configure(root, LOG4CXX_STR("output/encoding/UTF-8.log"),
-                        LOG4CXX_STR("UTF-8"));
-        common(root);
-
-        BinaryCompare::compare( "output/encoding/UTF-8.log",
-                                "witness/encoding/UTF-8.log");
-    }
-
-    /**
-     * Test utf-16 encoding.
-     */
-    void testUtf16() {
-        LoggerPtr root(Logger::getRootLogger());
-
-        configure(root, LOG4CXX_STR("output/encoding/UTF-16.log"),
-                        LOG4CXX_STR("UTF-16"));
-        common(root);
-
-        BinaryCompare::compare( "output/encoding/UTF-16.log",
-                                "witness/encoding/UTF-16.log");
-    }
-
-    /**
-     * Test utf-16be encoding.
-     */
-    void testUtf16BE() {
-        LoggerPtr root(Logger::getRootLogger());
-
-        configure(root, LOG4CXX_STR("output/encoding/UTF-16BE.log"),
-                        LOG4CXX_STR("UTF-16BE"));
-        common(root);
-
-        BinaryCompare::compare( "output/encoding/UTF-16BE.log",
-                                "witness/encoding/UTF-16BE.log");
-    }
-
-    /**
-     * Test utf16-le encoding.
-     */
-    void testUtf16LE() {
-        LoggerPtr root(Logger::getRootLogger());
-
-        configure(root, LOG4CXX_STR("output/encoding/UTF-16LE.log"),
-                        LOG4CXX_STR("UTF-16LE"));
-        common(root);
-
-        BinaryCompare::compare( "output/encoding/UTF-16LE.log",
-                                "witness/encoding/UTF-16LE.log");
-    }
-
-    /**
-     * Configure logging.
-     * @param logger logger
-     * @param filename logging file name
-     * @param encoding encoding
-     */
-    private:
-    void configure(      LoggerPtr& logger,
-                   const LogString& filename,
-                   const LogString& encoding) {
-        FileAppenderPtr  appender(new FileAppender());
-        PatternLayoutPtr layout(new PatternLayout());
-        Pool             p;
-
-        layout->setConversionPattern(LOG4CXX_STR("%p - %m\n"));
-        layout->activateOptions(p);
-
-        appender->setAppend(false);
-        appender->setEncoding(encoding);
-        appender->setFile(filename);
-        appender->setLayout(layout);
-        appender->activateOptions(p);
-
-        logger->addAppender(appender);
-        logger->setLevel(Level::getInfo());
-    }
-
-    /**
-     * Common logging requests.
-     * @param logger logger
-     */
-    void common(LoggerPtr& logger) {
-        logger->info("Hello, World");
-
-        // pi can be encoded in iso-8859-1
-        const wchar_t pi[] = { 0x00B9, 0 };
-        logger->info(pi);
-
-        //   arbitrary, hopefully meaningless, characters from
-        //     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
-        const wchar_t greeting[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x400, 0 };
-        logger->info(greeting);
-    }
+	/**
+	 * Resets configuration after each test.
+	 */
+	void tearDown()
+	{
+		Logger::getRootLogger()->getLoggerRepository()->resetConfiguration();
+	}
+
+
+	/**
+	 * Test us-ascii encoding.
+	 */
+	void testASCII()
+	{
+		LoggerPtr root(Logger::getRootLogger());
+
+		configure(root, LOG4CXX_STR("output/encoding/ascii.log"),
+			LOG4CXX_STR("US-ASCII"));
+		common(root);
+
+		BinaryCompare::compare( "output/encoding/ascii.log",
+			"witness/encoding/ascii.log");
+	}
+
+	/**
+	 * Test iso-8859-1 encoding.
+	 */
+	void testLatin1()
+	{
+		LoggerPtr root(Logger::getRootLogger());
+
+		configure(root, LOG4CXX_STR("output/encoding/latin1.log"),
+			LOG4CXX_STR("iso-8859-1"));
+		common(root);
+
+		BinaryCompare::compare( "output/encoding/latin1.log",
+			"witness/encoding/latin1.log");
+	}
+
+	/**
+	 * Test utf-8 encoding.
+	 */
+	void testUtf8()
+	{
+		LoggerPtr root(Logger::getRootLogger());
+
+		configure(root, LOG4CXX_STR("output/encoding/UTF-8.log"),
+			LOG4CXX_STR("UTF-8"));
+		common(root);
+
+		BinaryCompare::compare( "output/encoding/UTF-8.log",
+			"witness/encoding/UTF-8.log");
+	}
+
+	/**
+	 * Test utf-16 encoding.
+	 */
+	void testUtf16()
+	{
+		LoggerPtr root(Logger::getRootLogger());
+
+		configure(root, LOG4CXX_STR("output/encoding/UTF-16.log"),
+			LOG4CXX_STR("UTF-16"));
+		common(root);
+
+		BinaryCompare::compare( "output/encoding/UTF-16.log",
+			"witness/encoding/UTF-16.log");
+	}
+
+	/**
+	 * Test utf-16be encoding.
+	 */
+	void testUtf16BE()
+	{
+		LoggerPtr root(Logger::getRootLogger());
+
+		configure(root, LOG4CXX_STR("output/encoding/UTF-16BE.log"),
+			LOG4CXX_STR("UTF-16BE"));
+		common(root);
+
+		BinaryCompare::compare( "output/encoding/UTF-16BE.log",
+			"witness/encoding/UTF-16BE.log");
+	}
+
+	/**
+	 * Test utf16-le encoding.
+	 */
+	void testUtf16LE()
+	{
+		LoggerPtr root(Logger::getRootLogger());
+
+		configure(root, LOG4CXX_STR("output/encoding/UTF-16LE.log"),
+			LOG4CXX_STR("UTF-16LE"));
+		common(root);
+
+		BinaryCompare::compare( "output/encoding/UTF-16LE.log",
+			"witness/encoding/UTF-16LE.log");
+	}
+
+	/**
+	 * Configure logging.
+	 * @param logger logger
+	 * @param filename logging file name
+	 * @param encoding encoding
+	 */
+private:
+	void configure(      LoggerPtr & logger,
+		const LogString & filename,
+		const LogString & encoding)
+	{
+		FileAppenderPtr  appender(new FileAppender());
+		PatternLayoutPtr layout(new PatternLayout());
+		Pool             p;
+
+		layout->setConversionPattern(LOG4CXX_STR("%p - %m\n"));
+		layout->activateOptions(p);
+
+		appender->setAppend(false);
+		appender->setEncoding(encoding);
+		appender->setFile(filename);
+		appender->setLayout(layout);
+		appender->activateOptions(p);
+
+		logger->addAppender(appender);
+		logger->setLevel(Level::getInfo());
+	}
+
+	/**
+	 * Common logging requests.
+	 * @param logger logger
+	 */
+	void common(LoggerPtr & logger)
+	{
+		logger->info("Hello, World");
+
+		// pi can be encoded in iso-8859-1
+		const wchar_t pi[] = { 0x00B9, 0 };
+		logger->info(pi);
+
+		//   arbitrary, hopefully meaningless, characters from
+		//     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
+		const wchar_t greeting[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x400, 0 };
+		logger->info(greeting);
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(EncodingTest);
diff --git a/src/test/cpp/fileappendertest.cpp b/src/test/cpp/fileappendertest.cpp
index e16355a..30b99bf 100644
--- a/src/test/cpp/fileappendertest.cpp
+++ b/src/test/cpp/fileappendertest.cpp
@@ -27,56 +27,60 @@ using namespace log4cxx::helpers;
  *
  * FileAppender tests.
  */
-LOGUNIT_CLASS(FileAppenderTest) {
-  LOGUNIT_TEST_SUITE(FileAppenderTest);
-          LOGUNIT_TEST(testDirectoryCreation);
-          LOGUNIT_TEST(testgetSetThreshold);
-          LOGUNIT_TEST(testIsAsSevereAsThreshold);
-  LOGUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(FileAppenderTest)
+{
+	LOGUNIT_TEST_SUITE(FileAppenderTest);
+	LOGUNIT_TEST(testDirectoryCreation);
+	LOGUNIT_TEST(testgetSetThreshold);
+	LOGUNIT_TEST(testIsAsSevereAsThreshold);
+	LOGUNIT_TEST_SUITE_END();
 public:
-  /**
-   * Tests that any necessary directories are attempted to
-   * be created if they don't exist.  See bug 9150.
-   *
-   */
-  void testDirectoryCreation() {
-      File newFile(LOG4CXX_STR("output/newdir/temp.log"));
-      Pool p;
-      newFile.deleteFile(p);
+	/**
+	 * Tests that any necessary directories are attempted to
+	 * be created if they don't exist.  See bug 9150.
+	 *
+	 */
+	void testDirectoryCreation()
+	{
+		File newFile(LOG4CXX_STR("output/newdir/temp.log"));
+		Pool p;
+		newFile.deleteFile(p);
 
-      File newDir(LOG4CXX_STR("output/newdir"));
-      newDir.deleteFile(p);
+		File newDir(LOG4CXX_STR("output/newdir"));
+		newDir.deleteFile(p);
 
-      FileAppenderPtr wa(new FileAppender());
-      wa->setFile(LOG4CXX_STR("output/newdir/temp.log"));
-      wa->setLayout(new PatternLayout(LOG4CXX_STR("%m%n")));
-      wa->activateOptions(p);
+		FileAppenderPtr wa(new FileAppender());
+		wa->setFile(LOG4CXX_STR("output/newdir/temp.log"));
+		wa->setLayout(new PatternLayout(LOG4CXX_STR("%m%n")));
+		wa->activateOptions(p);
 
-      LOGUNIT_ASSERT(File(LOG4CXX_STR("output/newdir/temp.log")).exists(p));
-  }
+		LOGUNIT_ASSERT(File(LOG4CXX_STR("output/newdir/temp.log")).exists(p));
+	}
 
-  /**
-   * Tests getThreshold and setThreshold.
-   */
-  void testgetSetThreshold() {
-    FileAppenderPtr appender = new FileAppender();
-    LevelPtr debug = Level::getDebug();
-    //
-    //  different from log4j where threshold is null.
-    //
-    LOGUNIT_ASSERT_EQUAL(Level::getAll(), appender->getThreshold());
-    appender->setThreshold(debug);
-    LOGUNIT_ASSERT_EQUAL(debug, appender->getThreshold());
-  }
+	/**
+	 * Tests getThreshold and setThreshold.
+	 */
+	void testgetSetThreshold()
+	{
+		FileAppenderPtr appender = new FileAppender();
+		LevelPtr debug = Level::getDebug();
+		//
+		//  different from log4j where threshold is null.
+		//
+		LOGUNIT_ASSERT_EQUAL(Level::getAll(), appender->getThreshold());
+		appender->setThreshold(debug);
+		LOGUNIT_ASSERT_EQUAL(debug, appender->getThreshold());
+	}
 
-  /**
-   * Tests isAsSevereAsThreshold.
-   */
-  void testIsAsSevereAsThreshold() {
-    FileAppenderPtr appender = new FileAppender();
-    LevelPtr debug = Level::getDebug();
-    LOGUNIT_ASSERT(appender->isAsSevereAsThreshold(debug));
-  }
+	/**
+	 * Tests isAsSevereAsThreshold.
+	 */
+	void testIsAsSevereAsThreshold()
+	{
+		FileAppenderPtr appender = new FileAppender();
+		LevelPtr debug = Level::getDebug();
+		LOGUNIT_ASSERT(appender->isAsSevereAsThreshold(debug));
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(FileAppenderTest);
diff --git a/src/test/cpp/fileappendertestcase.cpp b/src/test/cpp/fileappendertestcase.cpp
index dadf034..1e469db 100644
--- a/src/test/cpp/fileappendertestcase.cpp
+++ b/src/test/cpp/fileappendertestcase.cpp
@@ -23,8 +23,9 @@
 using namespace log4cxx;
 using namespace log4cxx::helpers;
 
-WriterAppender* FileAppenderAbstractTestCase::createWriterAppender() const {
-    return createFileAppender();
+WriterAppender* FileAppenderAbstractTestCase::createWriterAppender() const
+{
+	return createFileAppender();
 }
 
 
@@ -33,78 +34,82 @@ WriterAppender* FileAppenderAbstractTestCase::createWriterAppender() const {
  */
 class FileAppenderTestCase : public FileAppenderAbstractTestCase
 {
-   LOGUNIT_TEST_SUITE(FileAppenderTestCase);
-                //
-                //    tests inherited from AppenderSkeletonTestCase
-                //
-                LOGUNIT_TEST(testDefaultThreshold);
-                LOGUNIT_TEST(testSetOptionThreshold);
-
-                //  tests defined here
-                LOGUNIT_TEST(testSetDoubleBackslashes);
-                LOGUNIT_TEST(testStripDuplicateBackslashes);
-
-   LOGUNIT_TEST_SUITE_END();
-
-
-
-
-public:
-
-        FileAppender* createFileAppender() const {
-          return new log4cxx::FileAppender();
-        }
-
-        void testSetDoubleBackslashes() {
-            FileAppender appender;
-            appender.setOption(LOG4CXX_STR("FILE"), LOG4CXX_STR("output\\\\temp"));
-            const File& file = appender.getFile();
-            LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("output\\temp"), file.getPath()); 
-        }
-
-          /**
-           * Tests that double backslashes in filespecs are stripped
-           *  on calls to setOption.
-           * 
-           */
-        void testStripDoubleBackslashes() {
-
-            FileAppender appender;
-            appender.setOption(LOG4CXX_STR("FILE"), LOG4CXX_STR("output\\\\temp"));
-            const File& file = appender.getFile();
-            LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("output\\temp"), file.getPath()); 
-        }
-
-          /**
-           * Tests stripDuplicateBackslashes
-           *
-           * 
-           */
-        void testStripDuplicateBackslashes() {
-             LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo\\bar\\foo"), 
-                 FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\foo\\bar\\foo")));
-             LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo\\bar\\foo\\"), 
-                FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\foo\\\\bar\\\\foo\\\\")));
-             LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo\\bar\\foo\\"), 
-                FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\foo\\bar\\foo\\")));
-             //
-             //   UNC's should either start with two backslashes and contain additional singles
-             //       or four back slashes and addition doubles
-             LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\\\foo\\bar\\foo"), 
-                FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\\\\\foo\\\\bar\\\\foo")));
-             LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\\\foo\\bar\\foo"), 
-                FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\foo\\bar\\foo")));
-            //
-            //   it it starts with doubles but has no other path component
-            //      then it is a file path
-             LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo.log"), 
-                FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\foo.log")));
-            //
-            //   it it starts with quads but has no other path component
-            //      then it is a UNC
-             LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\\\foo.log"), 
-                FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\\\\\foo.log")));
-          }  
+		LOGUNIT_TEST_SUITE(FileAppenderTestCase);
+		//
+		//    tests inherited from AppenderSkeletonTestCase
+		//
+		LOGUNIT_TEST(testDefaultThreshold);
+		LOGUNIT_TEST(testSetOptionThreshold);
+
+		//  tests defined here
+		LOGUNIT_TEST(testSetDoubleBackslashes);
+		LOGUNIT_TEST(testStripDuplicateBackslashes);
+
+		LOGUNIT_TEST_SUITE_END();
+
+
+
+
+	public:
+
+		FileAppender* createFileAppender() const
+		{
+			return new log4cxx::FileAppender();
+		}
+
+		void testSetDoubleBackslashes()
+		{
+			FileAppender appender;
+			appender.setOption(LOG4CXX_STR("FILE"), LOG4CXX_STR("output\\\\temp"));
+			const File& file = appender.getFile();
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("output\\temp"), file.getPath());
+		}
+
+		/**
+		 * Tests that double backslashes in filespecs are stripped
+		 *  on calls to setOption.
+		 *
+		 */
+		void testStripDoubleBackslashes()
+		{
+
+			FileAppender appender;
+			appender.setOption(LOG4CXX_STR("FILE"), LOG4CXX_STR("output\\\\temp"));
+			const File& file = appender.getFile();
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("output\\temp"), file.getPath());
+		}
+
+		/**
+		 * Tests stripDuplicateBackslashes
+		 *
+		 *
+		 */
+		void testStripDuplicateBackslashes()
+		{
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo\\bar\\foo"),
+				FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\foo\\bar\\foo")));
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo\\bar\\foo\\"),
+				FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\foo\\\\bar\\\\foo\\\\")));
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo\\bar\\foo\\"),
+				FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\foo\\bar\\foo\\")));
+			//
+			//   UNC's should either start with two backslashes and contain additional singles
+			//       or four back slashes and addition doubles
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\\\foo\\bar\\foo"),
+				FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\\\\\foo\\\\bar\\\\foo")));
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\\\foo\\bar\\foo"),
+				FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\foo\\bar\\foo")));
+			//
+			//   it it starts with doubles but has no other path component
+			//      then it is a file path
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\foo.log"),
+				FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\foo.log")));
+			//
+			//   it it starts with quads but has no other path component
+			//      then it is a UNC
+			LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("\\\\foo.log"),
+				FileAppender::stripDuplicateBackslashes(LOG4CXX_STR("\\\\\\\\foo.log")));
+		}
 
 };
 
diff --git a/src/test/cpp/fileappendertestcase.h b/src/test/cpp/fileappendertestcase.h
index 4eabed3..f8caa49 100644
--- a/src/test/cpp/fileappendertestcase.h
+++ b/src/test/cpp/fileappendertestcase.h
@@ -26,9 +26,9 @@
 class FileAppenderAbstractTestCase : public WriterAppenderTestCase
 {
 
-public:
-        log4cxx::WriterAppender* createWriterAppender() const;
+	public:
+		log4cxx::WriterAppender* createWriterAppender() const;
 
-        virtual log4cxx::FileAppender* createFileAppender() const = 0;
+		virtual log4cxx::FileAppender* createFileAppender() const = 0;
 
 };
diff --git a/src/test/cpp/filetestcase.cpp b/src/test/cpp/filetestcase.cpp
index 06efce2..70009a9 100644
--- a/src/test/cpp/filetestcase.cpp
+++ b/src/test/cpp/filetestcase.cpp
@@ -29,7 +29,7 @@
 #include <log4cxx/helpers/fileinputstream.h>
 
 #if LOG4CXX_CFSTRING_API
-#include <CoreFoundation/CFString.h>
+	#include <CoreFoundation/CFString.h>
 #endif
 
 using namespace log4cxx;
@@ -38,147 +38,164 @@ using namespace log4cxx::helpers;
 
 LOGUNIT_CLASS(FileTestCase)
 {
-        LOGUNIT_TEST_SUITE(FileTestCase);
-                LOGUNIT_TEST(defaultConstructor);
-                LOGUNIT_TEST(defaultExists);
-                LOGUNIT_TEST(defaultRead);
-                LOGUNIT_TEST(propertyRead);
-                LOGUNIT_TEST(propertyExists);
-                LOGUNIT_TEST(fileWrite1);
+	LOGUNIT_TEST_SUITE(FileTestCase);
+	LOGUNIT_TEST(defaultConstructor);
+	LOGUNIT_TEST(defaultExists);
+	LOGUNIT_TEST(defaultRead);
+	LOGUNIT_TEST(propertyRead);
+	LOGUNIT_TEST(propertyExists);
+	LOGUNIT_TEST(fileWrite1);
 #if LOG4CXX_WCHAR_T_API
-                LOGUNIT_TEST(wcharConstructor);
+	LOGUNIT_TEST(wcharConstructor);
 #endif
 #if LOG4CXX_UNICHAR_API
-                LOGUNIT_TEST(unicharConstructor);
+	LOGUNIT_TEST(unicharConstructor);
 #endif
 #if LOG4CXX_CFSTRING_API
-                LOGUNIT_TEST(cfstringConstructor);
+	LOGUNIT_TEST(cfstringConstructor);
 #endif
-                LOGUNIT_TEST(copyConstructor);
-                LOGUNIT_TEST(assignment);
-                LOGUNIT_TEST(deleteBackslashedFileName);
-        LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST(copyConstructor);
+	LOGUNIT_TEST(assignment);
+	LOGUNIT_TEST(deleteBackslashedFileName);
+	LOGUNIT_TEST_SUITE_END();
 
 public:
-        void defaultConstructor() {
-          File defFile;
-          LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR(""), defFile.getPath());
-        }
-
-
-
-        void defaultExists() {
-          File defFile;
-          Pool pool;
-          bool exists = defFile.exists(pool);
-          LOGUNIT_ASSERT_EQUAL(false, exists);
-        }
-
-        // check default constructor. read() throws an exception
-        // if no file name was given.
-        void defaultRead() {
-          File defFile;
-          Pool pool;
-          try {
-            InputStreamPtr defInput = new FileInputStream(defFile);
-            InputStreamReaderPtr inputReader = new InputStreamReader(defInput);
-            LogString contents(inputReader->read(pool));
-            LOGUNIT_ASSERT(false);
-          } catch(IOException &ex) {
-          }
-        }
+	void defaultConstructor()
+	{
+		File defFile;
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR(""), defFile.getPath());
+	}
+
+
+
+	void defaultExists()
+	{
+		File defFile;
+		Pool pool;
+		bool exists = defFile.exists(pool);
+		LOGUNIT_ASSERT_EQUAL(false, exists);
+	}
+
+	// check default constructor. read() throws an exception
+	// if no file name was given.
+	void defaultRead()
+	{
+		File defFile;
+		Pool pool;
+
+		try
+		{
+			InputStreamPtr defInput = new FileInputStream(defFile);
+			InputStreamReaderPtr inputReader = new InputStreamReader(defInput);
+			LogString contents(inputReader->read(pool));
+			LOGUNIT_ASSERT(false);
+		}
+		catch (IOException& ex)
+		{
+		}
+	}
 
 
 #if LOG4CXX_WCHAR_T_API
-        void wcharConstructor() {
-            File propFile(L"input/patternLayout1.properties");
-            Pool pool;
-            bool exists = propFile.exists(pool);
-            LOGUNIT_ASSERT_EQUAL(true, exists);
-       }
+	void wcharConstructor()
+	{
+		File propFile(L"input/patternLayout1.properties");
+		Pool pool;
+		bool exists = propFile.exists(pool);
+		LOGUNIT_ASSERT_EQUAL(true, exists);
+	}
 #endif
 
 #if LOG4CXX_UNICHAR_API
-        void unicharConstructor() {
-            const log4cxx::UniChar filename[] = { 'i', 'n', 'p', 'u', 't', '/', 
-               'p', 'a', 't', 't', 'e', 'r', 'n', 'L', 'a', 'y', 'o', 'u', 't', '1', '.', 
-               'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', 0 };
-            File propFile(filename);
-            Pool pool;
-            bool exists = propFile.exists(pool);
-            LOGUNIT_ASSERT_EQUAL(true, exists);
-       }
+	void unicharConstructor()
+	{
+		const log4cxx::UniChar filename[] = { 'i', 'n', 'p', 'u', 't', '/',
+				'p', 'a', 't', 't', 'e', 'r', 'n', 'L', 'a', 'y', 'o', 'u', 't', '1', '.',
+				'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', 0
+			};
+		File propFile(filename);
+		Pool pool;
+		bool exists = propFile.exists(pool);
+		LOGUNIT_ASSERT_EQUAL(true, exists);
+	}
 #endif
 
 #if LOG4CXX_CFSTRING_API
-        void cfstringConstructor() {
-            File propFile(CFSTR("input/patternLayout.properties"));
-            Pool pool;
-            bool exists = propFile.exists(pool);
-            LOGUNIT_ASSERT_EQUAL(true, exists);
-       }
+	void cfstringConstructor()
+	{
+		File propFile(CFSTR("input/patternLayout.properties"));
+		Pool pool;
+		bool exists = propFile.exists(pool);
+		LOGUNIT_ASSERT_EQUAL(true, exists);
+	}
 #endif
 
-        void copyConstructor() {
-            File propFile("input/patternLayout1.properties");
-            File copy(propFile);
-            Pool pool;
-            bool exists = copy.exists(pool);
-            LOGUNIT_ASSERT_EQUAL(true, exists);
-        }
-
-        void assignment() {
-            File propFile("input/patternLayout1.properties");
-            File copy = propFile;
-            Pool pool;
-            bool exists = copy.exists(pool);
-            LOGUNIT_ASSERT_EQUAL(true, exists);
-        }
-
-        void propertyRead() {
-          File propFile("input/patternLayout1.properties");
-          Pool pool;
-          InputStreamPtr propStream = new FileInputStream(propFile);
-          InputStreamReaderPtr propReader = new InputStreamReader(propStream);
-          LogString props(propReader->read(pool));
-          LogString line1(LOG4CXX_STR("# Licensed to the Apache Software Foundation (ASF) under one or more"));
-          LOGUNIT_ASSERT_EQUAL(line1, props.substr(0, line1.length()));
-        }
-
-        void propertyExists() {
-          File propFile("input/patternLayout1.properties");
-          Pool pool;
-          bool exists = propFile.exists(pool);
-          LOGUNIT_ASSERT_EQUAL(true, exists);
-        }
-
-        void fileWrite1() {
-          OutputStreamPtr fos =
-                      new FileOutputStream(LOG4CXX_STR("output/fileWrite1.txt"));
-          OutputStreamWriterPtr osw = new OutputStreamWriter(fos);
-
-          Pool pool;
-          LogString greeting(LOG4CXX_STR("Hello, World"));
-          greeting.append(LOG4CXX_EOL);
-          osw->write(greeting, pool);
-
-          InputStreamPtr is =
-                      new FileInputStream(LOG4CXX_STR("output/fileWrite1.txt"));
-          InputStreamReaderPtr isr = new InputStreamReader(is);
-          LogString reply = isr->read(pool);
-
-          LOGUNIT_ASSERT_EQUAL(greeting, reply);
-        }
-
-        /**
-         *  Tests conversion of backslash containing file names.
-         *  Would cause infinite loop due to bug LOGCXX-105.
-         */
-        void deleteBackslashedFileName() {
-          File file("output\\bogus.txt");
-          Pool pool;
-          /*bool deleted = */file.deleteFile(pool);
-        }
+	void copyConstructor()
+	{
+		File propFile("input/patternLayout1.properties");
+		File copy(propFile);
+		Pool pool;
+		bool exists = copy.exists(pool);
+		LOGUNIT_ASSERT_EQUAL(true, exists);
+	}
+
+	void assignment()
+	{
+		File propFile("input/patternLayout1.properties");
+		File copy = propFile;
+		Pool pool;
+		bool exists = copy.exists(pool);
+		LOGUNIT_ASSERT_EQUAL(true, exists);
+	}
+
+	void propertyRead()
+	{
+		File propFile("input/patternLayout1.properties");
+		Pool pool;
+		InputStreamPtr propStream = new FileInputStream(propFile);
+		InputStreamReaderPtr propReader = new InputStreamReader(propStream);
+		LogString props(propReader->read(pool));
+		LogString line1(LOG4CXX_STR("# Licensed to the Apache Software Foundation (ASF) under one or more"));
+		LOGUNIT_ASSERT_EQUAL(line1, props.substr(0, line1.length()));
+	}
+
+	void propertyExists()
+	{
+		File propFile("input/patternLayout1.properties");
+		Pool pool;
+		bool exists = propFile.exists(pool);
+		LOGUNIT_ASSERT_EQUAL(true, exists);
+	}
+
+	void fileWrite1()
+	{
+		OutputStreamPtr fos =
+			new FileOutputStream(LOG4CXX_STR("output/fileWrite1.txt"));
+		OutputStreamWriterPtr osw = new OutputStreamWriter(fos);
+
+		Pool pool;
+		LogString greeting(LOG4CXX_STR("Hello, World"));
+		greeting.append(LOG4CXX_EOL);
+		osw->write(greeting, pool);
+
+		InputStreamPtr is =
+			new FileInputStream(LOG4CXX_STR("output/fileWrite1.txt"));
+		InputStreamReaderPtr isr = new InputStreamReader(is);
+		LogString reply = isr->read(pool);
+
+		LOGUNIT_ASSERT_EQUAL(greeting, reply);
+	}
+
+	/**
+	 *  Tests conversion of backslash containing file names.
+	 *  Would cause infinite loop due to bug LOGCXX-105.
+	 */
+	void deleteBackslashedFileName()
+	{
+		File file("output\\bogus.txt");
+		Pool pool;
+		/*bool deleted = */file.deleteFile(pool);
+	}
 };
 
 
diff --git a/src/test/cpp/filter/andfiltertest.cpp b/src/test/cpp/filter/andfiltertest.cpp
index aaee1cb..96defe4 100644
--- a/src/test/cpp/filter/andfiltertest.cpp
+++ b/src/test/cpp/filter/andfiltertest.cpp
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include <log4cxx/filter/andfilter.h>
 #include <log4cxx/logger.h>
 #include <log4cxx/spi/filter.h>
@@ -26,152 +26,159 @@
 
 using namespace log4cxx;
 using namespace log4cxx::filter;
-using namespace log4cxx::spi; 
+using namespace log4cxx::spi;
 using namespace log4cxx::helpers;
 
 
 /**
  * Unit tests for AndFilter.
  */
-LOGUNIT_CLASS(AndFilterTest) {
-    LOGUNIT_TEST_SUITE(AndFilterTest);
-       LOGUNIT_TEST(test1);
-       LOGUNIT_TEST(test2);
-       LOGUNIT_TEST(test3);
-       LOGUNIT_TEST(test4);
-       LOGUNIT_TEST(test5);
-       LOGUNIT_TEST(test6);
-    LOGUNIT_TEST_SUITE_END();
-    
+LOGUNIT_CLASS(AndFilterTest)
+{
+	LOGUNIT_TEST_SUITE(AndFilterTest);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST(test3);
+	LOGUNIT_TEST(test4);
+	LOGUNIT_TEST(test5);
+	LOGUNIT_TEST(test6);
+	LOGUNIT_TEST_SUITE_END();
+
 public:
-    
 
-    /**
-     * Check that AndFilter.decide() returns Filter.ACCEPT if no filters added.
-     */
-    void test1() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        FilterPtr filter(new AndFilter());
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
-    
-    /**
-     * Check that AndFilter.decide() returns Filter.ACCEPT if
-     *    only nested filter returns Filter.ACCEPT.
-     */
-    void test2() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        AndFilterPtr filter(new AndFilter());
-        LevelMatchFilterPtr filter1(new LevelMatchFilter());
-        filter1->setLevelToMatch(LOG4CXX_STR("info"));
-        Pool p;
-        filter1->activateOptions(p);
-        filter->addFilter(filter1);
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
 
-    /**
-     * Check that AndFilter.decide() returns Filter.ACCEPT if
-     *    two nested filters return Filter.ACCEPT.
-     */
-    void test3() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        AndFilterPtr filter(new AndFilter());
-        LevelMatchFilterPtr filter1(new LevelMatchFilter());
-        filter1->setLevelToMatch(LOG4CXX_STR("info"));
-        Pool p;
-        filter1->activateOptions(p);
-        filter->addFilter(filter1);
-        LevelMatchFilterPtr filter2(new LevelMatchFilter());
-        filter2->setLevelToMatch(LOG4CXX_STR("info"));
-        filter2->activateOptions(p);
-        filter->addFilter(filter2);
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
+	/**
+	 * Check that AndFilter.decide() returns Filter.ACCEPT if no filters added.
+	 */
+	void test1()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		FilterPtr filter(new AndFilter());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
+
+	/**
+	 * Check that AndFilter.decide() returns Filter.ACCEPT if
+	 *    only nested filter returns Filter.ACCEPT.
+	 */
+	void test2()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		AndFilterPtr filter(new AndFilter());
+		LevelMatchFilterPtr filter1(new LevelMatchFilter());
+		filter1->setLevelToMatch(LOG4CXX_STR("info"));
+		Pool p;
+		filter1->activateOptions(p);
+		filter->addFilter(filter1);
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
+
+	/**
+	 * Check that AndFilter.decide() returns Filter.ACCEPT if
+	 *    two nested filters return Filter.ACCEPT.
+	 */
+	void test3()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		AndFilterPtr filter(new AndFilter());
+		LevelMatchFilterPtr filter1(new LevelMatchFilter());
+		filter1->setLevelToMatch(LOG4CXX_STR("info"));
+		Pool p;
+		filter1->activateOptions(p);
+		filter->addFilter(filter1);
+		LevelMatchFilterPtr filter2(new LevelMatchFilter());
+		filter2->setLevelToMatch(LOG4CXX_STR("info"));
+		filter2->activateOptions(p);
+		filter->addFilter(filter2);
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
 
-    /**
-     * Check that AndFilter.decide() returns Filter.DENY if
-     *    only nested filter returns Filter.ACCEPT
-     *    and acceptOnMatch is false.
-     */
-    void test4() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        AndFilterPtr filter(new AndFilter());
-        LevelMatchFilterPtr filter1(new LevelMatchFilter());
-        filter1->setLevelToMatch(LOG4CXX_STR("info"));
-        Pool p;
-        filter1->activateOptions(p);
-        filter->addFilter(filter1);
-        filter->setAcceptOnMatch(false);
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
-    }
+	/**
+	 * Check that AndFilter.decide() returns Filter.DENY if
+	 *    only nested filter returns Filter.ACCEPT
+	 *    and acceptOnMatch is false.
+	 */
+	void test4()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		AndFilterPtr filter(new AndFilter());
+		LevelMatchFilterPtr filter1(new LevelMatchFilter());
+		filter1->setLevelToMatch(LOG4CXX_STR("info"));
+		Pool p;
+		filter1->activateOptions(p);
+		filter->addFilter(filter1);
+		filter->setAcceptOnMatch(false);
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
+	}
 
-    /**
-     * Check that AndFilter.decide() returns Filter.NEUTRAL if
-     *    nested filters return Filter.ACCEPT and Filter.DENY.
-     */
-    void test5() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        AndFilterPtr filter(new AndFilter());
-        LevelMatchFilterPtr filter1(new LevelMatchFilter());
-        filter1->setLevelToMatch(LOG4CXX_STR("info"));
-        Pool p;
-        filter1->activateOptions(p);
-        filter->addFilter(filter1);
-        FilterPtr filter2(new DenyAllFilter());
-        filter2->activateOptions(p);
-        filter->addFilter(filter2);
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that AndFilter.decide() returns Filter.NEUTRAL if
+	 *    nested filters return Filter.ACCEPT and Filter.DENY.
+	 */
+	void test5()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		AndFilterPtr filter(new AndFilter());
+		LevelMatchFilterPtr filter1(new LevelMatchFilter());
+		filter1->setLevelToMatch(LOG4CXX_STR("info"));
+		Pool p;
+		filter1->activateOptions(p);
+		filter->addFilter(filter1);
+		FilterPtr filter2(new DenyAllFilter());
+		filter2->activateOptions(p);
+		filter->addFilter(filter2);
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
-    /**
-     * Check that AndFilter.decide() returns Filter.NEUTRAL if
-     *    nested filters return Filter.ACCEPT and Filter.NEUTRAL.
-     */
-    void test6() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        AndFilterPtr filter(new AndFilter());
-        LevelMatchFilterPtr filter1(new LevelMatchFilter());
-        filter1->setLevelToMatch(LOG4CXX_STR("info"));
-        Pool p;
-        filter1->activateOptions(p);
-        filter->addFilter(filter1);
-        FilterPtr filter2(new StringMatchFilter());
-        filter2->activateOptions(p);
-        filter->addFilter(filter2);
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that AndFilter.decide() returns Filter.NEUTRAL if
+	 *    nested filters return Filter.ACCEPT and Filter.NEUTRAL.
+	 */
+	void test6()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.AndFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		AndFilterPtr filter(new AndFilter());
+		LevelMatchFilterPtr filter1(new LevelMatchFilter());
+		filter1->setLevelToMatch(LOG4CXX_STR("info"));
+		Pool p;
+		filter1->activateOptions(p);
+		filter->addFilter(filter1);
+		FilterPtr filter2(new StringMatchFilter());
+		filter2->activateOptions(p);
+		filter->addFilter(filter2);
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 };
 
 
diff --git a/src/test/cpp/filter/denyallfiltertest.cpp b/src/test/cpp/filter/denyallfiltertest.cpp
index 785310f..1ff1f7b 100644
--- a/src/test/cpp/filter/denyallfiltertest.cpp
+++ b/src/test/cpp/filter/denyallfiltertest.cpp
@@ -22,33 +22,35 @@
 
 using namespace log4cxx;
 using namespace log4cxx::filter;
-using namespace log4cxx::spi; 
+using namespace log4cxx::spi;
 using namespace log4cxx::helpers;
 
 
 /**
  * Unit tests for DenyAllFilter.
  */
-LOGUNIT_CLASS(DenyAllFilterTest) {
-    LOGUNIT_TEST_SUITE(DenyAllFilterTest);
-       LOGUNIT_TEST(test1);
-    LOGUNIT_TEST_SUITE_END();
-
+LOGUNIT_CLASS(DenyAllFilterTest)
+{
+	LOGUNIT_TEST_SUITE(DenyAllFilterTest);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST_SUITE_END();
+
 public:
-    /**
-     * Check that DenyAllFilter.decide() returns Filter.DENY.
-     */
-    void test1() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.DenyAllFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        FilterPtr filter(new DenyAllFilter());
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
-    }
+	/**
+	 * Check that DenyAllFilter.decide() returns Filter.DENY.
+	 */
+	void test1()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.DenyAllFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		FilterPtr filter(new DenyAllFilter());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
+	}
 
 };
 
diff --git a/src/test/cpp/filter/levelmatchfiltertest.cpp b/src/test/cpp/filter/levelmatchfiltertest.cpp
index 6dfb685..3acbb8f 100644
--- a/src/test/cpp/filter/levelmatchfiltertest.cpp
+++ b/src/test/cpp/filter/levelmatchfiltertest.cpp
@@ -22,106 +22,112 @@
 
 using namespace log4cxx;
 using namespace log4cxx::filter;
-using namespace log4cxx::spi; 
+using namespace log4cxx::spi;
 using namespace log4cxx::helpers;
 
 
 /**
  * Unit tests for LevelMatchFilter.
  */
-LOGUNIT_CLASS(LevelMatchFilterTest) {
-    LOGUNIT_TEST_SUITE(LevelMatchFilterTest);
-       LOGUNIT_TEST(test1);
-       LOGUNIT_TEST(test2);
-       LOGUNIT_TEST(test3);
-       LOGUNIT_TEST(test4);
-       LOGUNIT_TEST(test5);
-    LOGUNIT_TEST_SUITE_END();
-    
+LOGUNIT_CLASS(LevelMatchFilterTest)
+{
+	LOGUNIT_TEST_SUITE(LevelMatchFilterTest);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST(test3);
+	LOGUNIT_TEST(test4);
+	LOGUNIT_TEST(test5);
+	LOGUNIT_TEST_SUITE_END();
+
 public:
-    /**
-     * Check that LevelMatchFilter.decide() returns Filter.ACCEPT when level matches.
-     */
-    void test1() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelMatchFilterPtr filter(new LevelMatchFilter());
-        filter->setLevelToMatch(LOG4CXX_STR("info"));
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
+	/**
+	 * Check that LevelMatchFilter.decide() returns Filter.ACCEPT when level matches.
+	 */
+	void test1()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelMatchFilterPtr filter(new LevelMatchFilter());
+		filter->setLevelToMatch(LOG4CXX_STR("info"));
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelMatchFilter.decide() returns Filter.DENY
-     *    when level matches and acceptOnMatch = false.
-     */
-    void test2() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelMatchFilterPtr filter(new LevelMatchFilter());
-        filter->setLevelToMatch(LOG4CXX_STR("info"));
-        filter->setAcceptOnMatch(false);
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
-    }
+	/**
+	 * Check that LevelMatchFilter.decide() returns Filter.DENY
+	 *    when level matches and acceptOnMatch = false.
+	 */
+	void test2()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelMatchFilterPtr filter(new LevelMatchFilter());
+		filter->setLevelToMatch(LOG4CXX_STR("info"));
+		filter->setAcceptOnMatch(false);
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelMatchFilter.decide() returns Filter.NEUTRAL
-     *    when levelToMatch is unspecified.
-     */
-    void test3() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelMatchFilterPtr filter(new LevelMatchFilter());
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that LevelMatchFilter.decide() returns Filter.NEUTRAL
+	 *    when levelToMatch is unspecified.
+	 */
+	void test3()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelMatchFilterPtr filter(new LevelMatchFilter());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelMatchFilter.decide() returns Filter.NEUTRAL
-     *    when event level is higher than level to match.
-     */
-    void test4() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelMatchFilterPtr filter(new LevelMatchFilter());
-        filter->setLevelToMatch(LOG4CXX_STR("debug"));
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that LevelMatchFilter.decide() returns Filter.NEUTRAL
+	 *    when event level is higher than level to match.
+	 */
+	void test4()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelMatchFilterPtr filter(new LevelMatchFilter());
+		filter->setLevelToMatch(LOG4CXX_STR("debug"));
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelMatchFilter.decide() returns Filter.NEUTRAL
-     *    when event level is lower than level to match.
-     */
-    void test5() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelMatchFilterPtr filter(new LevelMatchFilter());
-        filter->setLevelToMatch(LOG4CXX_STR("warn"));
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that LevelMatchFilter.decide() returns Filter.NEUTRAL
+	 *    when event level is lower than level to match.
+	 */
+	void test5()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.LevelMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelMatchFilterPtr filter(new LevelMatchFilter());
+		filter->setLevelToMatch(LOG4CXX_STR("warn"));
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(LevelMatchFilterTest);
diff --git a/src/test/cpp/filter/levelrangefiltertest.cpp b/src/test/cpp/filter/levelrangefiltertest.cpp
index a5c413f..f0971f6 100644
--- a/src/test/cpp/filter/levelrangefiltertest.cpp
+++ b/src/test/cpp/filter/levelrangefiltertest.cpp
@@ -22,127 +22,134 @@
 
 using namespace log4cxx;
 using namespace log4cxx::filter;
-using namespace log4cxx::spi; 
+using namespace log4cxx::spi;
 using namespace log4cxx::helpers;
 
 
 /**
  * Unit tests for LevelRangeFilter.
  */
-LOGUNIT_CLASS(LevelRangeFilterTest) {
-    LOGUNIT_TEST_SUITE(LevelRangeFilterTest);
-       LOGUNIT_TEST(test1);
-       LOGUNIT_TEST(test2);
-       LOGUNIT_TEST(test3);
-       LOGUNIT_TEST(test4);
-       LOGUNIT_TEST(test5);
-       LOGUNIT_TEST(test6);
-    LOGUNIT_TEST_SUITE_END();
-    
+LOGUNIT_CLASS(LevelRangeFilterTest)
+{
+	LOGUNIT_TEST_SUITE(LevelRangeFilterTest);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST(test3);
+	LOGUNIT_TEST(test4);
+	LOGUNIT_TEST(test5);
+	LOGUNIT_TEST(test6);
+	LOGUNIT_TEST_SUITE_END();
+
 public:
-    /**
-     * Check that LevelRangefilter->decide() returns Filter::DENY
-     *     when event level is below min level.
-     */
-    void test1() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelRangeFilterPtr filter(new LevelRangeFilter());
-        filter->setLevelMin(Level::getWarn());
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
-    }
+	/**
+	 * Check that LevelRangefilter->decide() returns Filter::DENY
+	 *     when event level is below min level.
+	 */
+	void test1()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelRangeFilterPtr filter(new LevelRangeFilter());
+		filter->setLevelMin(Level::getWarn());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelRangefilter->decide() returns Filter::DENY
-     *    when event level is above max level.
-     */
-    void test2() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelRangeFilterPtr filter(new LevelRangeFilter());
-        filter->setLevelMax(Level::getDebug());
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
-    }
+	/**
+	 * Check that LevelRangefilter->decide() returns Filter::DENY
+	 *    when event level is above max level.
+	 */
+	void test2()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelRangeFilterPtr filter(new LevelRangeFilter());
+		filter->setLevelMax(Level::getDebug());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelRangefilter->decide() returns Filter::ACCEPT
-     *    when event level is above min level.
-     */
-    void test3() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelRangeFilterPtr filter(new LevelRangeFilter());
-        filter->setLevelMin(Level::getDebug());
-        filter->setAcceptOnMatch(true);
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
+	/**
+	 * Check that LevelRangefilter->decide() returns Filter::ACCEPT
+	 *    when event level is above min level.
+	 */
+	void test3()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelRangeFilterPtr filter(new LevelRangeFilter());
+		filter->setLevelMin(Level::getDebug());
+		filter->setAcceptOnMatch(true);
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelRangefilter->decide() returns Filter::ACCEPT
-     *    when event level is below max level.
-     */
-    void test4() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelRangeFilterPtr filter(new LevelRangeFilter());
-        filter->setLevelMax(Level::getError());
-        filter->setAcceptOnMatch(true);
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
+	/**
+	 * Check that LevelRangefilter->decide() returns Filter::ACCEPT
+	 *    when event level is below max level.
+	 */
+	void test4()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelRangeFilterPtr filter(new LevelRangeFilter());
+		filter->setLevelMax(Level::getError());
+		filter->setAcceptOnMatch(true);
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelRangeFilter::decide() returns Filter::NEUTRAL
-     *    when event level is above min level and accept on match is false.
-     */
-    void test5() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelRangeFilterPtr filter(new LevelRangeFilter());
-        filter->setLevelMin(Level::getDebug());
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that LevelRangeFilter::decide() returns Filter::NEUTRAL
+	 *    when event level is above min level and accept on match is false.
+	 */
+	void test5()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelRangeFilterPtr filter(new LevelRangeFilter());
+		filter->setLevelMin(Level::getDebug());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
-    /**
-     * Check that LevelRangeFilter::decide() returns Filter::NEUTRAL
-     *    when event level is below max level and accept on match is false.
-     */
-    void test6() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LevelRangeFilterPtr filter(new LevelRangeFilter());
-        filter->setLevelMax(Level::getError());
-        Pool p;
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that LevelRangeFilter::decide() returns Filter::NEUTRAL
+	 *    when event level is below max level and accept on match is false.
+	 */
+	void test6()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.Filter::LevelRangeFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LevelRangeFilterPtr filter(new LevelRangeFilter());
+		filter->setLevelMax(Level::getError());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(LevelRangeFilterTest);
diff --git a/src/test/cpp/filter/loggermatchfiltertest.cpp b/src/test/cpp/filter/loggermatchfiltertest.cpp
index 03d7768..88adb06 100644
--- a/src/test/cpp/filter/loggermatchfiltertest.cpp
+++ b/src/test/cpp/filter/loggermatchfiltertest.cpp
@@ -22,87 +22,92 @@
 
 using namespace log4cxx;
 using namespace log4cxx::filter;
-using namespace log4cxx::spi; 
+using namespace log4cxx::spi;
 using namespace log4cxx::helpers;
 
 
 /**
  * Unit tests for LoggerMatchFilter.
  */
-LOGUNIT_CLASS(LoggerMatchFilterTest) {
-    LOGUNIT_TEST_SUITE(LoggerMatchFilterTest);
-       LOGUNIT_TEST(test1);
-       LOGUNIT_TEST(test2);
-       LOGUNIT_TEST(test3);
-       LOGUNIT_TEST(test4);
-    LOGUNIT_TEST_SUITE_END();
-    
+LOGUNIT_CLASS(LoggerMatchFilterTest)
+{
+	LOGUNIT_TEST_SUITE(LoggerMatchFilterTest);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST(test3);
+	LOGUNIT_TEST(test4);
+	LOGUNIT_TEST_SUITE_END();
+
 public:
-    /**
-     * Check that LoggerMatchFilter::decide() with unspecified level
-     *    returns Filter::ACCEPT for root logger.
-     */
-    void test1() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("root"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        FilterPtr filter(new LoggerMatchFilter());
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
+	/**
+	 * Check that LoggerMatchFilter::decide() with unspecified level
+	 *    returns Filter::ACCEPT for root logger.
+	 */
+	void test1()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("root"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		FilterPtr filter(new LoggerMatchFilter());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
 
-    /**
-     * Check that LoggerMatchFilter::decide() with unspecified level
-     *    returns Filter::DENY for root logger when accept on match is false.
-     */
-    void test2() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("root"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LoggerMatchFilterPtr filter(new LoggerMatchFilter());
-        filter->setAcceptOnMatch(false);
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
-    }
+	/**
+	 * Check that LoggerMatchFilter::decide() with unspecified level
+	 *    returns Filter::DENY for root logger when accept on match is false.
+	 */
+	void test2()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("root"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LoggerMatchFilterPtr filter(new LoggerMatchFilter());
+		filter->setAcceptOnMatch(false);
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
+	}
 
-    /**
-     * Check that LoggerMatchFilter::decide() with unspecified level
-     *    returns Filter::NEUTRAL for non-root logger.
-     */
-    void test3() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.LoggerMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        FilterPtr filter(new LoggerMatchFilter());
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that LoggerMatchFilter::decide() with unspecified level
+	 *    returns Filter::NEUTRAL for non-root logger.
+	 */
+	void test3()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.LoggerMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		FilterPtr filter(new LoggerMatchFilter());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
-    /**
-     * Check that LoggerMatchFilter::decide()
-     *    returns Filter::ACCEPT for matching logger.
-     */
-    void test4() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.LoggerMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        LoggerMatchFilterPtr filter(new LoggerMatchFilter());
-        filter->setLoggerToMatch(LOG4CXX_STR("org.apache.log4j.filter.LoggerMatchFilterTest"));
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
+	/**
+	 * Check that LoggerMatchFilter::decide()
+	 *    returns Filter::ACCEPT for matching logger.
+	 */
+	void test4()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.LoggerMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		LoggerMatchFilterPtr filter(new LoggerMatchFilter());
+		filter->setLoggerToMatch(LOG4CXX_STR("org.apache.log4j.filter.LoggerMatchFilterTest"));
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
 
 };
 
diff --git a/src/test/cpp/filter/stringmatchfiltertest.cpp b/src/test/cpp/filter/stringmatchfiltertest.cpp
index e3a81f5..131d0ed 100644
--- a/src/test/cpp/filter/stringmatchfiltertest.cpp
+++ b/src/test/cpp/filter/stringmatchfiltertest.cpp
@@ -22,108 +22,114 @@
 
 using namespace log4cxx;
 using namespace log4cxx::filter;
-using namespace log4cxx::spi; 
+using namespace log4cxx::spi;
 using namespace log4cxx::helpers;
 
 
 /**
  * Unit tests for StringMatchFilter.
  */
-LOGUNIT_CLASS(StringMatchFilterTest) {
-    LOGUNIT_TEST_SUITE(StringMatchFilterTest);
-       LOGUNIT_TEST(test1);
-       LOGUNIT_TEST(test2);
-       LOGUNIT_TEST(test3);
-       LOGUNIT_TEST(test4);
-    LOGUNIT_TEST_SUITE_END();
-    
+LOGUNIT_CLASS(StringMatchFilterTest)
+{
+	LOGUNIT_TEST_SUITE(StringMatchFilterTest);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST(test3);
+	LOGUNIT_TEST(test4);
+	LOGUNIT_TEST_SUITE_END();
+
 public:
 
-    /**
-     * Check that StringMatchFilter.decide() returns Filter.NEUTRAL
-     *   when string to match is unspecified.
-     */
-    void test1() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        FilterPtr filter(new StringMatchFilter());
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that StringMatchFilter.decide() returns Filter.NEUTRAL
+	 *   when string to match is unspecified.
+	 */
+	void test1()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		FilterPtr filter(new StringMatchFilter());
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
-    /**
-     * Check that StringMatchFilter.decide() returns Filter.NEUTRAL
-     *   when string to match does not appear in message.
-     */
-    void test2() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        StringMatchFilterPtr filter(new StringMatchFilter());
-        filter->setStringToMatch(LOG4CXX_STR("Monde"));
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that StringMatchFilter.decide() returns Filter.NEUTRAL
+	 *   when string to match does not appear in message.
+	 */
+	void test2()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		StringMatchFilterPtr filter(new StringMatchFilter());
+		filter->setStringToMatch(LOG4CXX_STR("Monde"));
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
-    /**
-     * Check that StringMatchFilter.decide() returns Filter.ACCEPT
-     *   when string to match does appear in message.
-     */
-    void test3() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        StringMatchFilterPtr filter(new StringMatchFilter());
-        filter->setStringToMatch(LOG4CXX_STR("World"));
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
-    }
+	/**
+	 * Check that StringMatchFilter.decide() returns Filter.ACCEPT
+	 *   when string to match does appear in message.
+	 */
+	void test3()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		StringMatchFilterPtr filter(new StringMatchFilter());
+		filter->setStringToMatch(LOG4CXX_STR("World"));
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::ACCEPT, filter->decide(event));
+	}
 
-    /**
-     * Check that StringMatchFilter.decide() returns Filter.DENY
-     *   when string to match does appear in message and
-     *   accept on match is false.
-     */
-    void test4() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        StringMatchFilterPtr filter(new StringMatchFilter());
-        filter->setStringToMatch(LOG4CXX_STR("World"));
-        filter->setAcceptOnMatch(false);
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
-    }
+	/**
+	 * Check that StringMatchFilter.decide() returns Filter.DENY
+	 *   when string to match does appear in message and
+	 *   accept on match is false.
+	 */
+	void test4()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		StringMatchFilterPtr filter(new StringMatchFilter());
+		filter->setStringToMatch(LOG4CXX_STR("World"));
+		filter->setAcceptOnMatch(false);
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::DENY, filter->decide(event));
+	}
 
-    /**
-     * Check that StringMatchFilter.decide() returns Filter.NEUTRAL
-     *   when string to match does appear in message but differs in case.
-     */
-    void test5() {
-        LoggingEventPtr event(new LoggingEvent(
-                LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
-                Level::getInfo(), 
-                LOG4CXX_STR("Hello, World"), 
-                LOG4CXX_LOCATION));
-        StringMatchFilterPtr filter(new StringMatchFilter());
-        filter->setStringToMatch(LOG4CXX_STR("world"));
-        Pool p; 
-        filter->activateOptions(p);
-        LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
-    }
+	/**
+	 * Check that StringMatchFilter.decide() returns Filter.NEUTRAL
+	 *   when string to match does appear in message but differs in case.
+	 */
+	void test5()
+	{
+		LoggingEventPtr event(new LoggingEvent(
+				LOG4CXX_STR("org.apache.log4j.filter.StringMatchFilterTest"),
+				Level::getInfo(),
+				LOG4CXX_STR("Hello, World"),
+				LOG4CXX_LOCATION));
+		StringMatchFilterPtr filter(new StringMatchFilter());
+		filter->setStringToMatch(LOG4CXX_STR("world"));
+		Pool p;
+		filter->activateOptions(p);
+		LOGUNIT_ASSERT_EQUAL(Filter::NEUTRAL, filter->decide(event));
+	}
 
 };
 
diff --git a/src/test/cpp/helpers/absolutetimedateformattestcase.cpp b/src/test/cpp/helpers/absolutetimedateformattestcase.cpp
index 8f19117..d88b0a5 100644
--- a/src/test/cpp/helpers/absolutetimedateformattestcase.cpp
+++ b/src/test/cpp/helpers/absolutetimedateformattestcase.cpp
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "../logunit.h" 
+#include "../logunit.h"
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/absolutetimedateformat.h>
 #include "../insertwide.h"
@@ -24,7 +24,7 @@
 
 //Define INT64_C for compilers that don't have it
 #if (!defined(INT64_C))
-#define INT64_C(value)  value ## LL
+	#define INT64_C(value)  value ## LL
 #endif
 
 
@@ -35,143 +35,153 @@ using namespace log4cxx::helpers;
 
 /**
    Unit test {@link AbsoluteTimeDateFormat}.
-   
-   */
-LOGUNIT_CLASS(AbsoluteTimeDateFormatTestCase) {
-  LOGUNIT_TEST_SUITE(AbsoluteTimeDateFormatTestCase);
-          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:
-
-  /**
-   * Asserts that formatting the provided date results
-   * in the expected string.
-   *
-   * @param date Date date
-   * @param timeZone TimeZone timezone for conversion
-   * @param expected String expected string
+
    */
-  private:
-  void assertFormattedTime(apr_time_t date,
-                           const TimeZonePtr& timeZone,
-                           const LogString& expected) {
-    AbsoluteTimeDateFormat formatter;
-    formatter.setTimeZone(timeZone);
-    LogString actual;
-    Pool p;
-    formatter.format(actual, date, p);
-    LOGUNIT_ASSERT_EQUAL(expected, actual);
-  }
+LOGUNIT_CLASS(AbsoluteTimeDateFormatTestCase)
+{
+	LOGUNIT_TEST_SUITE(AbsoluteTimeDateFormatTestCase);
+	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:
+
+	/**
+	 * Asserts that formatting the provided date results
+	 * in the expected string.
+	 *
+	 * @param date Date date
+	 * @param timeZone TimeZone timezone for conversion
+	 * @param expected String expected string
+	 */
+private:
+	void assertFormattedTime(apr_time_t date,
+		const TimeZonePtr & timeZone,
+		const LogString & expected)
+	{
+		AbsoluteTimeDateFormat formatter;
+		formatter.setTimeZone(timeZone);
+		LogString actual;
+		Pool p;
+		formatter.format(actual, date, p);
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
 
 #define MICROSECONDS_PER_DAY APR_INT64_C(86400000000)
 
-  public:
-  /**
-   * Convert 02 Jan 2004 00:00:00 GMT for GMT.
-   */
-  void test1() {
-    //
-    //   02 Jan 2004 00:00 GMT
-    //
-    apr_time_t jan2 = MICROSECONDS_PER_DAY * 12419;
-    assertFormattedTime(jan2, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
-  }
-
-  /**
-   * Convert 03 Jan 2004 00:00:00 GMT for America/Chicago.
-   */
-  void test2() {
-    //
-    //   03 Jan 2004 00:00 GMT
-    //       (asking for the same time at a different timezone
-    //          will ignore the change of timezone)
-    apr_time_t jan2 = MICROSECONDS_PER_DAY * 12420;
-    assertFormattedTime(jan2, TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")), LOG4CXX_STR("18:00:00,000"));
-  }
-
-  /**
-   * Convert 29 Jun 2004 00:00:00 GMT for GMT.
-   */
-  void test3() {
-    apr_time_t jun29 = MICROSECONDS_PER_DAY * 12599;
-    assertFormattedTime(jun29, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
-  }
-
-  /**
-   * Convert 29 Jun 2004 00:00:00 GMT for Chicago, daylight savings in effect.
-   */
-  void test4() {
-    apr_time_t jun30 = MICROSECONDS_PER_DAY * 12600;
-    //
-    //   log4cxx doesn't support non-fixed timezones at this time
-    //      passing the fixed equivalent to Chicago's Daylight Savings Time
-    //
-    assertFormattedTime(jun30, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")), LOG4CXX_STR("19:00:00,000"));
-  }
-
-  /**
-   * Test multiple calls in close intervals.
-   */
-  void test5() {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
-    apr_time_t ticks = MICROSECONDS_PER_DAY * 12601;
-    assertFormattedTime(ticks, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
-    assertFormattedTime(ticks + 8000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,008"));
-    assertFormattedTime(ticks + 17000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,017"));
-    assertFormattedTime(ticks + 237000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,237"));
-    assertFormattedTime(ticks + 1415000, TimeZone::getGMT(), LOG4CXX_STR("00:00:01,415"));
-  }
-
-  /**
-   *  Check that caching does not disregard timezone.
-   * This test would fail for revision 1.4 of AbsoluteTimeDateFormat.java.
-   */
-  void test6() {
-    apr_time_t jul2 = MICROSECONDS_PER_DAY * 12602;
-    assertFormattedTime(jul2, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
-    assertFormattedTime(jul2, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")), LOG4CXX_STR("19:00:00,000"));
-  }
-
-  /**
-   * Test multiple calls in close intervals predating 1 Jan 1970.
-   */
-  void test7() {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
-    apr_time_t ticks = MICROSECONDS_PER_DAY * -7;
-    assertFormattedTime(ticks, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
+public:
+	/**
+	 * Convert 02 Jan 2004 00:00:00 GMT for GMT.
+	 */
+	void test1()
+	{
+		//
+		//   02 Jan 2004 00:00 GMT
+		//
+		apr_time_t jan2 = MICROSECONDS_PER_DAY * 12419;
+		assertFormattedTime(jan2, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
+	}
+
+	/**
+	 * Convert 03 Jan 2004 00:00:00 GMT for America/Chicago.
+	 */
+	void test2()
+	{
+		//
+		//   03 Jan 2004 00:00 GMT
+		//       (asking for the same time at a different timezone
+		//          will ignore the change of timezone)
+		apr_time_t jan2 = MICROSECONDS_PER_DAY * 12420;
+		assertFormattedTime(jan2, TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")), LOG4CXX_STR("18:00:00,000"));
+	}
+
+	/**
+	 * Convert 29 Jun 2004 00:00:00 GMT for GMT.
+	 */
+	void test3()
+	{
+		apr_time_t jun29 = MICROSECONDS_PER_DAY * 12599;
+		assertFormattedTime(jun29, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
+	}
+
+	/**
+	 * Convert 29 Jun 2004 00:00:00 GMT for Chicago, daylight savings in effect.
+	 */
+	void test4()
+	{
+		apr_time_t jun30 = MICROSECONDS_PER_DAY * 12600;
+		//
+		//   log4cxx doesn't support non-fixed timezones at this time
+		//      passing the fixed equivalent to Chicago's Daylight Savings Time
+		//
+		assertFormattedTime(jun30, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")), LOG4CXX_STR("19:00:00,000"));
+	}
+
+	/**
+	 * Test multiple calls in close intervals.
+	 */
+	void test5()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
+		apr_time_t ticks = MICROSECONDS_PER_DAY * 12601;
+		assertFormattedTime(ticks, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
+		assertFormattedTime(ticks + 8000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,008"));
+		assertFormattedTime(ticks + 17000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,017"));
+		assertFormattedTime(ticks + 237000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,237"));
+		assertFormattedTime(ticks + 1415000, TimeZone::getGMT(), LOG4CXX_STR("00:00:01,415"));
+	}
+
+	/**
+	 *  Check that caching does not disregard timezone.
+	 * This test would fail for revision 1.4 of AbsoluteTimeDateFormat.java.
+	 */
+	void test6()
+	{
+		apr_time_t jul2 = MICROSECONDS_PER_DAY * 12602;
+		assertFormattedTime(jul2, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
+		assertFormattedTime(jul2, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")), LOG4CXX_STR("19:00:00,000"));
+	}
+
+	/**
+	 * Test multiple calls in close intervals predating 1 Jan 1970.
+	 */
+	void test7()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
+		apr_time_t ticks = MICROSECONDS_PER_DAY * -7;
+		assertFormattedTime(ticks, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,000"));
 #if defined(_WIN32)
-    //
-    //   These tests fail on Unix due to bug in APR's explode_time
-    //
-//    assertFormattedTime(ticks + 8000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,008"));
-//    assertFormattedTime(ticks + 17000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,017"));
-//    assertFormattedTime(ticks + 237000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,237"));
-//    assertFormattedTime(ticks + 1415000, TimeZone::getGMT(), LOG4CXX_STR("00:00:01,415"));
+		//
+		//   These tests fail on Unix due to bug in APR's explode_time
+		//
+		//    assertFormattedTime(ticks + 8000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,008"));
+		//    assertFormattedTime(ticks + 17000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,017"));
+		//    assertFormattedTime(ticks + 237000, TimeZone::getGMT(), LOG4CXX_STR("00:00:00,237"));
+		//    assertFormattedTime(ticks + 1415000, TimeZone::getGMT(), LOG4CXX_STR("00:00:01,415"));
 #endif
-  }
-
-  /**
-   * Checks that numberFormat works as expected.
-   */
-  void test8() {
-    Pool p;
-    LogString numb;
-    AbsoluteTimeDateFormat formatter;
-    formatter.numberFormat(numb, 87, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
-  }
+	}
+
+	/**
+	 * Checks that numberFormat works as expected.
+	 */
+	void test8()
+	{
+		Pool p;
+		LogString numb;
+		AbsoluteTimeDateFormat formatter;
+		formatter.numberFormat(numb, 87, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
+	}
 
 };
 
diff --git a/src/test/cpp/helpers/cacheddateformattestcase.cpp b/src/test/cpp/helpers/cacheddateformattestcase.cpp
index 74d180e..d29ff51 100644
--- a/src/test/cpp/helpers/cacheddateformattestcase.cpp
+++ b/src/test/cpp/helpers/cacheddateformattestcase.cpp
@@ -33,15 +33,15 @@ using namespace log4cxx::pattern;
 
 #define LOCALE_US "C"
 #if defined(_WIN32)
-#define LOCALE_JP "Japanese_japan"
+	#define LOCALE_JP "Japanese_japan"
 #else
-#define LOCALE_JP "ja_JP"
+	#define LOCALE_JP "ja_JP"
 #endif
 
 
 //Define INT64_C for compilers that don't have it
 #if (!defined(INT64_C))
-#define INT64_C(value)  value ##LL
+	#define INT64_C(value)  value ##LL
 #endif
 
 #define LOG4CXX_TEST 1
@@ -52,625 +52,649 @@ using namespace log4cxx::pattern;
  * Unit test {@link CachedDateFormat}.
  */
 LOGUNIT_CLASS(CachedDateFormatTestCase)
-   {
-     LOGUNIT_TEST_SUITE( CachedDateFormatTestCase );
-     LOGUNIT_TEST(test1);
-     LOGUNIT_TEST(test2);
-     LOGUNIT_TEST(test3);
-     LOGUNIT_TEST(test4);
+{
+	LOGUNIT_TEST_SUITE( CachedDateFormatTestCase );
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST(test3);
+	LOGUNIT_TEST(test4);
 #if LOG4CXX_HAS_STD_LOCALE
-     LOGUNIT_TEST(test5);
+	LOGUNIT_TEST(test5);
 #endif
-     LOGUNIT_TEST(test6);
-     LOGUNIT_TEST(test8);
-//   Gump doesn't like this test
-//     LOGUNIT_TEST(test9);
-     LOGUNIT_TEST(test10);
-     LOGUNIT_TEST(test11);
-     LOGUNIT_TEST(test12);
-     LOGUNIT_TEST(test13);
-     LOGUNIT_TEST(test14);
-     LOGUNIT_TEST(test15);
-     LOGUNIT_TEST(test16);
-     LOGUNIT_TEST(test17);
-     LOGUNIT_TEST(test18);
-     LOGUNIT_TEST(test19);
-     LOGUNIT_TEST(test20);
-     LOGUNIT_TEST(test21);
-     LOGUNIT_TEST(test22);
-     LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST(test6);
+	LOGUNIT_TEST(test8);
+	//   Gump doesn't like this test
+	//     LOGUNIT_TEST(test9);
+	LOGUNIT_TEST(test10);
+	LOGUNIT_TEST(test11);
+	LOGUNIT_TEST(test12);
+	LOGUNIT_TEST(test13);
+	LOGUNIT_TEST(test14);
+	LOGUNIT_TEST(test15);
+	LOGUNIT_TEST(test16);
+	LOGUNIT_TEST(test17);
+	LOGUNIT_TEST(test18);
+	LOGUNIT_TEST(test19);
+	LOGUNIT_TEST(test20);
+	LOGUNIT_TEST(test21);
+	LOGUNIT_TEST(test22);
+	LOGUNIT_TEST_SUITE_END();
 
 #define MICROSECONDS_PER_DAY APR_INT64_C(86400000000)
 
-   public:
-
-  /**
-   * Test multiple calls in close intervals.
-   */
-  void test1() {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
-    DateFormatPtr baseFormatter(new AbsoluteTimeDateFormat());
-    CachedDateFormat gmtFormat(baseFormatter, 1000000);
-    gmtFormat.setTimeZone(TimeZone::getGMT());
-
-    apr_time_t jul1 = MICROSECONDS_PER_DAY * 12601L;
-    Pool p;
-
-    LogString actual;
-
-    gmtFormat.format(actual, jul1, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
-    actual.erase(actual.begin(), actual.end());
-
-    gmtFormat.format(actual, jul1 + 8000, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,008"), actual);
-    actual.erase(actual.begin(), actual.end());
-
-    gmtFormat.format(actual, jul1 + 17000, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,017"), actual);
-    actual.erase(actual.begin(), actual.end());
-
-    gmtFormat.format(actual, jul1 + 237000, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,237"), actual);
-    actual.erase(actual.begin(), actual.end());
-
-    gmtFormat.format(actual, jul1 + 1415000, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:01,415"), actual);
-    actual.erase(actual.begin(), actual.end());
-
-  }
-
-  /**
-   *  Check for interaction between caches.
-   */
-
-  void test2() {
-      apr_time_t jul2 = MICROSECONDS_PER_DAY * 12602;
-      DateFormatPtr baseFormatter(new AbsoluteTimeDateFormat());
-      CachedDateFormat gmtFormat(baseFormatter, 1000000);
-      gmtFormat.setTimeZone(TimeZone::getGMT());
-
-     DateFormatPtr chicagoBase(new AbsoluteTimeDateFormat());
-     CachedDateFormat chicagoFormat(chicagoBase, 1000000);
-     chicagoFormat.setTimeZone(TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")));
-
-     Pool p;
-     LogString actual;
-     gmtFormat.format(actual, jul2, p);
-     LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
-
-     actual.erase(actual.begin(), actual.end());
-     chicagoFormat.format(actual, jul2, p);
-     LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("19:00:00,000"), actual);
-
-     actual.erase(actual.begin(), actual.end());
-     gmtFormat.format(actual, jul2, p);
-     LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
-  }
-
-  /**
-   * Test multiple calls in close intervals prior to 1 Jan 1970.
-   */
-  void test3() {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
-    DateFormatPtr baseFormatter(new AbsoluteTimeDateFormat());
-    CachedDateFormat gmtFormat(baseFormatter, 1000000);
-    gmtFormat.setTimeZone(TimeZone::getGMT());
-
-    apr_time_t ticks = MICROSECONDS_PER_DAY * -7;
-
-    Pool p;
-
-    LogString actual;
-
-
-    gmtFormat.format(actual, ticks, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
-    actual.erase(actual.begin(), actual.end());
-
-   //
-   //   APR's explode_time method does not properly calculate tm_usec
-   //     prior to 1 Jan 1970 on Unix
-   gmtFormat.format(actual, ticks + 8000, p);
-   LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,008"), actual);
-   actual.erase(actual.begin(), actual.end());
-
-   gmtFormat.format(actual, ticks + 17000, p);
-   LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,017"), actual);
-   actual.erase(actual.begin(), actual.end());
-
-    gmtFormat.format(actual, ticks + 237000, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,237"), actual);
-    actual.erase(actual.begin(), actual.end());
-
-    gmtFormat.format(actual, ticks + 1423000, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:01,423"), actual);
-  }
-
-  void assertFormattedEquals(
-      const DateFormatPtr& baseFormat,
-      const CachedDateFormat& cachedFormat,
-      apr_time_t date,
-      Pool& p) {
-        LogString expected;
-        LogString actual;
-
-        baseFormat->format(expected, date, p);
-        cachedFormat.format(actual, date, p);
-
-
-        LOGUNIT_ASSERT_EQUAL(expected, actual);
-  }
-
-  void test4() {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
+public:
+
+	/**
+	 * Test multiple calls in close intervals.
+	 */
+	void test1()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
+		DateFormatPtr baseFormatter(new AbsoluteTimeDateFormat());
+		CachedDateFormat gmtFormat(baseFormatter, 1000000);
+		gmtFormat.setTimeZone(TimeZone::getGMT());
+
+		apr_time_t jul1 = MICROSECONDS_PER_DAY * 12601L;
+		Pool p;
+
+		LogString actual;
+
+		gmtFormat.format(actual, jul1, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		gmtFormat.format(actual, jul1 + 8000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,008"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		gmtFormat.format(actual, jul1 + 17000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,017"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		gmtFormat.format(actual, jul1 + 237000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,237"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		gmtFormat.format(actual, jul1 + 1415000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:01,415"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+	}
+
+	/**
+	 *  Check for interaction between caches.
+	 */
+
+	void test2()
+	{
+		apr_time_t jul2 = MICROSECONDS_PER_DAY * 12602;
+		DateFormatPtr baseFormatter(new AbsoluteTimeDateFormat());
+		CachedDateFormat gmtFormat(baseFormatter, 1000000);
+		gmtFormat.setTimeZone(TimeZone::getGMT());
+
+		DateFormatPtr chicagoBase(new AbsoluteTimeDateFormat());
+		CachedDateFormat chicagoFormat(chicagoBase, 1000000);
+		chicagoFormat.setTimeZone(TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")));
+
+		Pool p;
+		LogString actual;
+		gmtFormat.format(actual, jul2, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
+
+		actual.erase(actual.begin(), actual.end());
+		chicagoFormat.format(actual, jul2, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("19:00:00,000"), actual);
+
+		actual.erase(actual.begin(), actual.end());
+		gmtFormat.format(actual, jul2, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
+	}
+
+	/**
+	 * Test multiple calls in close intervals prior to 1 Jan 1970.
+	 */
+	void test3()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
+		DateFormatPtr baseFormatter(new AbsoluteTimeDateFormat());
+		CachedDateFormat gmtFormat(baseFormatter, 1000000);
+		gmtFormat.setTimeZone(TimeZone::getGMT());
+
+		apr_time_t ticks = MICROSECONDS_PER_DAY * -7;
+
+		Pool p;
+
+		LogString actual;
+
+
+		gmtFormat.format(actual, ticks, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		//
+		//   APR's explode_time method does not properly calculate tm_usec
+		//     prior to 1 Jan 1970 on Unix
+		gmtFormat.format(actual, ticks + 8000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,008"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		gmtFormat.format(actual, ticks + 17000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,017"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		gmtFormat.format(actual, ticks + 237000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,237"), actual);
+		actual.erase(actual.begin(), actual.end());
+
+		gmtFormat.format(actual, ticks + 1423000, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:01,423"), actual);
+	}
+
+	void assertFormattedEquals(
+		const DateFormatPtr & baseFormat,
+		const CachedDateFormat & cachedFormat,
+		apr_time_t date,
+		Pool & p)
+	{
+		LogString expected;
+		LogString actual;
+
+		baseFormat->format(expected, date, p);
+		cachedFormat.format(actual, date, p);
+
+
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
+
+	void test4()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
 #if LOG4CXX_HAS_STD_LOCALE
-    std::locale loco(LOCALE_US);
-    std::locale* localeEN = &loco;
+		std::locale loco(LOCALE_US);
+		std::locale* localeEN = &loco;
 #else
-    std::locale* localeEN = NULL;
+		std::locale* localeEN = NULL;
 #endif
-    DateFormatPtr baseFormat(
-         new SimpleDateFormat(LOG4CXX_STR("EEE, MMM dd, HH:mm:ss.SSS Z"), localeEN));
-    CachedDateFormat cachedFormat(baseFormat, 1000000);
-    //
-    //   use a date in 2000 to attempt to confuse the millisecond locator
-    apr_time_t ticks = MICROSECONDS_PER_DAY * 11141;
+		DateFormatPtr baseFormat(
+			new SimpleDateFormat(LOG4CXX_STR("EEE, MMM dd, HH:mm:ss.SSS Z"), localeEN));
+		CachedDateFormat cachedFormat(baseFormat, 1000000);
+		//
+		//   use a date in 2000 to attempt to confuse the millisecond locator
+		apr_time_t ticks = MICROSECONDS_PER_DAY * 11141;
 
-    Pool p;
+		Pool p;
 
-    assertFormattedEquals(baseFormat, cachedFormat, ticks, p);
-    assertFormattedEquals(baseFormat, cachedFormat, ticks + 8000, p);
-    assertFormattedEquals(baseFormat, cachedFormat, ticks + 17000, p);
-    assertFormattedEquals(baseFormat, cachedFormat, ticks + 237000, p);
-    assertFormattedEquals(baseFormat, cachedFormat, ticks + 1415000, p);
-  }
+		assertFormattedEquals(baseFormat, cachedFormat, ticks, p);
+		assertFormattedEquals(baseFormat, cachedFormat, ticks + 8000, p);
+		assertFormattedEquals(baseFormat, cachedFormat, ticks + 17000, p);
+		assertFormattedEquals(baseFormat, cachedFormat, ticks + 237000, p);
+		assertFormattedEquals(baseFormat, cachedFormat, ticks + 1415000, p);
+	}
 
 
 #if LOG4CXX_HAS_STD_LOCALE
-  void test5() {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
-    LocaleChanger localeChange(LOCALE_JP);
-    if (localeChange.isEffective()) {
-        DateFormatPtr baseFormat(new SimpleDateFormat(
-                   LOG4CXX_STR("EEE, MMM dd, HH:mm:ss.SSS Z")));
-        CachedDateFormat cachedFormat(baseFormat, 1000000);
-        //
-        //   use a date in 2000 to attempt to confuse the millisecond locator
-        apr_time_t ticks = MICROSECONDS_PER_DAY * 11141;
-
-        Pool p;
-
-        assertFormattedEquals(baseFormat, cachedFormat, ticks, p);
-        assertFormattedEquals(baseFormat, cachedFormat, ticks + 8000, p);
-        assertFormattedEquals(baseFormat, cachedFormat, ticks + 17000, p);
-        assertFormattedEquals(baseFormat, cachedFormat, ticks + 237000, p);
-        assertFormattedEquals(baseFormat, cachedFormat, ticks + 1415000, p);
-    }
-  }
+	void test5()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
+		LocaleChanger localeChange(LOCALE_JP);
+
+		if (localeChange.isEffective())
+		{
+			DateFormatPtr baseFormat(new SimpleDateFormat(
+					LOG4CXX_STR("EEE, MMM dd, HH:mm:ss.SSS Z")));
+			CachedDateFormat cachedFormat(baseFormat, 1000000);
+			//
+			//   use a date in 2000 to attempt to confuse the millisecond locator
+			apr_time_t ticks = MICROSECONDS_PER_DAY * 11141;
+
+			Pool p;
+
+			assertFormattedEquals(baseFormat, cachedFormat, ticks, p);
+			assertFormattedEquals(baseFormat, cachedFormat, ticks + 8000, p);
+			assertFormattedEquals(baseFormat, cachedFormat, ticks + 17000, p);
+			assertFormattedEquals(baseFormat, cachedFormat, ticks + 237000, p);
+			assertFormattedEquals(baseFormat, cachedFormat, ticks + 1415000, p);
+		}
+	}
 #endif
 
-  /**
-   * Checks that numberFormat works as expected.
-   */
-  void test6() {
-    LogString numb;
-    Pool p;
-    AbsoluteTimeDateFormat formatter;
-    formatter.numberFormat(numb, 87, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
-  }
-
-
-  /**
-   * Set time zone on cached and check that it is effective.
-   */
-  void test8() {
-    DateFormatPtr baseFormat(new SimpleDateFormat(LOG4CXX_STR("yyyy-MM-dd HH:mm:ss,SSS")));
-    baseFormat->setTimeZone(TimeZone::getGMT());
-    CachedDateFormat cachedFormat(baseFormat, 1000000);
-    apr_time_t jul4 = MICROSECONDS_PER_DAY * 12603;
-
-    Pool p;
-
-    LogString actual;
-    cachedFormat.format(actual, jul4, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("2004-07-04 00:00:00,000"), actual);
-
-    cachedFormat.setTimeZone(TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")));
-    actual.erase(actual.begin(), actual.end());
-    cachedFormat.format(actual, jul4, p);
-
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("2004-07-03 18:00:00,000"), actual);
-  }
-
-
-/**
- * Test of caching when less than three millisecond digits are specified.
- */
-void test9() {
-  std::locale localeUS(LOCALE_US);
-
-  DateFormatPtr baseFormat = new SimpleDateFormat(
-      LOG4CXX_STR("yyyy-MMMM-dd HH:mm:ss,SS Z"), &localeUS);
-  DateFormatPtr cachedFormat = new CachedDateFormat(baseFormat, 1000000);
-  TimeZonePtr cet = TimeZone::getTimeZone(LOG4CXX_STR("GMT+1"));
-  cachedFormat->setTimeZone(cet);
-
-
-   apr_time_exp_t c;
-   memset(&c, 0, sizeof(c));
-   c.tm_year = 104;
-   c.tm_mon = 11;
-   c.tm_mday = 12;
-   c.tm_hour = 19;
-   c.tm_sec = 37;
-   c.tm_usec = 23000;
-
-   apr_time_t dec12;
-   apr_status_t stat = apr_time_exp_gmt_get(&dec12, &c);
-   const apr_status_t statOK = 0;
-   LOGUNIT_ASSERT_EQUAL(statOK, stat);
-
-   Pool p;
-
-   LogString s;
-   cachedFormat->format(s, dec12, p);
-
-   LOGUNIT_ASSERT_EQUAL(
-       (LogString) LOG4CXX_STR("2004-December-12 20:00:37,23 +0100"), s);
-
-    memset(&c, 0, sizeof(c));
-    c.tm_year = 104;
-    c.tm_mon = 11;
-    c.tm_mday = 31;
-    c.tm_hour = 23;
-    c.tm_sec = 13;
-    c.tm_usec = 905000;
-
-    apr_time_t jan1;
-    stat = apr_time_exp_gmt_get(&jan1, &c);
-    LOGUNIT_ASSERT_EQUAL(statOK, stat);
-
-    s.erase(s.begin(), s.end());
-    cachedFormat->format(s, jan1, p);
-
-    LOGUNIT_ASSERT_EQUAL(
-       (LogString) LOG4CXX_STR("2005-January-01 00:00:13,905 +0100"), s);
-}
-
-
-/**
- * Test when millisecond position moves but length remains constant.
- */
-void test10() {
+	/**
+	 * Checks that numberFormat works as expected.
+	 */
+	void test6()
+	{
+		LogString numb;
+		Pool p;
+		AbsoluteTimeDateFormat formatter;
+		formatter.numberFormat(numb, 87, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
+	}
+
+
+	/**
+	 * Set time zone on cached and check that it is effective.
+	 */
+	void test8()
+	{
+		DateFormatPtr baseFormat(new SimpleDateFormat(LOG4CXX_STR("yyyy-MM-dd HH:mm:ss,SSS")));
+		baseFormat->setTimeZone(TimeZone::getGMT());
+		CachedDateFormat cachedFormat(baseFormat, 1000000);
+		apr_time_t jul4 = MICROSECONDS_PER_DAY * 12603;
+
+		Pool p;
+
+		LogString actual;
+		cachedFormat.format(actual, jul4, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("2004-07-04 00:00:00,000"), actual);
+
+		cachedFormat.setTimeZone(TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")));
+		actual.erase(actual.begin(), actual.end());
+		cachedFormat.format(actual, jul4, p);
+
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("2004-07-03 18:00:00,000"), actual);
+	}
+
+
+	/**
+	 * Test of caching when less than three millisecond digits are specified.
+	 */
+	void test9()
+	{
+		std::locale localeUS(LOCALE_US);
+
+		DateFormatPtr baseFormat = new SimpleDateFormat(
+			LOG4CXX_STR("yyyy-MMMM-dd HH:mm:ss,SS Z"), &localeUS);
+		DateFormatPtr cachedFormat = new CachedDateFormat(baseFormat, 1000000);
+		TimeZonePtr cet = TimeZone::getTimeZone(LOG4CXX_STR("GMT+1"));
+		cachedFormat->setTimeZone(cet);
+
+
+		apr_time_exp_t c;
+		memset(&c, 0, sizeof(c));
+		c.tm_year = 104;
+		c.tm_mon = 11;
+		c.tm_mday = 12;
+		c.tm_hour = 19;
+		c.tm_sec = 37;
+		c.tm_usec = 23000;
+
+		apr_time_t dec12;
+		apr_status_t stat = apr_time_exp_gmt_get(&dec12, &c);
+		const apr_status_t statOK = 0;
+		LOGUNIT_ASSERT_EQUAL(statOK, stat);
+
+		Pool p;
+
+		LogString s;
+		cachedFormat->format(s, dec12, p);
+
+		LOGUNIT_ASSERT_EQUAL(
+			(LogString) LOG4CXX_STR("2004-December-12 20:00:37,23 +0100"), s);
+
+		memset(&c, 0, sizeof(c));
+		c.tm_year = 104;
+		c.tm_mon = 11;
+		c.tm_mday = 31;
+		c.tm_hour = 23;
+		c.tm_sec = 13;
+		c.tm_usec = 905000;
+
+		apr_time_t jan1;
+		stat = apr_time_exp_gmt_get(&jan1, &c);
+		LOGUNIT_ASSERT_EQUAL(statOK, stat);
+
+		s.erase(s.begin(), s.end());
+		cachedFormat->format(s, jan1, p);
+
+		LOGUNIT_ASSERT_EQUAL(
+			(LogString) LOG4CXX_STR("2005-January-01 00:00:13,905 +0100"), s);
+	}
+
+
+	/**
+	 * Test when millisecond position moves but length remains constant.
+	 */
+	void test10()
+	{
 #if LOG4CXX_HAS_STD_LOCALE
-  std::locale loco("C");
-  std::locale* localeUS = &loco;
+		std::locale loco("C");
+		std::locale* localeUS = &loco;
 #else
-  std::locale* localeUS = NULL;
+		std::locale* localeUS = NULL;
 #endif
-  DateFormatPtr baseFormat = new SimpleDateFormat(
-      LOG4CXX_STR("MMMM SSS EEEEEE"), localeUS);
-  DateFormatPtr cachedFormat = new CachedDateFormat(baseFormat, 1000000);
-  TimeZonePtr cet = TimeZone::getTimeZone(LOG4CXX_STR("GMT+1"));
-  cachedFormat->setTimeZone(cet);
-
-  apr_time_exp_t c;
-  memset(&c, 0, sizeof(c));
-  c.tm_year = 104;
-  c.tm_mon = 9;
-  c.tm_mday = 5;
-  c.tm_hour = 21;
-  c.tm_sec = 37;
-  c.tm_usec = 23000;
-
-  apr_time_t oct5;
-  apr_status_t stat = apr_time_exp_gmt_get(&oct5, &c);
-  const apr_status_t statOK = 0;
-  LOGUNIT_ASSERT_EQUAL(statOK, stat);
-
-  Pool p;
-
-  LogString s;
-  cachedFormat->format(s, oct5, p);
-
-  LOGUNIT_ASSERT_EQUAL(
-    (LogString) LOG4CXX_STR("October 023 Tuesday"), s);
-
-  memset(&c, 0, sizeof(c));
-  c.tm_year = 104;
-  c.tm_mon = 10;
-  c.tm_mday = 1;
-  c.tm_usec = 23000;
-
-  apr_time_t nov1;
-  stat = apr_time_exp_gmt_get(&nov1, &c);
-  LOGUNIT_ASSERT_EQUAL(statOK, stat);
-
-  s.erase(s.begin(), s.end());
-  cachedFormat->format(s, nov1, p);
-
-  LOGUNIT_ASSERT_EQUAL(
-     (LogString) LOG4CXX_STR("November 023 Monday"), s);
-
-   nov1 += 961000;
-   s.erase(s.begin(), s.end());
-   cachedFormat->format(s, nov1, p);
-
-   LOGUNIT_ASSERT_EQUAL(
-      (LogString) LOG4CXX_STR("November 984 Monday"), s);
-}
-
-/**
- * Test that tests if caching is skipped if only "SS"
- *     is specified.
- */
-void test11() {
-   //
-   //   Earlier versions could be tricked by "SS0" patterns.
-   //
-   LogString badPattern(LOG4CXX_STR("ss,SS0"));
-   DateFormatPtr simpleFormat = new SimpleDateFormat(badPattern);
-   DateFormatPtr gmtFormat = new CachedDateFormat(simpleFormat, 1000000);
-   gmtFormat->setTimeZone(TimeZone::getGMT());
-
-   //
-   // The first request has to 100 ms after an ordinal second
-   //    to push the literal zero out of the pattern check
-   apr_time_t ticks = MICROSECONDS_PER_DAY * 11142L;
-   apr_time_t jul2 = ticks + 120000;
-
-   Pool p;
-
-   LogString s;
-   gmtFormat->format(s, jul2, p);
-
-   LOGUNIT_ASSERT_EQUAL(
-      (LogString) LOG4CXX_STR("00,1200"), s);
-
-   jul2 = ticks + 87000;
-
-   s.erase(s.begin(), s.end());
-   gmtFormat->format(s, jul2, p);
-
-   LOGUNIT_ASSERT_EQUAL(
-      (LogString) LOG4CXX_STR("00,870"), s);
-}
-
-/**
- * Check pattern location for ISO8601
- */
-void test12() {
-   DateFormatPtr df    = new SimpleDateFormat(LOG4CXX_STR("yyyy-MM-dd HH:mm:ss,SSS"));
-   apr_time_t    ticks = 11142L * MICROSECONDS_PER_DAY;
-   Pool p;
-   LogString formatted;
-
-   df->format(formatted, ticks, p);
-   int msStart = CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
-   LOGUNIT_ASSERT_EQUAL(20, msStart);
-
-   // Test for for milliseconds overlapping with the magic ones as per LOGCXX-420.
-   apr_time_exp_t c;
-   memset(&c, 0, sizeof(c));
-   c.tm_year = 110;
-   c.tm_mon  = 7;
-   c.tm_mday = 12;
-   c.tm_hour = 9;
-   c.tm_min  = 4;
-   c.tm_sec  = 50;
-   c.tm_usec = 406000;
-
-   LOGUNIT_ASSERT_EQUAL(0, apr_time_exp_gmt_get(&ticks, &c));
-
-   formatted.clear();
-   df->format(formatted, ticks, p);
-   msStart = CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
-   LOGUNIT_ASSERT_EQUAL(20, msStart);
-
-   c.tm_usec = 609000;
-   LOGUNIT_ASSERT_EQUAL(0, apr_time_exp_gmt_get(&ticks, &c));
-
-   formatted.clear();
-   df->format(formatted, ticks, p);
-   msStart = CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
-   LOGUNIT_ASSERT_EQUAL(20, msStart);
-}
-
-/**
- * Check pattern location for DATE
- */
-void test13() {
-   DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("yyyy-MM-dd"));
-   apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
-
-   Pool p;
-
-   LogString formatted;
-   df->format(formatted, ticks, p);
-
-   int millisecondStart = CachedDateFormat::findMillisecondStart(ticks,
-       formatted, df, p);
-   LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::NO_MILLISECONDS, millisecondStart);
-}
-
-/**
- * Check pattern location for ABSOLUTE
- */
-void test14() {
-   DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("HH:mm:ss,SSS"));
-   apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
-
-   Pool p;
-   LogString formatted;
-   df->format(formatted, ticks, p);
-
-   int millisecondStart = CachedDateFormat::findMillisecondStart(ticks,
-      formatted, df, p);
-   LOGUNIT_ASSERT_EQUAL(9, millisecondStart);
-}
-
-/**
- * Check pattern location for single S
- */
-void test15() {
-   DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("HH:mm:ss,S"));
-   apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
-
-   Pool p;
-   LogString formatted;
-   df->format(formatted, ticks, p);
-
-   int millisecondStart = CachedDateFormat::findMillisecondStart(ticks,
-      formatted, df, p);
-   LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, millisecondStart);
-}
-
-/**
- * Check pattern location for single SS
- */
-void test16() {
-   DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("HH:mm:ss,SS"));
-   apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
-
-   Pool p;
-   LogString formatted;
-   df->format(formatted, ticks, p);
-
-   int millisecondStart =
-      CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
-   LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, millisecondStart);
-}
-
-/**
- * Check caching when multiple SSS appear in pattern
- */
-void test17() {
-    apr_time_t jul2 = 12602L * MICROSECONDS_PER_DAY;
-    LogString badPattern(LOG4CXX_STR("HH:mm:ss,SSS HH:mm:ss,SSS"));
-    DateFormatPtr simpleFormat = new SimpleDateFormat(badPattern);
-    simpleFormat->setTimeZone(TimeZone::getGMT());
-    DateFormatPtr cachedFormat = new CachedDateFormat(simpleFormat, 1000000);
-
-    Pool p;
-    LogString s;
-    cachedFormat->format(s, jul2, p);
-
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000 00:00:00,000"), s);
-    jul2 += 120000;
-
-    s.erase(s.begin(), s.end());
-    simpleFormat->format(s, jul2, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,120 00:00:00,120"), s);
-
-    s.erase(s.begin(), s.end());
-    int msStart = CachedDateFormat::findMillisecondStart(jul2, s, simpleFormat, p);
-    LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, msStart);
-
-    cachedFormat->format(s, jul2, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,120 00:00:00,120"), s) ;
-
-    int maxValid = CachedDateFormat::getMaximumCacheValidity(badPattern);
-    LOGUNIT_ASSERT_EQUAL(1000, maxValid);
-
-    // Test overlapping millis with a magic string from CachedDateFormat for LOGCXX-420.
-    s.clear();
-    jul2 += 286000;
-    cachedFormat->format(s, jul2, p);
-    msStart = CachedDateFormat::findMillisecondStart(jul2, s, simpleFormat, p);
-    LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, msStart);
-
-    s.clear();
-    jul2 += 203000;
-    cachedFormat->format(s, jul2, p);
-    msStart = CachedDateFormat::findMillisecondStart(jul2, s, simpleFormat, p);
-    LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, msStart);
-}
-
-/**
- * Check that patterns not containing microseconds
- * are reported as being able to be cached for a full second.
- */
-void test18() {
-
-    int maxValid =
-       CachedDateFormat::getMaximumCacheValidity(
-          LOG4CXX_STR("yyyy-MM-dd"));
-    LOGUNIT_ASSERT_EQUAL(1000000, maxValid);
-}
-
-/**
- * Check that patterns not containing 3 microseconds
- * are reported as being able to be cached for a full second.
- */
-void test19() {
-
-    int maxValid =
-       CachedDateFormat::getMaximumCacheValidity(
-          LOG4CXX_STR("yyyy-MM-dd SSS"));
-    LOGUNIT_ASSERT_EQUAL(1000000, maxValid);
-}
-
-/**
- * Check that patterns not containing 2 S's
- * are reported as being able to be cached for only a millisecond.
- */
-void test20() {
-
-    int maxValid =
-       CachedDateFormat::getMaximumCacheValidity(
-          LOG4CXX_STR("yyyy-MM-dd SS"));
-    LOGUNIT_ASSERT_EQUAL(1000, maxValid);
-}
-
-/**
- * Check that patterns not containing multi S groups
- * are reported as being able to be cached for only a millisecond.
- */
-void test21() {
-
-    int maxValid =
-       CachedDateFormat::getMaximumCacheValidity(
-          LOG4CXX_STR("yyyy-MM-dd SSS SSS"));
-    LOGUNIT_ASSERT_EQUAL(1000, maxValid);
-}
-
-/**
- * Check that findMillisecondStart correctly handles timestamps
- * which use the magic millisecond value 654.
- */
-void test22() {
-    DateFormatPtr baseFormatter(new ISO8601DateFormat());
-    CachedDateFormat isoFormat(baseFormatter, 1000000);
-    isoFormat.setTimeZone(TimeZone::getGMT());
-
-    Pool p;
-    LogString formatted;
-
-    isoFormat.format(formatted, 654000, p);
-    LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:00,654"), formatted);
-
-    formatted.clear();
-    isoFormat.format(formatted, 999000, p);
-    LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:00,999"), formatted);
-
-    formatted.clear();
-    isoFormat.format(formatted, 1654010, p);
-    LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:01,654"), formatted);
-
-    formatted.clear();
-    isoFormat.format(formatted, 1999010, p);
-    LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:01,999"), formatted);
-}
+		DateFormatPtr baseFormat = new SimpleDateFormat(
+			LOG4CXX_STR("MMMM SSS EEEEEE"), localeUS);
+		DateFormatPtr cachedFormat = new CachedDateFormat(baseFormat, 1000000);
+		TimeZonePtr cet = TimeZone::getTimeZone(LOG4CXX_STR("GMT+1"));
+		cachedFormat->setTimeZone(cet);
+
+		apr_time_exp_t c;
+		memset(&c, 0, sizeof(c));
+		c.tm_year = 104;
+		c.tm_mon = 9;
+		c.tm_mday = 5;
+		c.tm_hour = 21;
+		c.tm_sec = 37;
+		c.tm_usec = 23000;
+
+		apr_time_t oct5;
+		apr_status_t stat = apr_time_exp_gmt_get(&oct5, &c);
+		const apr_status_t statOK = 0;
+		LOGUNIT_ASSERT_EQUAL(statOK, stat);
+
+		Pool p;
+
+		LogString s;
+		cachedFormat->format(s, oct5, p);
+
+		LOGUNIT_ASSERT_EQUAL(
+			(LogString) LOG4CXX_STR("October 023 Tuesday"), s);
+
+		memset(&c, 0, sizeof(c));
+		c.tm_year = 104;
+		c.tm_mon = 10;
+		c.tm_mday = 1;
+		c.tm_usec = 23000;
+
+		apr_time_t nov1;
+		stat = apr_time_exp_gmt_get(&nov1, &c);
+		LOGUNIT_ASSERT_EQUAL(statOK, stat);
+
+		s.erase(s.begin(), s.end());
+		cachedFormat->format(s, nov1, p);
+
+		LOGUNIT_ASSERT_EQUAL(
+			(LogString) LOG4CXX_STR("November 023 Monday"), s);
+
+		nov1 += 961000;
+		s.erase(s.begin(), s.end());
+		cachedFormat->format(s, nov1, p);
+
+		LOGUNIT_ASSERT_EQUAL(
+			(LogString) LOG4CXX_STR("November 984 Monday"), s);
+	}
+
+	/**
+	 * Test that tests if caching is skipped if only "SS"
+	 *     is specified.
+	 */
+	void test11()
+	{
+		//
+		//   Earlier versions could be tricked by "SS0" patterns.
+		//
+		LogString badPattern(LOG4CXX_STR("ss,SS0"));
+		DateFormatPtr simpleFormat = new SimpleDateFormat(badPattern);
+		DateFormatPtr gmtFormat = new CachedDateFormat(simpleFormat, 1000000);
+		gmtFormat->setTimeZone(TimeZone::getGMT());
+
+		//
+		// The first request has to 100 ms after an ordinal second
+		//    to push the literal zero out of the pattern check
+		apr_time_t ticks = MICROSECONDS_PER_DAY * 11142L;
+		apr_time_t jul2 = ticks + 120000;
+
+		Pool p;
+
+		LogString s;
+		gmtFormat->format(s, jul2, p);
+
+		LOGUNIT_ASSERT_EQUAL(
+			(LogString) LOG4CXX_STR("00,1200"), s);
+
+		jul2 = ticks + 87000;
+
+		s.erase(s.begin(), s.end());
+		gmtFormat->format(s, jul2, p);
+
+		LOGUNIT_ASSERT_EQUAL(
+			(LogString) LOG4CXX_STR("00,870"), s);
+	}
+
+	/**
+	 * Check pattern location for ISO8601
+	 */
+	void test12()
+	{
+		DateFormatPtr df    = new SimpleDateFormat(LOG4CXX_STR("yyyy-MM-dd HH:mm:ss,SSS"));
+		apr_time_t    ticks = 11142L * MICROSECONDS_PER_DAY;
+		Pool p;
+		LogString formatted;
+
+		df->format(formatted, ticks, p);
+		int msStart = CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
+		LOGUNIT_ASSERT_EQUAL(20, msStart);
+
+		// Test for for milliseconds overlapping with the magic ones as per LOGCXX-420.
+		apr_time_exp_t c;
+		memset(&c, 0, sizeof(c));
+		c.tm_year = 110;
+		c.tm_mon  = 7;
+		c.tm_mday = 12;
+		c.tm_hour = 9;
+		c.tm_min  = 4;
+		c.tm_sec  = 50;
+		c.tm_usec = 406000;
+
+		LOGUNIT_ASSERT_EQUAL(0, apr_time_exp_gmt_get(&ticks, &c));
+
+		formatted.clear();
+		df->format(formatted, ticks, p);
+		msStart = CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
+		LOGUNIT_ASSERT_EQUAL(20, msStart);
+
+		c.tm_usec = 609000;
+		LOGUNIT_ASSERT_EQUAL(0, apr_time_exp_gmt_get(&ticks, &c));
+
+		formatted.clear();
+		df->format(formatted, ticks, p);
+		msStart = CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
+		LOGUNIT_ASSERT_EQUAL(20, msStart);
+	}
+
+	/**
+	 * Check pattern location for DATE
+	 */
+	void test13()
+	{
+		DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("yyyy-MM-dd"));
+		apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
+
+		Pool p;
+
+		LogString formatted;
+		df->format(formatted, ticks, p);
+
+		int millisecondStart = CachedDateFormat::findMillisecondStart(ticks,
+				formatted, df, p);
+		LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::NO_MILLISECONDS, millisecondStart);
+	}
+
+	/**
+	 * Check pattern location for ABSOLUTE
+	 */
+	void test14()
+	{
+		DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("HH:mm:ss,SSS"));
+		apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
+
+		Pool p;
+		LogString formatted;
+		df->format(formatted, ticks, p);
+
+		int millisecondStart = CachedDateFormat::findMillisecondStart(ticks,
+				formatted, df, p);
+		LOGUNIT_ASSERT_EQUAL(9, millisecondStart);
+	}
+
+	/**
+	 * Check pattern location for single S
+	 */
+	void test15()
+	{
+		DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("HH:mm:ss,S"));
+		apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
+
+		Pool p;
+		LogString formatted;
+		df->format(formatted, ticks, p);
+
+		int millisecondStart = CachedDateFormat::findMillisecondStart(ticks,
+				formatted, df, p);
+		LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, millisecondStart);
+	}
+
+	/**
+	 * Check pattern location for single SS
+	 */
+	void test16()
+	{
+		DateFormatPtr df = new SimpleDateFormat(LOG4CXX_STR("HH:mm:ss,SS"));
+		apr_time_t ticks = 11142L * MICROSECONDS_PER_DAY;
+
+		Pool p;
+		LogString formatted;
+		df->format(formatted, ticks, p);
+
+		int millisecondStart =
+			CachedDateFormat::findMillisecondStart(ticks, formatted, df, p);
+		LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, millisecondStart);
+	}
+
+	/**
+	 * Check caching when multiple SSS appear in pattern
+	 */
+	void test17()
+	{
+		apr_time_t jul2 = 12602L * MICROSECONDS_PER_DAY;
+		LogString badPattern(LOG4CXX_STR("HH:mm:ss,SSS HH:mm:ss,SSS"));
+		DateFormatPtr simpleFormat = new SimpleDateFormat(badPattern);
+		simpleFormat->setTimeZone(TimeZone::getGMT());
+		DateFormatPtr cachedFormat = new CachedDateFormat(simpleFormat, 1000000);
+
+		Pool p;
+		LogString s;
+		cachedFormat->format(s, jul2, p);
+
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,000 00:00:00,000"), s);
+		jul2 += 120000;
+
+		s.erase(s.begin(), s.end());
+		simpleFormat->format(s, jul2, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,120 00:00:00,120"), s);
+
+		s.erase(s.begin(), s.end());
+		int msStart = CachedDateFormat::findMillisecondStart(jul2, s, simpleFormat, p);
+		LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, msStart);
+
+		cachedFormat->format(s, jul2, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("00:00:00,120 00:00:00,120"), s) ;
+
+		int maxValid = CachedDateFormat::getMaximumCacheValidity(badPattern);
+		LOGUNIT_ASSERT_EQUAL(1000, maxValid);
+
+		// Test overlapping millis with a magic string from CachedDateFormat for LOGCXX-420.
+		s.clear();
+		jul2 += 286000;
+		cachedFormat->format(s, jul2, p);
+		msStart = CachedDateFormat::findMillisecondStart(jul2, s, simpleFormat, p);
+		LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, msStart);
+
+		s.clear();
+		jul2 += 203000;
+		cachedFormat->format(s, jul2, p);
+		msStart = CachedDateFormat::findMillisecondStart(jul2, s, simpleFormat, p);
+		LOGUNIT_ASSERT_EQUAL((int) CachedDateFormat::UNRECOGNIZED_MILLISECONDS, msStart);
+	}
+
+	/**
+	 * Check that patterns not containing microseconds
+	 * are reported as being able to be cached for a full second.
+	 */
+	void test18()
+	{
+
+		int maxValid =
+			CachedDateFormat::getMaximumCacheValidity(
+				LOG4CXX_STR("yyyy-MM-dd"));
+		LOGUNIT_ASSERT_EQUAL(1000000, maxValid);
+	}
+
+	/**
+	 * Check that patterns not containing 3 microseconds
+	 * are reported as being able to be cached for a full second.
+	 */
+	void test19()
+	{
+
+		int maxValid =
+			CachedDateFormat::getMaximumCacheValidity(
+				LOG4CXX_STR("yyyy-MM-dd SSS"));
+		LOGUNIT_ASSERT_EQUAL(1000000, maxValid);
+	}
+
+	/**
+	 * Check that patterns not containing 2 S's
+	 * are reported as being able to be cached for only a millisecond.
+	 */
+	void test20()
+	{
+
+		int maxValid =
+			CachedDateFormat::getMaximumCacheValidity(
+				LOG4CXX_STR("yyyy-MM-dd SS"));
+		LOGUNIT_ASSERT_EQUAL(1000, maxValid);
+	}
+
+	/**
+	 * Check that patterns not containing multi S groups
+	 * are reported as being able to be cached for only a millisecond.
+	 */
+	void test21()
+	{
+
+		int maxValid =
+			CachedDateFormat::getMaximumCacheValidity(
+				LOG4CXX_STR("yyyy-MM-dd SSS SSS"));
+		LOGUNIT_ASSERT_EQUAL(1000, maxValid);
+	}
+
+	/**
+	 * Check that findMillisecondStart correctly handles timestamps
+	 * which use the magic millisecond value 654.
+	 */
+	void test22()
+	{
+		DateFormatPtr baseFormatter(new ISO8601DateFormat());
+		CachedDateFormat isoFormat(baseFormatter, 1000000);
+		isoFormat.setTimeZone(TimeZone::getGMT());
+
+		Pool p;
+		LogString formatted;
+
+		isoFormat.format(formatted, 654000, p);
+		LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:00,654"), formatted);
+
+		formatted.clear();
+		isoFormat.format(formatted, 999000, p);
+		LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:00,999"), formatted);
+
+		formatted.clear();
+		isoFormat.format(formatted, 1654010, p);
+		LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:01,654"), formatted);
+
+		formatted.clear();
+		isoFormat.format(formatted, 1999010, p);
+		LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR("1970-01-01 00:00:01,999"), formatted);
+	}
 
 };
 
diff --git a/src/test/cpp/helpers/charsetdecodertestcase.cpp b/src/test/cpp/helpers/charsetdecodertestcase.cpp
index 22a485f..0493ba2 100644
--- a/src/test/cpp/helpers/charsetdecodertestcase.cpp
+++ b/src/test/cpp/helpers/charsetdecodertestcase.cpp
@@ -30,78 +30,81 @@ using namespace log4cxx::helpers;
 
 LOGUNIT_CLASS(CharsetDecoderTestCase)
 {
-        LOGUNIT_TEST_SUITE(CharsetDecoderTestCase);
-                LOGUNIT_TEST(decode1);
-                LOGUNIT_TEST(decode2);
-                LOGUNIT_TEST(decode8);
-        LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(CharsetDecoderTestCase);
+	LOGUNIT_TEST(decode1);
+	LOGUNIT_TEST(decode2);
+	LOGUNIT_TEST(decode8);
+	LOGUNIT_TEST_SUITE_END();
 
-        enum { BUFSIZE = 256 };
+	enum { BUFSIZE = 256 };
 
 public:
 
 
-        void decode1() {
-          char buf[] = "Hello, World";
-          ByteBuffer src(buf, strlen(buf));
+	void decode1()
+	{
+		char buf[] = "Hello, World";
+		ByteBuffer src(buf, strlen(buf));
 
-          CharsetDecoderPtr dec(CharsetDecoder::getDefaultDecoder());
-          LogString greeting;
-          log4cxx_status_t stat = dec->decode(src, greeting);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		CharsetDecoderPtr dec(CharsetDecoder::getDefaultDecoder());
+		LogString greeting;
+		log4cxx_status_t stat = dec->decode(src, greeting);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
 
-          stat = dec->decode(src, greeting);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          LOGUNIT_ASSERT_EQUAL((size_t) 12, src.position());
+		stat = dec->decode(src, greeting);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL((size_t) 12, src.position());
 
-          LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Hello, World"), greeting);
-        }
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Hello, World"), greeting);
+	}
 
-        void decode2() {
-          char buf[BUFSIZE + 6];
-          memset(buf, 'A', BUFSIZE);
-          buf[BUFSIZE - 3] = 0;
+	void decode2()
+	{
+		char buf[BUFSIZE + 6];
+		memset(buf, 'A', BUFSIZE);
+		buf[BUFSIZE - 3] = 0;
 #if defined(__STDC_LIB_EXT1__) || defined(__STDC_SECURE_LIB__)
-          strcat_s(buf, sizeof buf, "Hello");
+		strcat_s(buf, sizeof buf, "Hello");
 #else
-          strcat(buf, "Hello");
+		strcat(buf, "Hello");
 #endif
-          ByteBuffer src(buf, strlen(buf));
+		ByteBuffer src(buf, strlen(buf));
 
-          CharsetDecoderPtr dec(CharsetDecoder::getDefaultDecoder());
+		CharsetDecoderPtr dec(CharsetDecoder::getDefaultDecoder());
 
-          LogString greeting;
-          log4cxx_status_t stat = dec->decode(src, greeting);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          LOGUNIT_ASSERT_EQUAL((size_t) 0, src.remaining());
+		LogString greeting;
+		log4cxx_status_t stat = dec->decode(src, greeting);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL((size_t) 0, src.remaining());
 
 
-          stat = dec->decode(src, greeting);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		stat = dec->decode(src, greeting);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
 
-          LogString manyAs(BUFSIZE - 3, LOG4CXX_STR('A'));
-          LOGUNIT_ASSERT_EQUAL(manyAs, greeting.substr(0, BUFSIZE - 3));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("Hello")), greeting.substr(BUFSIZE - 3));
-        }
+		LogString manyAs(BUFSIZE - 3, LOG4CXX_STR('A'));
+		LOGUNIT_ASSERT_EQUAL(manyAs, greeting.substr(0, BUFSIZE - 3));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("Hello")), greeting.substr(BUFSIZE - 3));
+	}
 
 
 
-        void decode8() {
-          char buf[] = { 'H', 'e', 'l', 'l', 'o', ',', 0, 'W', 'o', 'r', 'l', 'd'};
-          ByteBuffer src(buf, 12);
+	void decode8()
+	{
+		char buf[] = { 'H', 'e', 'l', 'l', 'o', ',', 0, 'W', 'o', 'r', 'l', 'd'};
+		ByteBuffer src(buf, 12);
 
-          CharsetDecoderPtr dec(CharsetDecoder::getDefaultDecoder());
-          LogString greeting;
-          log4cxx_status_t stat = dec->decode(src, greeting);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		CharsetDecoderPtr dec(CharsetDecoder::getDefaultDecoder());
+		LogString greeting;
+		log4cxx_status_t stat = dec->decode(src, greeting);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
 
-          stat = dec->decode(src, greeting);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          LOGUNIT_ASSERT_EQUAL((size_t) 12, src.position());
+		stat = dec->decode(src, greeting);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL((size_t) 12, src.position());
 
-          const logchar expected[] = { 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x00, 0x57, 0x6F, 0x72, 0x6C, 0x64 };
-          LOGUNIT_ASSERT_EQUAL(LogString(expected, 12), greeting);
-        }
+		const logchar expected[] = { 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x00, 0x57, 0x6F, 0x72, 0x6C, 0x64 };
+		LOGUNIT_ASSERT_EQUAL(LogString(expected, 12), greeting);
+	}
 
 
 
diff --git a/src/test/cpp/helpers/charsetencodertestcase.cpp b/src/test/cpp/helpers/charsetencodertestcase.cpp
index 74af926..5677820 100644
--- a/src/test/cpp/helpers/charsetencodertestcase.cpp
+++ b/src/test/cpp/helpers/charsetencodertestcase.cpp
@@ -33,268 +33,312 @@ using namespace log4cxx::helpers;
 
 LOGUNIT_CLASS(CharsetEncoderTestCase)
 {
-        LOGUNIT_TEST_SUITE(CharsetEncoderTestCase);
-                LOGUNIT_TEST(encode1);
-                LOGUNIT_TEST(encode2);
-                LOGUNIT_TEST(encode3);
-                LOGUNIT_TEST(encode4);
-#if APR_HAS_THREADS        
-                LOGUNIT_TEST(thread1);
-#endif                
-        LOGUNIT_TEST_SUITE_END();
-
-        enum { BUFSIZE = 256 };
+	LOGUNIT_TEST_SUITE(CharsetEncoderTestCase);
+	LOGUNIT_TEST(encode1);
+	LOGUNIT_TEST(encode2);
+	LOGUNIT_TEST(encode3);
+	LOGUNIT_TEST(encode4);
+#if APR_HAS_THREADS
+	LOGUNIT_TEST(thread1);
+#endif
+	LOGUNIT_TEST_SUITE_END();
+
+	enum { BUFSIZE = 256 };
 
 public:
 
 
-        void encode1() {
-          const LogString greeting(LOG4CXX_STR("Hello, World"));
-          CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("US-ASCII")));
-          char buf[BUFSIZE];
-          ByteBuffer out(buf, BUFSIZE);
-          LogString::const_iterator iter = greeting.begin();
-          log4cxx_status_t stat = enc->encode(greeting, iter, out);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          LOGUNIT_ASSERT(iter == greeting.end());
-
-          stat = enc->encode(greeting, iter, out);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          LOGUNIT_ASSERT_EQUAL((size_t) 12, out.position());
-
-          out.flip();
-          std::string encoded((const char*) out.data(), out.limit());
-          LOGUNIT_ASSERT_EQUAL((std::string) "Hello, World", encoded);
-          LOGUNIT_ASSERT(iter == greeting.end());
-        }
-
-        void encode2() {
-          LogString greeting(BUFSIZE - 3, LOG4CXX_STR('A'));
-          greeting.append(LOG4CXX_STR("Hello"));
-
-          CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("US-ASCII")));
-
-          char buf[BUFSIZE];
-          ByteBuffer out(buf, BUFSIZE);
-          LogString::const_iterator iter = greeting.begin();
-          log4cxx_status_t stat = enc->encode(greeting, iter, out);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          LOGUNIT_ASSERT_EQUAL((size_t) 0, out.remaining());
-          LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR('o'), *(iter+1));
-
-          out.flip();
-          std::string encoded((char*) out.data(), out.limit());
-          out.clear();
-
-          stat = enc->encode(greeting, iter, out);
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          LOGUNIT_ASSERT_EQUAL((size_t) 2, out.position());
-          LOGUNIT_ASSERT(iter == greeting.end());
-
-          stat = enc->encode(greeting, iter, out);
-          out.flip();
-          LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-          encoded.append(out.data(), out.limit());
-
-          std::string manyAs(BUFSIZE - 3, 'A');
-          LOGUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
-          LOGUNIT_ASSERT_EQUAL(std::string("Hello"), encoded.substr(BUFSIZE - 3));
-        }
-
-
-        void encode3() {
+	void encode1()
+	{
+		const LogString greeting(LOG4CXX_STR("Hello, World"));
+		CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("US-ASCII")));
+		char buf[BUFSIZE];
+		ByteBuffer out(buf, BUFSIZE);
+		LogString::const_iterator iter = greeting.begin();
+		log4cxx_status_t stat = enc->encode(greeting, iter, out);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT(iter == greeting.end());
+
+		stat = enc->encode(greeting, iter, out);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL((size_t) 12, out.position());
+
+		out.flip();
+		std::string encoded((const char*) out.data(), out.limit());
+		LOGUNIT_ASSERT_EQUAL((std::string) "Hello, World", encoded);
+		LOGUNIT_ASSERT(iter == greeting.end());
+	}
+
+	void encode2()
+	{
+		LogString greeting(BUFSIZE - 3, LOG4CXX_STR('A'));
+		greeting.append(LOG4CXX_STR("Hello"));
+
+		CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("US-ASCII")));
+
+		char buf[BUFSIZE];
+		ByteBuffer out(buf, BUFSIZE);
+		LogString::const_iterator iter = greeting.begin();
+		log4cxx_status_t stat = enc->encode(greeting, iter, out);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL((size_t) 0, out.remaining());
+		LOGUNIT_ASSERT_EQUAL(LOG4CXX_STR('o'), *(iter + 1));
+
+		out.flip();
+		std::string encoded((char*) out.data(), out.limit());
+		out.clear();
+
+		stat = enc->encode(greeting, iter, out);
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL((size_t) 2, out.position());
+		LOGUNIT_ASSERT(iter == greeting.end());
+
+		stat = enc->encode(greeting, iter, out);
+		out.flip();
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		encoded.append(out.data(), out.limit());
+
+		std::string manyAs(BUFSIZE - 3, 'A');
+		LOGUNIT_ASSERT_EQUAL(manyAs, encoded.substr(0, BUFSIZE - 3));
+		LOGUNIT_ASSERT_EQUAL(std::string("Hello"), encoded.substr(BUFSIZE - 3));
+	}
+
+
+	void encode3()
+	{
 #if LOG4CXX_LOGCHAR_IS_WCHAR || LOG4CXX_LOGCHAR_IS_UNICHAR
-          //   arbitrary, hopefully meaningless, characters from
-          //     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
-          const logchar greet[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x400, 0 };
+		//   arbitrary, hopefully meaningless, characters from
+		//     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
+		const logchar greet[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x400, 0 };
 #endif
 
 #if LOG4CXX_LOGCHAR_IS_UTF8
-          const char greet[] = { 'A',
-                                    (char) 0xD8, (char) 0x85,
-                                    (char) 0xD4, (char) 0xB0,
-                                    (char) 0xE0, (char) 0xA6, (char) 0x86,
-                                    (char) 0xE4, (char) 0xB8, (char) 0x83,
-                                    (char) 0xD0, (char) 0x80,
-                                    0 };
+		const char greet[] = { 'A',
+				(char) 0xD8, (char) 0x85,
+				(char) 0xD4, (char) 0xB0,
+				(char) 0xE0, (char) 0xA6, (char) 0x86,
+				(char) 0xE4, (char) 0xB8, (char) 0x83,
+				(char) 0xD0, (char) 0x80,
+				0
+			};
 #endif
-          LogString greeting(greet);
-
-          CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("US-ASCII")));
-
-          char buf[BUFSIZE];
-          ByteBuffer out(buf, BUFSIZE);
-
-          LogString::const_iterator iter = greeting.begin();
-          log4cxx_status_t stat = enc->encode(greeting, iter, out);
-          out.flip();
-          LOGUNIT_ASSERT_EQUAL(true, CharsetEncoder::isError(stat));
-          LOGUNIT_ASSERT_EQUAL((size_t) 1, out.limit());
-          LOGUNIT_ASSERT_EQUAL(greet[1], *iter);
-          LOGUNIT_ASSERT_EQUAL('A', out.data()[0]);
-        }
-
-
-        void encode4() {
-          const char utf8_greet[] = { 'A',
-                                    (char) 0xD8, (char) 0x85,
-                                    (char) 0xD4, (char) 0xB0,
-                                    (char) 0xE0, (char) 0xA6, (char) 0x86,
-                                    (char) 0xE4, (char) 0xB8, (char) 0x83,
-                                    (char) 0xD0, (char) 0x80,
-                                    0 };
+		LogString greeting(greet);
+
+		CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("US-ASCII")));
+
+		char buf[BUFSIZE];
+		ByteBuffer out(buf, BUFSIZE);
+
+		LogString::const_iterator iter = greeting.begin();
+		log4cxx_status_t stat = enc->encode(greeting, iter, out);
+		out.flip();
+		LOGUNIT_ASSERT_EQUAL(true, CharsetEncoder::isError(stat));
+		LOGUNIT_ASSERT_EQUAL((size_t) 1, out.limit());
+		LOGUNIT_ASSERT_EQUAL(greet[1], *iter);
+		LOGUNIT_ASSERT_EQUAL('A', out.data()[0]);
+	}
+
+
+	void encode4()
+	{
+		const char utf8_greet[] = { 'A',
+				(char) 0xD8, (char) 0x85,
+				(char) 0xD4, (char) 0xB0,
+				(char) 0xE0, (char) 0xA6, (char) 0x86,
+				(char) 0xE4, (char) 0xB8, (char) 0x83,
+				(char) 0xD0, (char) 0x80,
+				0
+			};
 #if LOG4CXX_LOGCHAR_IS_WCHAR || LOG4CXX_LOGCHAR_IS_UNICHAR
-          //   arbitrary, hopefully meaningless, characters from
-          //     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
-          const logchar greet[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x400, 0 };
+		//   arbitrary, hopefully meaningless, characters from
+		//     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
+		const logchar greet[] = { L'A', 0x0605, 0x0530, 0x986, 0x4E03, 0x400, 0 };
 #endif
 
 #if LOG4CXX_LOGCHAR_IS_UTF8
-          const logchar *greet = utf8_greet;
+		const logchar* greet = utf8_greet;
 #endif
-          LogString greeting(greet);
-
-          CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("UTF-8")));
-
-          char buf[BUFSIZE];
-          ByteBuffer out(buf, BUFSIZE);
-          LogString::const_iterator iter = greeting.begin();
-          log4cxx_status_t stat = enc->encode(greeting, iter, out);
-          LOGUNIT_ASSERT_EQUAL(false, CharsetEncoder::isError(stat));
-          stat = enc->encode(greeting, iter, out);
-          LOGUNIT_ASSERT_EQUAL(false, CharsetEncoder::isError(stat));
-
-          out.flip();
-          LOGUNIT_ASSERT_EQUAL((size_t) 13, out.limit());
-          for(size_t i = 0; i < out.limit(); i++) {
-             LOGUNIT_ASSERT_EQUAL((int) utf8_greet[i], (int) out.data()[i]);
-          }
-          LOGUNIT_ASSERT(iter == greeting.end());
-        }
-        
-#if APR_HAS_THREADS        
-        class ThreadPackage {
-        public:
-            ThreadPackage(CharsetEncoderPtr& enc, int repetitions) : 
-                p(), lock(p), condition(p), passCount(0), failCount(0), enc(enc), repetitions(repetitions) {
-            }
-            
-            void await() {
-                synchronized sync(lock);
-                condition.await(lock);
-            }
-            
-            void signalAll() {
-                synchronized sync(lock);
-                condition.signalAll();
-            }
-            
-            void fail() {
-                apr_atomic_inc32(&failCount);
-            }
-            
-            void pass() {
-                apr_atomic_inc32(&passCount);
-            }
-            
-            apr_uint32_t getFail() {
-               return apr_atomic_read32(&failCount);
-            }
-            
-            apr_uint32_t getPass() {
-               return apr_atomic_read32(&passCount);
-            }
-            
-            int getRepetitions() {
-                return repetitions;
-            }
-            
-            CharsetEncoderPtr& getEncoder() {
-               return enc;
-            }
-            
-        private:
-            ThreadPackage(const ThreadPackage&);
-            ThreadPackage& operator=(ThreadPackage&);
-            Pool p;
-            Mutex lock;
-            Condition condition;
-            volatile apr_uint32_t passCount;
-            volatile apr_uint32_t failCount; 
-            CharsetEncoderPtr enc;
-            int repetitions;
-        };
-        
-        static void* LOG4CXX_THREAD_FUNC thread1Action(apr_thread_t* /* thread */, void* data) {
-            ThreadPackage* package = (ThreadPackage*) data;
+		LogString greeting(greet);
+
+		CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("UTF-8")));
+
+		char buf[BUFSIZE];
+		ByteBuffer out(buf, BUFSIZE);
+		LogString::const_iterator iter = greeting.begin();
+		log4cxx_status_t stat = enc->encode(greeting, iter, out);
+		LOGUNIT_ASSERT_EQUAL(false, CharsetEncoder::isError(stat));
+		stat = enc->encode(greeting, iter, out);
+		LOGUNIT_ASSERT_EQUAL(false, CharsetEncoder::isError(stat));
+
+		out.flip();
+		LOGUNIT_ASSERT_EQUAL((size_t) 13, out.limit());
+
+		for (size_t i = 0; i < out.limit(); i++)
+		{
+			LOGUNIT_ASSERT_EQUAL((int) utf8_greet[i], (int) out.data()[i]);
+		}
+
+		LOGUNIT_ASSERT(iter == greeting.end());
+	}
+
+#if APR_HAS_THREADS
+	class ThreadPackage
+	{
+		public:
+			ThreadPackage(CharsetEncoderPtr& enc, int repetitions) :
+				p(), lock(p), condition(p), passCount(0), failCount(0), enc(enc), repetitions(repetitions)
+			{
+			}
+
+			void await()
+			{
+				synchronized sync(lock);
+				condition.await(lock);
+			}
+
+			void signalAll()
+			{
+				synchronized sync(lock);
+				condition.signalAll();
+			}
+
+			void fail()
+			{
+				apr_atomic_inc32(&failCount);
+			}
+
+			void pass()
+			{
+				apr_atomic_inc32(&passCount);
+			}
+
+			apr_uint32_t getFail()
+			{
+				return apr_atomic_read32(&failCount);
+			}
+
+			apr_uint32_t getPass()
+			{
+				return apr_atomic_read32(&passCount);
+			}
+
+			int getRepetitions()
+			{
+				return repetitions;
+			}
+
+			CharsetEncoderPtr& getEncoder()
+			{
+				return enc;
+			}
+
+		private:
+			ThreadPackage(const ThreadPackage&);
+			ThreadPackage& operator=(ThreadPackage&);
+			Pool p;
+			Mutex lock;
+			Condition condition;
+			volatile apr_uint32_t passCount;
+			volatile apr_uint32_t failCount;
+			CharsetEncoderPtr enc;
+			int repetitions;
+	};
+
+	static void* LOG4CXX_THREAD_FUNC thread1Action(apr_thread_t* /* thread */, void* data)
+	{
+		ThreadPackage* package = (ThreadPackage*) data;
 #if LOG4CXX_LOGCHAR_IS_UTF8
-            const logchar greet[] = { 'H', 'e', 'l', 'l', 'o', ' ',
-                                    (char) 0xC2, (char) 0xA2,  //  cent sign
-                                    (char) 0xC2, (char) 0xA9,  //  copyright
-                                    (char) 0xc3, (char) 0xb4,  //  latin small letter o with circumflex
-                                    0 };
+		const logchar greet[] = { 'H', 'e', 'l', 'l', 'o', ' ',
+				(char) 0xC2, (char) 0xA2,  //  cent sign
+				(char) 0xC2, (char) 0xA9,  //  copyright
+				(char) 0xc3, (char) 0xb4,  //  latin small letter o with circumflex
+				0
+			};
 #endif
 #if LOG4CXX_LOGCHAR_IS_WCHAR || LOG4CXX_LOGCHAR_IS_UNICHAR
-            //   arbitrary, hopefully meaningless, characters from
-            //     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
-            const logchar greet[] = { L'H', L'e', L'l', L'l', L'o', L' ',
-                0x00A2, 0x00A9, 0x00F4 , 0 };
+		//   arbitrary, hopefully meaningless, characters from
+		//     Latin, Arabic, Armenian, Bengali, CJK and Cyrillic
+		const logchar greet[] = { L'H', L'e', L'l', L'l', L'o', L' ',
+				0x00A2, 0x00A9, 0x00F4, 0
+			};
 #endif
-          
-          const char expected[] =  { 'H', 'e', 'l', 'l', 'o', ' ',
-                (char) 0x00A2, (char) 0x00A9, (char) 0x00F4 };
-
-          LogString greeting(greet);
-
-          package->await();
-          for(int i = 0; i < package->getRepetitions(); i++) {
-            bool pass = true;
-            char buf[BUFSIZE];
-            ByteBuffer out(buf, BUFSIZE);
-            LogString::const_iterator iter = greeting.begin();
-            log4cxx_status_t stat = package->getEncoder()->encode(greeting, iter, out);
-            pass = (false == CharsetEncoder::isError(stat));
-            if (pass) {
-                stat = package->getEncoder()->encode(greeting, iter, out);
-                pass = (false == CharsetEncoder::isError(stat));
-                if (pass) {
-                    out.flip();
-                    pass = (sizeof(expected) == out.limit());
-                    for(size_t i = 0; i < out.limit() && pass; i++) {
-                        pass = (expected[i] == out.data()[i]);
-                    }
-                    pass = pass && (iter == greeting.end());
-                }
-            }
-            if (pass) {
-                package->pass();
-            } else {
-                package->fail();
-            }
-          }
-            return 0;
-        }
-
-        void thread1() {
-              enum { THREAD_COUNT = 10, THREAD_REPS = 10000 };
-              Thread threads[THREAD_COUNT];
-              CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("ISO-8859-1")));
-              ThreadPackage* package = new ThreadPackage(enc, THREAD_REPS);
-              { for(int i = 0; i < THREAD_COUNT; i++) {
-                  threads[i].run(thread1Action, package);
-              } }
-              //
-              //   give time for all threads to be launched so
-              //      we don't signal before everybody is waiting.
-              Thread::sleep(100);
-              package->signalAll();
-              for(int i = 0; i < THREAD_COUNT; i++) {
-                  threads[i].join();
-              }
-              LOGUNIT_ASSERT_EQUAL((apr_uint32_t) 0, package->getFail());
-              LOGUNIT_ASSERT_EQUAL((apr_uint32_t) THREAD_COUNT * THREAD_REPS, package->getPass());
-              delete package;
-        }
+
+		const char expected[] =  { 'H', 'e', 'l', 'l', 'o', ' ',
+				(char) 0x00A2, (char) 0x00A9, (char) 0x00F4
+			};
+
+		LogString greeting(greet);
+
+		package->await();
+
+		for (int i = 0; i < package->getRepetitions(); i++)
+		{
+			bool pass = true;
+			char buf[BUFSIZE];
+			ByteBuffer out(buf, BUFSIZE);
+			LogString::const_iterator iter = greeting.begin();
+			log4cxx_status_t stat = package->getEncoder()->encode(greeting, iter, out);
+			pass = (false == CharsetEncoder::isError(stat));
+
+			if (pass)
+			{
+				stat = package->getEncoder()->encode(greeting, iter, out);
+				pass = (false == CharsetEncoder::isError(stat));
+
+				if (pass)
+				{
+					out.flip();
+					pass = (sizeof(expected) == out.limit());
+
+					for (size_t i = 0; i < out.limit() && pass; i++)
+					{
+						pass = (expected[i] == out.data()[i]);
+					}
+
+					pass = pass && (iter == greeting.end());
+				}
+			}
+
+			if (pass)
+			{
+				package->pass();
+			}
+			else
+			{
+				package->fail();
+			}
+		}
+
+		return 0;
+	}
+
+	void thread1()
+	{
+		enum { THREAD_COUNT = 10, THREAD_REPS = 10000 };
+		Thread threads[THREAD_COUNT];
+		CharsetEncoderPtr enc(CharsetEncoder::getEncoder(LOG4CXX_STR("ISO-8859-1")));
+		ThreadPackage* package = new ThreadPackage(enc, THREAD_REPS);
+		{
+			for (int i = 0; i < THREAD_COUNT; i++)
+			{
+				threads[i].run(thread1Action, package);
+			}
+		}
+		//
+		//   give time for all threads to be launched so
+		//      we don't signal before everybody is waiting.
+		Thread::sleep(100);
+		package->signalAll();
+
+		for (int i = 0; i < THREAD_COUNT; i++)
+		{
+			threads[i].join();
+		}
+
+		LOGUNIT_ASSERT_EQUAL((apr_uint32_t) 0, package->getFail());
+		LOGUNIT_ASSERT_EQUAL((apr_uint32_t) THREAD_COUNT * THREAD_REPS, package->getPass());
+		delete package;
+	}
 #endif
 
 };
diff --git a/src/test/cpp/helpers/cyclicbuffertestcase.cpp b/src/test/cpp/helpers/cyclicbuffertestcase.cpp
index 05e9065..c644d55 100644
--- a/src/test/cpp/helpers/cyclicbuffertestcase.cpp
+++ b/src/test/cpp/helpers/cyclicbuffertestcase.cpp
@@ -32,138 +32,141 @@ using namespace log4cxx::spi;
 
 LOGUNIT_CLASS(CyclicBufferTestCase)
 {
-   LOGUNIT_TEST_SUITE(CyclicBufferTestCase);
-      LOGUNIT_TEST(test0);
-      LOGUNIT_TEST(test1);
-      LOGUNIT_TEST(testResize);
-   LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(CyclicBufferTestCase);
+	LOGUNIT_TEST(test0);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(testResize);
+	LOGUNIT_TEST_SUITE_END();
 
-   LoggerPtr logger;
-   std::vector<LoggingEventPtr> e;
+	LoggerPtr logger;
+	std::vector<LoggingEventPtr> e;
 
 public:
-   void setUp()
-   {
-      e.reserve(1000);
-      LoggingEventPtr event;
-      for (int i = 0; i < MAX; i++)
-      {
-         event = new LoggingEvent(LOG4CXX_STR("x"), Level::getDebug(), LOG4CXX_STR("e"),
-                          log4cxx::spi::LocationInfo::getLocationUnavailable());
-         e.push_back(event);
-      }
-   }
-
-   void tearDown()
-   {
-      LogManager::shutdown();
-   }
-
-   void test0()
-   {
-      int size = 2;
-
-      CyclicBuffer cb(size);
-      LOGUNIT_ASSERT_EQUAL(size, cb.getMaxSize());
-
-      cb.add(e[0]);
-      LOGUNIT_ASSERT_EQUAL(1, cb.length());
-      LOGUNIT_ASSERT_EQUAL(e[0], cb.get());
-      LOGUNIT_ASSERT_EQUAL(0, cb.length());
-      LOGUNIT_ASSERT(cb.get() == 0);
-      LOGUNIT_ASSERT_EQUAL(0, cb.length());
-
-      CyclicBuffer cb2(size);
-      cb2.add(e[0]);
-      cb2.add(e[1]);
-      LOGUNIT_ASSERT_EQUAL(2, cb2.length());
-      LOGUNIT_ASSERT_EQUAL(e[0], cb2.get());
-      LOGUNIT_ASSERT_EQUAL(1, cb2.length());
-      LOGUNIT_ASSERT_EQUAL(e[1], cb2.get());
-      LOGUNIT_ASSERT_EQUAL(0, cb2.length());
-      LOGUNIT_ASSERT(cb2.get() == 0);
-      LOGUNIT_ASSERT_EQUAL(0, cb2.length());
-   }
-
-   void test1()
-   {
-      for (int bufSize = 1; bufSize <= 128; bufSize *= 2)
-         doTest1(bufSize);
-   }
-
-   void doTest1(int size)
-   {
-      //System.out.println("Doing test with size = "+size);
-      CyclicBuffer cb(size);
-
-      LOGUNIT_ASSERT_EQUAL(size, cb.getMaxSize());
-
-      int i;
-
-      for (i = -(size + 10); i < (size + 10); i++)
-      {
-         LOGUNIT_ASSERT(cb.get(i) == 0);
-      }
-
-      for (i = 0; i < MAX; i++)
-      {
-         cb.add(e[i]);
-
-         int limit = (i < (size - 1)) ? i : (size - 1);
-
-         //System.out.println("\nLimit is " + limit + ", i="+i);
-         for (int j = limit; j >= 0; j--)
-         {
-            //System.out.println("i= "+i+", j="+j);
-            LOGUNIT_ASSERT_EQUAL(e[i - (limit - j)], cb.get(j));
-         }
-
-         LOGUNIT_ASSERT(cb.get(-1) == 0);
-         LOGUNIT_ASSERT(cb.get(limit + 1) == 0);
-      }
-   }
-
-   void testResize()
-   {
-      for (int isize = 1; isize <= 128; isize *= 2)
-      {
-         doTestResize(isize, (isize / 2) + 1, (isize / 2) + 1);
-         doTestResize(isize, (isize / 2) + 1, isize + 10);
-         doTestResize(isize, isize + 10, (isize / 2) + 1);
-         doTestResize(isize, isize + 10, isize + 10);
-      }
-
-   }
-
-   void doTestResize(int initialSize, int numberOfAdds, int newSize)
-   {
-      //System.out.println("initialSize = "+initialSize+", numberOfAdds="
-      //        +numberOfAdds+", newSize="+newSize);
-      CyclicBuffer cb(initialSize);
-
-      for (int i = 0; i < numberOfAdds; i++)
-      {
-         cb.add(e[i]);
-      }
-
-      cb.resize(newSize);
-
-      int offset = numberOfAdds - initialSize;
-
-      if (offset < 0)
-      {
-         offset = 0;
-      }
-
-      int len = (newSize < numberOfAdds) ? newSize : numberOfAdds;
-      len = (len < initialSize) ? len : initialSize;
-
-      //System.out.println("Len = "+len+", offset="+offset);
-      for (int j = 0; j < len; j++)
-      {
-         LOGUNIT_ASSERT_EQUAL(e[offset + j], cb.get(j));
-      }
-   }
+	void setUp()
+	{
+		e.reserve(1000);
+		LoggingEventPtr event;
+
+		for (int i = 0; i < MAX; i++)
+		{
+			event = new LoggingEvent(LOG4CXX_STR("x"), Level::getDebug(), LOG4CXX_STR("e"),
+				log4cxx::spi::LocationInfo::getLocationUnavailable());
+			e.push_back(event);
+		}
+	}
+
+	void tearDown()
+	{
+		LogManager::shutdown();
+	}
+
+	void test0()
+	{
+		int size = 2;
+
+		CyclicBuffer cb(size);
+		LOGUNIT_ASSERT_EQUAL(size, cb.getMaxSize());
+
+		cb.add(e[0]);
+		LOGUNIT_ASSERT_EQUAL(1, cb.length());
+		LOGUNIT_ASSERT_EQUAL(e[0], cb.get());
+		LOGUNIT_ASSERT_EQUAL(0, cb.length());
+		LOGUNIT_ASSERT(cb.get() == 0);
+		LOGUNIT_ASSERT_EQUAL(0, cb.length());
+
+		CyclicBuffer cb2(size);
+		cb2.add(e[0]);
+		cb2.add(e[1]);
+		LOGUNIT_ASSERT_EQUAL(2, cb2.length());
+		LOGUNIT_ASSERT_EQUAL(e[0], cb2.get());
+		LOGUNIT_ASSERT_EQUAL(1, cb2.length());
+		LOGUNIT_ASSERT_EQUAL(e[1], cb2.get());
+		LOGUNIT_ASSERT_EQUAL(0, cb2.length());
+		LOGUNIT_ASSERT(cb2.get() == 0);
+		LOGUNIT_ASSERT_EQUAL(0, cb2.length());
+	}
+
+	void test1()
+	{
+		for (int bufSize = 1; bufSize <= 128; bufSize *= 2)
+		{
+			doTest1(bufSize);
+		}
+	}
+
+	void doTest1(int size)
+	{
+		//System.out.println("Doing test with size = "+size);
+		CyclicBuffer cb(size);
+
+		LOGUNIT_ASSERT_EQUAL(size, cb.getMaxSize());
+
+		int i;
+
+		for (i = -(size + 10); i < (size + 10); i++)
+		{
+			LOGUNIT_ASSERT(cb.get(i) == 0);
+		}
+
+		for (i = 0; i < MAX; i++)
+		{
+			cb.add(e[i]);
+
+			int limit = (i < (size - 1)) ? i : (size - 1);
+
+			//System.out.println("\nLimit is " + limit + ", i="+i);
+			for (int j = limit; j >= 0; j--)
+			{
+				//System.out.println("i= "+i+", j="+j);
+				LOGUNIT_ASSERT_EQUAL(e[i - (limit - j)], cb.get(j));
+			}
+
+			LOGUNIT_ASSERT(cb.get(-1) == 0);
+			LOGUNIT_ASSERT(cb.get(limit + 1) == 0);
+		}
+	}
+
+	void testResize()
+	{
+		for (int isize = 1; isize <= 128; isize *= 2)
+		{
+			doTestResize(isize, (isize / 2) + 1, (isize / 2) + 1);
+			doTestResize(isize, (isize / 2) + 1, isize + 10);
+			doTestResize(isize, isize + 10, (isize / 2) + 1);
+			doTestResize(isize, isize + 10, isize + 10);
+		}
+
+	}
+
+	void doTestResize(int initialSize, int numberOfAdds, int newSize)
+	{
+		//System.out.println("initialSize = "+initialSize+", numberOfAdds="
+		//        +numberOfAdds+", newSize="+newSize);
+		CyclicBuffer cb(initialSize);
+
+		for (int i = 0; i < numberOfAdds; i++)
+		{
+			cb.add(e[i]);
+		}
+
+		cb.resize(newSize);
+
+		int offset = numberOfAdds - initialSize;
+
+		if (offset < 0)
+		{
+			offset = 0;
+		}
+
+		int len = (newSize < numberOfAdds) ? newSize : numberOfAdds;
+		len = (len < initialSize) ? len : initialSize;
+
+		//System.out.println("Len = "+len+", offset="+offset);
+		for (int j = 0; j < len; j++)
+		{
+			LOGUNIT_ASSERT_EQUAL(e[offset + j], cb.get(j));
+		}
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(CyclicBufferTestCase);
diff --git a/src/test/cpp/helpers/datetimedateformattestcase.cpp b/src/test/cpp/helpers/datetimedateformattestcase.cpp
index 0897bc1..e771404 100644
--- a/src/test/cpp/helpers/datetimedateformattestcase.cpp
+++ b/src/test/cpp/helpers/datetimedateformattestcase.cpp
@@ -31,9 +31,9 @@ using namespace std;
 
 #define LOCALE_US "C"
 #if defined(_WIN32)
-#define LOCALE_FR "French_france"
+	#define LOCALE_FR "French_france"
 #else
-#define LOCALE_FR "fr_FR"
+	#define LOCALE_FR "fr_FR"
 #endif
 
 #define LOG4CXX_TEST 1
@@ -44,33 +44,33 @@ using namespace std;
 #include <locale>
 #include "localechanger.h"
 #define MAKE_LOCALE(ptr, id)     \
-std::locale loco(id);            \
-std::locale* ptr = &loco;
+	std::locale loco(id);            \
+	std::locale* ptr = &loco;
 #else
 #define MAKE_LOCALE(ptr, id)     \
-std::locale* ptr = NULL;
+	std::locale* ptr = NULL;
 #endif
 
 
 /**
    Unit test {@link DateTimeDateFormat}.
-   
-   
+
+
 */
 LOGUNIT_CLASS(DateTimeDateFormatTestCase)
 {
-  LOGUNIT_TEST_SUITE( DateTimeDateFormatTestCase );
-  LOGUNIT_TEST( test1 );
-  LOGUNIT_TEST( test2 );
-  LOGUNIT_TEST( test3 );
-  LOGUNIT_TEST( test4 );
-  LOGUNIT_TEST( test5 );
-  LOGUNIT_TEST( test6 );
+	LOGUNIT_TEST_SUITE( DateTimeDateFormatTestCase );
+	LOGUNIT_TEST( test1 );
+	LOGUNIT_TEST( test2 );
+	LOGUNIT_TEST( test3 );
+	LOGUNIT_TEST( test4 );
+	LOGUNIT_TEST( test5 );
+	LOGUNIT_TEST( test6 );
 #if LOG4CXX_HAS_STD_LOCALE
-  LOGUNIT_TEST( test7 );
-  LOGUNIT_TEST( test8 );
+	LOGUNIT_TEST( test7 );
+	LOGUNIT_TEST( test8 );
 #endif
-  LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE_END();
 
 
 
@@ -79,160 +79,165 @@ private:
 #define MICROSECONDS_PER_DAY APR_INT64_C(86400000000)
 
 
-  /**
-   Asserts that formatting the provided date results in the expected string.
-
-  @param date Date date
-   @param timeZone TimeZone timezone for conversion
-   @param expected String expected string
-  */
-  void assertFormattedTime( apr_time_t date, const std::locale* locale,
-       const TimeZonePtr& timeZone, const LogString& expected )
-       {
-         DateTimeDateFormat formatter(locale);
-         formatter.setTimeZone(timeZone);
-         LogString actual;
-         Pool p;
-         formatter.format(actual, date, p);
-         LOGUNIT_ASSERT_EQUAL( expected, actual );
-  }
+	/**
+	 Asserts that formatting the provided date results in the expected string.
+
+	@param date Date date
+	 @param timeZone TimeZone timezone for conversion
+	 @param expected String expected string
+	*/
+	void assertFormattedTime( apr_time_t date, const std::locale * locale,
+		const TimeZonePtr & timeZone, const LogString & expected )
+	{
+		DateTimeDateFormat formatter(locale);
+		formatter.setTimeZone(timeZone);
+		LogString actual;
+		Pool p;
+		formatter.format(actual, date, p);
+		LOGUNIT_ASSERT_EQUAL( expected, actual );
+	}
 public:
 
-  /** Convert 02 Jan 2004 00:00:00 GMT for GMT. */
-  void test1()
-  {
-    //
-    //   02 Jan 2004 00:00 GMT
-    //
-    apr_time_t jan2 = MICROSECONDS_PER_DAY * 12419;
-    MAKE_LOCALE(localeUS, LOCALE_US);
-    assertFormattedTime( jan2, localeUS, TimeZone::getGMT(), LOG4CXX_STR("02 Jan 2004 00:00:00,000"));
-  }
-
-  /** Convert 03 Jan 2004 00:00:00 GMT for America/Chicago. */
-  void test2()
-  {
-    //
-    //   03 Jan 2004 00:00 GMT
-    apr_time_t jan3 = MICROSECONDS_PER_DAY * 12420;
-    MAKE_LOCALE(localeUS, LOCALE_US);
-    assertFormattedTime( jan3, localeUS,
-             TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")),
-             LOG4CXX_STR("02 Jan 2004 18:00:00,000"));
-  }
-
-
-  /** Convert 30 Jun 2004 00:00:00 GMT for GMT. */
-  void test3()
-  {
-    apr_time_t jun30 = MICROSECONDS_PER_DAY * 12599;
-    MAKE_LOCALE(localeUS, LOCALE_US);
-    assertFormattedTime( jun30, localeUS, TimeZone::getGMT(),
-           LOG4CXX_STR("30 Jun 2004 00:00:00,000"));
-  }
-
-  /** Convert 29 Jun 2004 00:00:00 GMT for Chicago, daylight savings in effect. */
-  void test4()
-  {
-    apr_time_t jul1 = MICROSECONDS_PER_DAY * 12600;
-    MAKE_LOCALE(localeUS, LOCALE_US);
-    assertFormattedTime( jul1, localeUS,
-           TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
-           LOG4CXX_STR("30 Jun 2004 19:00:00,000"));
-  }
-
-  /** Test multiple calls in close intervals. */
-  void test5()
-  {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
-    apr_time_t ticks = MICROSECONDS_PER_DAY * 12601;
-    MAKE_LOCALE(localeUS, LOCALE_US);
-    assertFormattedTime( ticks, localeUS, TimeZone::getGMT(),
-           LOG4CXX_STR("02 Jul 2004 00:00:00,000"));
-    assertFormattedTime( ticks + 8000, localeUS, TimeZone::getGMT(),
-           LOG4CXX_STR("02 Jul 2004 00:00:00,008"));
-    assertFormattedTime( ticks + 17000, localeUS, TimeZone::getGMT(),
-           LOG4CXX_STR("02 Jul 2004 00:00:00,017"));
-    assertFormattedTime( ticks + 237000, localeUS, TimeZone::getGMT(),
-           LOG4CXX_STR("02 Jul 2004 00:00:00,237"));
-    assertFormattedTime( ticks + 1415000, localeUS, TimeZone::getGMT(),
-           LOG4CXX_STR("02 Jul 2004 00:00:01,415"));
-  }
-
-  /** Check that caching does not disregard timezone. This test would fail for revision 1.4 of DateTimeDateFormat.java. */
-  void test6()
-  {
-    apr_time_t jul3 = MICROSECONDS_PER_DAY * 12602;
-    MAKE_LOCALE(localeUS, LOCALE_US);
-    assertFormattedTime( jul3, localeUS, TimeZone::getGMT(),
-        LOG4CXX_STR("03 Jul 2004 00:00:00,000"));
-    assertFormattedTime( jul3, localeUS,
-          TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
-          LOG4CXX_STR("02 Jul 2004 19:00:00,000"));
-    assertFormattedTime( jul3, localeUS, TimeZone::getGMT(),
-          LOG4CXX_STR("03 Jul 2004 00:00:00,000"));
-  }
+	/** Convert 02 Jan 2004 00:00:00 GMT for GMT. */
+	void test1()
+	{
+		//
+		//   02 Jan 2004 00:00 GMT
+		//
+		apr_time_t jan2 = MICROSECONDS_PER_DAY * 12419;
+		MAKE_LOCALE(localeUS, LOCALE_US);
+		assertFormattedTime( jan2, localeUS, TimeZone::getGMT(), LOG4CXX_STR("02 Jan 2004 00:00:00,000"));
+	}
+
+	/** Convert 03 Jan 2004 00:00:00 GMT for America/Chicago. */
+	void test2()
+	{
+		//
+		//   03 Jan 2004 00:00 GMT
+		apr_time_t jan3 = MICROSECONDS_PER_DAY * 12420;
+		MAKE_LOCALE(localeUS, LOCALE_US);
+		assertFormattedTime( jan3, localeUS,
+			TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")),
+			LOG4CXX_STR("02 Jan 2004 18:00:00,000"));
+	}
+
+
+	/** Convert 30 Jun 2004 00:00:00 GMT for GMT. */
+	void test3()
+	{
+		apr_time_t jun30 = MICROSECONDS_PER_DAY * 12599;
+		MAKE_LOCALE(localeUS, LOCALE_US);
+		assertFormattedTime( jun30, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("30 Jun 2004 00:00:00,000"));
+	}
+
+	/** Convert 29 Jun 2004 00:00:00 GMT for Chicago, daylight savings in effect. */
+	void test4()
+	{
+		apr_time_t jul1 = MICROSECONDS_PER_DAY * 12600;
+		MAKE_LOCALE(localeUS, LOCALE_US);
+		assertFormattedTime( jul1, localeUS,
+			TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
+			LOG4CXX_STR("30 Jun 2004 19:00:00,000"));
+	}
+
+	/** Test multiple calls in close intervals. */
+	void test5()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
+		apr_time_t ticks = MICROSECONDS_PER_DAY * 12601;
+		MAKE_LOCALE(localeUS, LOCALE_US);
+		assertFormattedTime( ticks, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("02 Jul 2004 00:00:00,000"));
+		assertFormattedTime( ticks + 8000, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("02 Jul 2004 00:00:00,008"));
+		assertFormattedTime( ticks + 17000, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("02 Jul 2004 00:00:00,017"));
+		assertFormattedTime( ticks + 237000, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("02 Jul 2004 00:00:00,237"));
+		assertFormattedTime( ticks + 1415000, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("02 Jul 2004 00:00:01,415"));
+	}
+
+	/** Check that caching does not disregard timezone. This test would fail for revision 1.4 of DateTimeDateFormat.java. */
+	void test6()
+	{
+		apr_time_t jul3 = MICROSECONDS_PER_DAY * 12602;
+		MAKE_LOCALE(localeUS, LOCALE_US);
+		assertFormattedTime( jul3, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("03 Jul 2004 00:00:00,000"));
+		assertFormattedTime( jul3, localeUS,
+			TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
+			LOG4CXX_STR("02 Jul 2004 19:00:00,000"));
+		assertFormattedTime( jul3, localeUS, TimeZone::getGMT(),
+			LOG4CXX_STR("03 Jul 2004 00:00:00,000"));
+	}
 
 #if LOG4CXX_HAS_STD_LOCALE
-  LogString formatDate(const std::locale& locale, const tm& date, const LogString& fmt) {
-        //
-        //  output the using STL
-        //
-        std::basic_ostringstream<logchar> buffer;
+	LogString formatDate(const std::locale & locale, const tm & date, const LogString & fmt)
+	{
+		//
+		//  output the using STL
+		//
+		std::basic_ostringstream<logchar> buffer;
 #if defined(_MSC_VER) && _MSC_VER < 1300
-         _USEFAC(locale, std::time_put<logchar>)
-             .put(buffer, buffer, &date, fmt.c_str(), fmt.c_str() + fmt.length());
+		_USEFAC(locale, std::time_put<logchar>)
+		.put(buffer, buffer, &date, fmt.c_str(), fmt.c_str() + fmt.length());
 #else
 #if defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE)
-         const std::time_put<logchar>& facet = std::use_facet(locale, (std::time_put<logchar>*) 0);
+		const std::time_put<logchar>& facet = std::use_facet(locale, (std::time_put<logchar>*) 0);
 #else
-         const std::time_put<logchar>& facet = std::use_facet<std::time_put<logchar> >(locale);
+		const std::time_put<logchar>& facet = std::use_facet<std::time_put<logchar> >(locale);
 #endif
-         facet.put(buffer, buffer, buffer.fill(), &date, fmt.c_str(), fmt.c_str() + fmt.length());
+		facet.put(buffer, buffer, buffer.fill(), &date, fmt.c_str(), fmt.c_str() + fmt.length());
 #endif
-        return buffer.str();
-  }
-
-  /** Check that format is locale sensitive. */
-  void test7()
-  {
-    apr_time_t avr11 = MICROSECONDS_PER_DAY * 12519;
-    LocaleChanger localeChange(LOCALE_FR);
-    if (localeChange.isEffective()) {
-        LogString formatted;
-        Pool p;
-        SimpleDateFormat formatter(LOG4CXX_STR("MMM"));
-        formatter.format(formatted, avr11, p);
-
-        std::locale localeFR(LOCALE_FR);
-        struct tm avr11tm = { 0, 0, 0, 11, 03, 104 };
-        LogString expected(formatDate(localeFR, avr11tm, LOG4CXX_STR("%b")));
-
-        LOGUNIT_ASSERT_EQUAL(expected, formatted);
-    }
-  }
-
-  /** Check that format is locale sensitive. */
-  void test8()
-  {
-    apr_time_t apr11 = MICROSECONDS_PER_DAY * 12519;
-    LocaleChanger localeChange(LOCALE_US);
-    if (localeChange.isEffective()) {
-        LogString formatted;
-        Pool p;
-        SimpleDateFormat formatter(LOG4CXX_STR("MMM"));
-        formatter.setTimeZone(TimeZone::getGMT());
-        formatter.format(formatted, apr11, p);
-
-        std::locale localeUS(LOCALE_US);
-        struct tm apr11tm = { 0, 0, 0, 11, 03, 104 };
-        LogString expected(formatDate(localeUS, apr11tm, LOG4CXX_STR("%b")));
-
-        LOGUNIT_ASSERT_EQUAL(expected, formatted);
-    }
-  }
+		return buffer.str();
+	}
+
+	/** Check that format is locale sensitive. */
+	void test7()
+	{
+		apr_time_t avr11 = MICROSECONDS_PER_DAY * 12519;
+		LocaleChanger localeChange(LOCALE_FR);
+
+		if (localeChange.isEffective())
+		{
+			LogString formatted;
+			Pool p;
+			SimpleDateFormat formatter(LOG4CXX_STR("MMM"));
+			formatter.format(formatted, avr11, p);
+
+			std::locale localeFR(LOCALE_FR);
+			struct tm avr11tm = { 0, 0, 0, 11, 03, 104 };
+			LogString expected(formatDate(localeFR, avr11tm, LOG4CXX_STR("%b")));
+
+			LOGUNIT_ASSERT_EQUAL(expected, formatted);
+		}
+	}
+
+	/** Check that format is locale sensitive. */
+	void test8()
+	{
+		apr_time_t apr11 = MICROSECONDS_PER_DAY * 12519;
+		LocaleChanger localeChange(LOCALE_US);
+
+		if (localeChange.isEffective())
+		{
+			LogString formatted;
+			Pool p;
+			SimpleDateFormat formatter(LOG4CXX_STR("MMM"));
+			formatter.setTimeZone(TimeZone::getGMT());
+			formatter.format(formatted, apr11, p);
+
+			std::locale localeUS(LOCALE_US);
+			struct tm apr11tm = { 0, 0, 0, 11, 03, 104 };
+			LogString expected(formatDate(localeUS, apr11tm, LOG4CXX_STR("%b")));
+
+			LOGUNIT_ASSERT_EQUAL(expected, formatted);
+		}
+	}
 #endif
 
 };
diff --git a/src/test/cpp/helpers/filewatchdogtest.cpp b/src/test/cpp/helpers/filewatchdogtest.cpp
index 87a972a..67cae70 100644
--- a/src/test/cpp/helpers/filewatchdogtest.cpp
+++ b/src/test/cpp/helpers/filewatchdogtest.cpp
@@ -27,38 +27,43 @@ using namespace log4cxx::helpers;
  *
  * FileWatchdog tests.
  */
-LOGUNIT_CLASS(FileWatchdogTest) {
-  LOGUNIT_TEST_SUITE(FileWatchdogTest);
-          LOGUNIT_TEST(testShutdownDelay);
-  LOGUNIT_TEST_SUITE_END();
-  
+LOGUNIT_CLASS(FileWatchdogTest)
+{
+	LOGUNIT_TEST_SUITE(FileWatchdogTest);
+	LOGUNIT_TEST(testShutdownDelay);
+	LOGUNIT_TEST_SUITE_END();
+
 private:
-    class MockWatchdog : public FileWatchdog {
-    public:
-        MockWatchdog(const File& file) : FileWatchdog(file) {
-        }
-        
-        void doOnChange() {
-        }
-    };
-    
+	class MockWatchdog : public FileWatchdog
+	{
+		public:
+			MockWatchdog(const File& file) : FileWatchdog(file)
+			{
+			}
+
+			void doOnChange()
+			{
+			}
+	};
+
 public:
-  
-  /**
-   *  Tests that FileWatchdog will respond to a shutdown request more rapidly
-   *     than waiting out its delay. 
-   */
-  void testShutdownDelay() {
-      apr_time_t start = apr_time_now();
-      {
-        MockWatchdog dog(File(LOG4CXX_STR("input/patternlayout1.properties")));
-        dog.start();
-        //   wait 50 ms for thread to get rolling 
-        apr_sleep(50000);
-      }
-      apr_time_t delta = apr_time_now() - start;
-      LOGUNIT_ASSERT(delta < 30000000);
-  }
+
+	/**
+	 *  Tests that FileWatchdog will respond to a shutdown request more rapidly
+	 *     than waiting out its delay.
+	 */
+	void testShutdownDelay()
+	{
+		apr_time_t start = apr_time_now();
+		{
+			MockWatchdog dog(File(LOG4CXX_STR("input/patternlayout1.properties")));
+			dog.start();
+			//   wait 50 ms for thread to get rolling
+			apr_sleep(50000);
+		}
+		apr_time_t delta = apr_time_now() - start;
+		LOGUNIT_ASSERT(delta < 30000000);
+	}
 
 };
 
diff --git a/src/test/cpp/helpers/inetaddresstestcase.cpp b/src/test/cpp/helpers/inetaddresstestcase.cpp
index 9077752..b29ca5c 100644
--- a/src/test/cpp/helpers/inetaddresstestcase.cpp
+++ b/src/test/cpp/helpers/inetaddresstestcase.cpp
@@ -24,60 +24,65 @@ using namespace log4cxx::helpers;
 
 LOGUNIT_CLASS(InetAddressTestCase)
 {
-        LOGUNIT_TEST_SUITE(InetAddressTestCase);
-                LOGUNIT_TEST(testGetLocalHost);
-                LOGUNIT_TEST(testByNameLocal);
-                LOGUNIT_TEST(testAllByNameLocal);
-                LOGUNIT_TEST(testUnreachable);
-        LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(InetAddressTestCase);
+	LOGUNIT_TEST(testGetLocalHost);
+	LOGUNIT_TEST(testByNameLocal);
+	LOGUNIT_TEST(testAllByNameLocal);
+	LOGUNIT_TEST(testUnreachable);
+	LOGUNIT_TEST_SUITE_END();
 
 public:
-        /**
-         * Tests the InetAddress::getLocalHost() method.
-         */
-        void testGetLocalHost() {
-           InetAddressPtr addr = InetAddress::getLocalHost();
-
-           LOGUNIT_ASSERT(addr->getHostAddress() == LOG4CXX_STR("127.0.0.1"));
-           LOGUNIT_ASSERT(!addr->getHostName().empty());
-        }
-
-        /**
-         * Tests the InetAddress::getByName() method with the
-         * "localhost" host name.
-         */
-        void testByNameLocal() {
-           InetAddressPtr addr = InetAddress::getByName(LOG4CXX_STR("localhost"));
-
-           LOGUNIT_ASSERT(addr->getHostAddress() == LOG4CXX_STR("127.0.0.1"));
-           LOGUNIT_ASSERT(!addr->getHostName().empty());
-        }
-
-        /**
-         * Tests the InetAddress::getAllByName() method with the
-         * "localhost" host name.
-         */
-        void testAllByNameLocal() {
-           std::vector<InetAddressPtr> addr = InetAddress::getAllByName(LOG4CXX_STR("localhost"));
-
-           LOGUNIT_ASSERT(addr.size() > 0);
-        }
-
-        /**
-         * Tests the UnknownHostException.
-         */
-        void testUnknownHost() {
-           InetAddressPtr addr = InetAddress::getByName(LOG4CXX_STR("unknown.invalid"));
-        }
-      
-    /**
-    * Tests an (likely) unreachable address.
-    */
-      void testUnreachable()  {
-       InetAddressPtr addr(InetAddress::getByName(LOG4CXX_STR("192.168.10.254")));
-      LogString addrStr(addr->toString());
-      LOGUNIT_ASSERT_EQUAL(addrStr.size() - 15, addrStr.find(LOG4CXX_STR("/192.168.10.254")));
-   }
+	/**
+	 * Tests the InetAddress::getLocalHost() method.
+	 */
+	void testGetLocalHost()
+	{
+		InetAddressPtr addr = InetAddress::getLocalHost();
+
+		LOGUNIT_ASSERT(addr->getHostAddress() == LOG4CXX_STR("127.0.0.1"));
+		LOGUNIT_ASSERT(!addr->getHostName().empty());
+	}
+
+	/**
+	 * Tests the InetAddress::getByName() method with the
+	 * "localhost" host name.
+	 */
+	void testByNameLocal()
+	{
+		InetAddressPtr addr = InetAddress::getByName(LOG4CXX_STR("localhost"));
+
+		LOGUNIT_ASSERT(addr->getHostAddress() == LOG4CXX_STR("127.0.0.1"));
+		LOGUNIT_ASSERT(!addr->getHostName().empty());
+	}
+
+	/**
+	 * Tests the InetAddress::getAllByName() method with the
+	 * "localhost" host name.
+	 */
+	void testAllByNameLocal()
+	{
+		std::vector<InetAddressPtr> addr = InetAddress::getAllByName(LOG4CXX_STR("localhost"));
+
+		LOGUNIT_ASSERT(addr.size() > 0);
+	}
+
+	/**
+	 * Tests the UnknownHostException.
+	 */
+	void testUnknownHost()
+	{
+		InetAddressPtr addr = InetAddress::getByName(LOG4CXX_STR("unknown.invalid"));
+	}
+
+	/**
+	* Tests an (likely) unreachable address.
+	*/
+	void testUnreachable()
+	{
+		InetAddressPtr addr(InetAddress::getByName(LOG4CXX_STR("192.168.10.254")));
+		LogString addrStr(addr->toString());
+		LOGUNIT_ASSERT_EQUAL(addrStr.size() - 15, addrStr.find(LOG4CXX_STR("/192.168.10.254")));
+	}
 
 };
 
diff --git a/src/test/cpp/helpers/iso8601dateformattestcase.cpp b/src/test/cpp/helpers/iso8601dateformattestcase.cpp
index 7aa7247..13e63a6 100644
--- a/src/test/cpp/helpers/iso8601dateformattestcase.cpp
+++ b/src/test/cpp/helpers/iso8601dateformattestcase.cpp
@@ -20,7 +20,7 @@
 #define LOG4CXX_TEST
 #include <log4cxx/private/log4cxx_private.h>
 #if LOG4CXX_HAS_STD_LOCALE
-#include <locale>
+	#include <locale>
 #endif
 #include "../insertwide.h"
 #include <log4cxx/helpers/pool.h>
@@ -33,125 +33,134 @@ using namespace log4cxx::helpers;
 
 /**
    Unit test {@link ISO8601DateFormat}.
-   
-   */
-LOGUNIT_CLASS(ISO8601DateFormatTestCase) {
-     LOGUNIT_TEST_SUITE( ISO8601DateFormatTestCase );
-     LOGUNIT_TEST( test1 );
-     LOGUNIT_TEST( test2 );
-     LOGUNIT_TEST( test3 );
-     LOGUNIT_TEST( test4 );
-     LOGUNIT_TEST( test5 );
-     LOGUNIT_TEST( test6 );
-     LOGUNIT_TEST( test7 );
-     LOGUNIT_TEST_SUITE_END();
-
-  /**
-   * Asserts that formatting the provided date results
-   * in the expected string.
-   *
-   * @param date Date date
-   * @param timeZone TimeZone timezone for conversion
-   * @param expected String expected string
+
    */
-  void assertFormattedTime(log4cxx_time_t date,
-                           const TimeZonePtr& timeZone,
-                           const LogString& expected) {
-    ISO8601DateFormat formatter;
-    formatter.setTimeZone(timeZone);
-    LogString actual;
-    Pool p;
-    formatter.format(actual, date, p);
-    LOGUNIT_ASSERT_EQUAL(expected, actual);
-  }
+LOGUNIT_CLASS(ISO8601DateFormatTestCase)
+{
+	LOGUNIT_TEST_SUITE( ISO8601DateFormatTestCase );
+	LOGUNIT_TEST( test1 );
+	LOGUNIT_TEST( test2 );
+	LOGUNIT_TEST( test3 );
+	LOGUNIT_TEST( test4 );
+	LOGUNIT_TEST( test5 );
+	LOGUNIT_TEST( test6 );
+	LOGUNIT_TEST( test7 );
+	LOGUNIT_TEST_SUITE_END();
+
+	/**
+	 * Asserts that formatting the provided date results
+	 * in the expected string.
+	 *
+	 * @param date Date date
+	 * @param timeZone TimeZone timezone for conversion
+	 * @param expected String expected string
+	 */
+	void assertFormattedTime(log4cxx_time_t date,
+		const TimeZonePtr & timeZone,
+		const LogString & expected)
+	{
+		ISO8601DateFormat formatter;
+		formatter.setTimeZone(timeZone);
+		LogString actual;
+		Pool p;
+		formatter.format(actual, date, p);
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
 
 
 public:
-  /**
-   * Convert 02 Jan 2004 00:00:00 GMT for GMT.
-   */
-  void test1() {
-    log4cxx_time_t jan2 = Date::getMicrosecondsPerDay() * 12419;
-    assertFormattedTime(jan2, TimeZone::getGMT(),
-          LOG4CXX_STR("2004-01-02 00:00:00,000"));
-  }
-
-  /**
-   * Convert 03 Jan 2004 00:00:00 GMT for America/Chicago.
-   */
-  void test2() {
-    //
-    //   03 Jan 2004 00:00 GMT
-    //       (asking for the same time at a different timezone
-    //          will ignore the change of timezone)
-    log4cxx_time_t jan3 = Date::getMicrosecondsPerDay() * 12420;
-    assertFormattedTime(jan3, TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")),
-          LOG4CXX_STR("2004-01-02 18:00:00,000"));
-  }
-
-
-  /**
-   * Convert 30 Jun 2004 00:00:00 GMT for GMT.
-   */
-  void test3() {
-    log4cxx_time_t jun30 = Date::getMicrosecondsPerDay() * 12599;
-    assertFormattedTime(jun30, TimeZone::getGMT(),
-          LOG4CXX_STR("2004-06-30 00:00:00,000"));
-  }
-
-  /**
-   * Convert 1 Jul 2004 00:00:00 GMT for Chicago, daylight savings in effect.
-   */
-  void test4() {
-    log4cxx_time_t jul1 = Date::getMicrosecondsPerDay() * 12600;
-    assertFormattedTime(jul1, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
-           LOG4CXX_STR("2004-06-30 19:00:00,000"));
-  }
-
-  /**
-   * Test multiple calls in close intervals.
-   */
-  void test5() {
-    //   subsequent calls within one minute
-    //     are optimized to reuse previous formatted value
-    //     make a couple of nearly spaced calls
-    log4cxx_time_t ticks =  Date::getMicrosecondsPerDay() * 12601;
-    assertFormattedTime(ticks, TimeZone::getGMT(),
-          LOG4CXX_STR("2004-07-02 00:00:00,000"));
-    assertFormattedTime(ticks + 8000, TimeZone::getGMT(),
-           LOG4CXX_STR("2004-07-02 00:00:00,008"));
-    assertFormattedTime(ticks + 17000, TimeZone::getGMT(),
-           LOG4CXX_STR("2004-07-02 00:00:00,017"));
-    assertFormattedTime(ticks + 237000, TimeZone::getGMT(),
-           LOG4CXX_STR("2004-07-02 00:00:00,237"));
-    assertFormattedTime(ticks + 1415000, TimeZone::getGMT(),
-           LOG4CXX_STR("2004-07-02 00:00:01,415"));
-  }
-
-  /**
-   *  Check that caching does not disregard timezone.
-   * This test would fail for revision 1.4 of DateTimeDateFormat.java.
-   */
-  void test6() {
-    log4cxx_time_t jul3 =  Date::getMicrosecondsPerDay() * 12602;
-    assertFormattedTime(jul3, TimeZone::getGMT(),
-           LOG4CXX_STR("2004-07-03 00:00:00,000"));
-    assertFormattedTime(jul3, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
-           LOG4CXX_STR("2004-07-02 19:00:00,000"));
-    assertFormattedTime(jul3, TimeZone::getGMT(),
-           LOG4CXX_STR("2004-07-03 00:00:00,000"));
-  }
-
-  /**
-   * Checks that numberFormat is implemented.
-   */
-  void test7() {
-    LogString number;
-    ISO8601DateFormat formatter;
-    Pool p;
-    formatter.numberFormat(number, 87, p);
-    LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), number);
-  }
+	/**
+	 * Convert 02 Jan 2004 00:00:00 GMT for GMT.
+	 */
+	void test1()
+	{
+		log4cxx_time_t jan2 = Date::getMicrosecondsPerDay() * 12419;
+		assertFormattedTime(jan2, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-01-02 00:00:00,000"));
+	}
+
+	/**
+	 * Convert 03 Jan 2004 00:00:00 GMT for America/Chicago.
+	 */
+	void test2()
+	{
+		//
+		//   03 Jan 2004 00:00 GMT
+		//       (asking for the same time at a different timezone
+		//          will ignore the change of timezone)
+		log4cxx_time_t jan3 = Date::getMicrosecondsPerDay() * 12420;
+		assertFormattedTime(jan3, TimeZone::getTimeZone(LOG4CXX_STR("GMT-6")),
+			LOG4CXX_STR("2004-01-02 18:00:00,000"));
+	}
+
+
+	/**
+	 * Convert 30 Jun 2004 00:00:00 GMT for GMT.
+	 */
+	void test3()
+	{
+		log4cxx_time_t jun30 = Date::getMicrosecondsPerDay() * 12599;
+		assertFormattedTime(jun30, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-06-30 00:00:00,000"));
+	}
+
+	/**
+	 * Convert 1 Jul 2004 00:00:00 GMT for Chicago, daylight savings in effect.
+	 */
+	void test4()
+	{
+		log4cxx_time_t jul1 = Date::getMicrosecondsPerDay() * 12600;
+		assertFormattedTime(jul1, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
+			LOG4CXX_STR("2004-06-30 19:00:00,000"));
+	}
+
+	/**
+	 * Test multiple calls in close intervals.
+	 */
+	void test5()
+	{
+		//   subsequent calls within one minute
+		//     are optimized to reuse previous formatted value
+		//     make a couple of nearly spaced calls
+		log4cxx_time_t ticks =  Date::getMicrosecondsPerDay() * 12601;
+		assertFormattedTime(ticks, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-07-02 00:00:00,000"));
+		assertFormattedTime(ticks + 8000, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-07-02 00:00:00,008"));
+		assertFormattedTime(ticks + 17000, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-07-02 00:00:00,017"));
+		assertFormattedTime(ticks + 237000, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-07-02 00:00:00,237"));
+		assertFormattedTime(ticks + 1415000, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-07-02 00:00:01,415"));
+	}
+
+	/**
+	 *  Check that caching does not disregard timezone.
+	 * This test would fail for revision 1.4 of DateTimeDateFormat.java.
+	 */
+	void test6()
+	{
+		log4cxx_time_t jul3 =  Date::getMicrosecondsPerDay() * 12602;
+		assertFormattedTime(jul3, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-07-03 00:00:00,000"));
+		assertFormattedTime(jul3, TimeZone::getTimeZone(LOG4CXX_STR("GMT-5")),
+			LOG4CXX_STR("2004-07-02 19:00:00,000"));
+		assertFormattedTime(jul3, TimeZone::getGMT(),
+			LOG4CXX_STR("2004-07-03 00:00:00,000"));
+	}
+
+	/**
+	 * Checks that numberFormat is implemented.
+	 */
+	void test7()
+	{
+		LogString number;
+		ISO8601DateFormat formatter;
+		Pool p;
+		formatter.numberFormat(number, 87, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), number);
+	}
 
 
 
diff --git a/src/test/cpp/helpers/localechanger.cpp b/src/test/cpp/helpers/localechanger.cpp
index 9c9b00b..8dce3c6 100644
--- a/src/test/cpp/helpers/localechanger.cpp
+++ b/src/test/cpp/helpers/localechanger.cpp
@@ -27,24 +27,33 @@ using namespace log4cxx::helpers;
 *   Construction attemtps to change default locale.
 * @param locale locale.
 */
-LocaleChanger::LocaleChanger(const char* locale) {
-    effective = false;
-    try {
-        std::locale newLocale(locale);
-        initial = std::locale::global(newLocale);
-        effective = true;
-    } catch(std::runtime_error&) {
-    } catch(std::exception&) {
-    }
-  }
+LocaleChanger::LocaleChanger(const char* locale)
+{
+	effective = false;
+
+	try
+	{
+		std::locale newLocale(locale);
+		initial = std::locale::global(newLocale);
+		effective = true;
+	}
+	catch (std::runtime_error&)
+	{
+	}
+	catch (std::exception&)
+	{
+	}
+}
 
 /**
 * Restores previous locale.
 */
-LocaleChanger::~LocaleChanger() {
-      if (effective) {
-        std::locale::global(initial);
-      }
-  }
+LocaleChanger::~LocaleChanger()
+{
+	if (effective)
+	{
+		std::locale::global(initial);
+	}
+}
 
 #endif
diff --git a/src/test/cpp/helpers/localechanger.h b/src/test/cpp/helpers/localechanger.h
index ef902b9..b001d11 100644
--- a/src/test/cpp/helpers/localechanger.h
+++ b/src/test/cpp/helpers/localechanger.h
@@ -20,40 +20,46 @@
 
 #include <locale>
 
-namespace log4cxx {
-  namespace helpers {
-    /**
-    *   Utility class to change the locale for the duration of a test.
-    *
-    * 
-    * 
-    *
-    */
-    class LocaleChanger {
-    public:
-    /**
-    *   Construction attemtps to change default locale.
-    * @param locale locale.
-    */
-       LocaleChanger(const char* locale);
+namespace log4cxx
+{
+namespace helpers
+{
+/**
+*   Utility class to change the locale for the duration of a test.
+*
+*
+*
+*
+*/
+class LocaleChanger
+{
+	public:
+		/**
+		*   Construction attemtps to change default locale.
+		* @param locale locale.
+		*/
+		LocaleChanger(const char* locale);
 
-    /**
-    * Restores previous locale.
-    */
-      ~LocaleChanger();
+		/**
+		* Restores previous locale.
+		*/
+		~LocaleChanger();
 
-      /**
-      * Determines whether locale change was effective.
-      * @return true if effective.
-      */
-      inline bool isEffective() { return effective; }
+		/**
+		* Determines whether locale change was effective.
+		* @return true if effective.
+		*/
+		inline bool isEffective()
+		{
+			return effective;
+		}
 
-    private:
-      LocaleChanger(LocaleChanger&);
-      LocaleChanger& operator=(LocaleChanger&);
-      std::locale initial;
-      bool effective;
-    };
-  }
+	private:
+		LocaleChanger(LocaleChanger&);
+		LocaleChanger& operator=(LocaleChanger&);
+		std::locale initial;
+		bool effective;
+};
+}
 }
 #endif
diff --git a/src/test/cpp/helpers/messagebuffertest.cpp b/src/test/cpp/helpers/messagebuffertest.cpp
index ea2ed34..b0dee79 100644
--- a/src/test/cpp/helpers/messagebuffertest.cpp
+++ b/src/test/cpp/helpers/messagebuffertest.cpp
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include <log4cxx/helpers/messagebuffer.h>
 #include <iomanip>
 #include "../insertwide.h"
@@ -22,7 +22,7 @@
 #include <log4cxx/logstring.h>
 
 #if LOG4CXX_CFSTRING_API
-#include <CoreFoundation/CFString.h>
+	#include <CoreFoundation/CFString.h>
 #endif
 
 using namespace log4cxx;
@@ -33,160 +33,176 @@ using namespace log4cxx::helpers;
  */
 LOGUNIT_CLASS(MessageBufferTest)
 {
-   LOGUNIT_TEST_SUITE(MessageBufferTest);
-      LOGUNIT_TEST(testInsertChar);
-      LOGUNIT_TEST(testInsertConstStr);
-      LOGUNIT_TEST(testInsertStr);
-      LOGUNIT_TEST(testInsertString);
-      LOGUNIT_TEST(testInsertNull);
-      LOGUNIT_TEST(testInsertInt);
-      LOGUNIT_TEST(testInsertManipulator);
+	LOGUNIT_TEST_SUITE(MessageBufferTest);
+	LOGUNIT_TEST(testInsertChar);
+	LOGUNIT_TEST(testInsertConstStr);
+	LOGUNIT_TEST(testInsertStr);
+	LOGUNIT_TEST(testInsertString);
+	LOGUNIT_TEST(testInsertNull);
+	LOGUNIT_TEST(testInsertInt);
+	LOGUNIT_TEST(testInsertManipulator);
 #if LOG4CXX_WCHAR_T_API
-      LOGUNIT_TEST(testInsertConstWStr);
-      LOGUNIT_TEST(testInsertWString);
-      LOGUNIT_TEST(testInsertWStr);
+	LOGUNIT_TEST(testInsertConstWStr);
+	LOGUNIT_TEST(testInsertWString);
+	LOGUNIT_TEST(testInsertWStr);
 #endif
 #if LOG4CXX_UNICHAR_API
-      LOGUNIT_TEST(testInsertConstUStr);
-      LOGUNIT_TEST(testInsertUString);
+	LOGUNIT_TEST(testInsertConstUStr);
+	LOGUNIT_TEST(testInsertUString);
 #endif
 #if LOG4CXX_CFSTRING_API
-      LOGUNIT_TEST(testInsertCFString);
+	LOGUNIT_TEST(testInsertCFString);
 #endif
-   LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE_END();
 
 
 public:
-    void testInsertChar() {
-        MessageBuffer buf;
-        std::string greeting("Hello, World");
-        CharMessageBuffer& retval = buf << "Hello, Worl" << 'd';
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-
-    void testInsertConstStr() {
-        MessageBuffer buf;
-        std::string greeting("Hello, World");
-        CharMessageBuffer& retval = buf << "Hello" << ", World";
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-
-    void testInsertStr() {
-        MessageBuffer buf;
-        std::string greeting("Hello, World");
-   char* part1 = (char*) malloc(10*sizeof(wchar_t));
-   strcpy(part1, "Hello");
-   char* part2 = (char*) malloc(10*sizeof(wchar_t));
-   strcpy(part2, ", World");
-        CharMessageBuffer& retval = buf << part1 << part2;
-   free(part1);
-   free(part2);
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-
-    void testInsertString() {
-        MessageBuffer buf;
-        std::string greeting("Hello, World");
-        CharMessageBuffer& retval = buf << std::string("Hello") << std::string(", World");
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-    
-    void testInsertNull() {
-        MessageBuffer buf;
-        std::string greeting("Hello, null");
-        CharMessageBuffer& retval = buf << "Hello, " << (const char*) 0;
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-    
-    void testInsertInt() {
-        MessageBuffer buf;
-        std::string greeting("Hello, 5");
-        std::ostream& retval = buf << "Hello, " << 5;
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
-        LOGUNIT_ASSERT_EQUAL(true, buf.hasStream());
-    }
-        
-    void testInsertManipulator() {
-        MessageBuffer buf;
-        std::string greeting("pi=3.142");
-        std::ostream& retval = buf << "pi=" << std::setprecision(4) << 3.1415926;
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
-        LOGUNIT_ASSERT_EQUAL(true, buf.hasStream());
-    }
+	void testInsertChar()
+	{
+		MessageBuffer buf;
+		std::string greeting("Hello, World");
+		CharMessageBuffer& retval = buf << "Hello, Worl" << 'd';
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertConstStr()
+	{
+		MessageBuffer buf;
+		std::string greeting("Hello, World");
+		CharMessageBuffer& retval = buf << "Hello" << ", World";
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertStr()
+	{
+		MessageBuffer buf;
+		std::string greeting("Hello, World");
+		char* part1 = (char*) malloc(10 * sizeof(wchar_t));
+		strcpy(part1, "Hello");
+		char* part2 = (char*) malloc(10 * sizeof(wchar_t));
+		strcpy(part2, ", World");
+		CharMessageBuffer& retval = buf << part1 << part2;
+		free(part1);
+		free(part2);
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertString()
+	{
+		MessageBuffer buf;
+		std::string greeting("Hello, World");
+		CharMessageBuffer& retval = buf << std::string("Hello") << std::string(", World");
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertNull()
+	{
+		MessageBuffer buf;
+		std::string greeting("Hello, null");
+		CharMessageBuffer& retval = buf << "Hello, " << (const char*) 0;
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertInt()
+	{
+		MessageBuffer buf;
+		std::string greeting("Hello, 5");
+		std::ostream& retval = buf << "Hello, " << 5;
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(true, buf.hasStream());
+	}
+
+	void testInsertManipulator()
+	{
+		MessageBuffer buf;
+		std::string greeting("pi=3.142");
+		std::ostream& retval = buf << "pi=" << std::setprecision(4) << 3.1415926;
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(true, buf.hasStream());
+	}
 
 #if LOG4CXX_WCHAR_T_API
-    void testInsertConstWStr() {
-        MessageBuffer buf;
-        std::wstring greeting(L"Hello, World");
-        WideMessageBuffer& retval = buf << L"Hello" << L", World";
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-
-    void testInsertWString() {
-        MessageBuffer buf;
-        std::wstring greeting(L"Hello, World");
-        WideMessageBuffer& retval = buf << std::wstring(L"Hello") << std::wstring(L", World");
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-
-    void testInsertWStr() {
-        MessageBuffer buf;
-        std::wstring greeting(L"Hello, World");
-       wchar_t* part1 = (wchar_t*) malloc(10*sizeof(wchar_t));
-       wcscpy(part1, L"Hello");
-       wchar_t* part2 = (wchar_t*) malloc(10*sizeof(wchar_t));
-       wcscpy(part2, L", World");
-        WideMessageBuffer& retval = buf << part1 << part2;
-       free(part1);
-       free(part2);
-        LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
+	void testInsertConstWStr()
+	{
+		MessageBuffer buf;
+		std::wstring greeting(L"Hello, World");
+		WideMessageBuffer& retval = buf << L"Hello" << L", World";
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertWString()
+	{
+		MessageBuffer buf;
+		std::wstring greeting(L"Hello, World");
+		WideMessageBuffer& retval = buf << std::wstring(L"Hello") << std::wstring(L", World");
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertWStr()
+	{
+		MessageBuffer buf;
+		std::wstring greeting(L"Hello, World");
+		wchar_t* part1 = (wchar_t*) malloc(10 * sizeof(wchar_t));
+		wcscpy(part1, L"Hello");
+		wchar_t* part2 = (wchar_t*) malloc(10 * sizeof(wchar_t));
+		wcscpy(part2, L", World");
+		WideMessageBuffer& retval = buf << part1 << part2;
+		free(part1);
+		free(part2);
+		LOGUNIT_ASSERT_EQUAL(greeting, buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
 #endif
 
 #if LOG4CXX_UNICHAR_API
-    void testInsertConstUStr() {
-        MessageBuffer buf;
-        const log4cxx::UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
-        const log4cxx::UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
-        const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o', 
-                                  ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
-        UniCharMessageBuffer& retval = buf << hello << world;
-        LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
-
-    void testInsertUString() {
-        MessageBuffer buf;
-        const log4cxx::UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
-        const log4cxx::UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
-        const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o', 
-                                  ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
-        UniCharMessageBuffer& retval = buf << std::basic_string<log4cxx::UniChar>(hello) 
-                                           << std::basic_string<log4cxx::UniChar>(world);
-        LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
+	void testInsertConstUStr()
+	{
+		MessageBuffer buf;
+		const log4cxx::UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
+		const log4cxx::UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
+		const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o',
+				',', ' ', 'W', 'o', 'r', 'l', 'd', 0
+			};
+		UniCharMessageBuffer& retval = buf << hello << world;
+		LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
+
+	void testInsertUString()
+	{
+		MessageBuffer buf;
+		const log4cxx::UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
+		const log4cxx::UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
+		const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o',
+				',', ' ', 'W', 'o', 'r', 'l', 'd', 0
+			};
+		UniCharMessageBuffer& retval = buf << std::basic_string<log4cxx::UniChar>(hello)
+			<< std::basic_string<log4cxx::UniChar>(world);
+		LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
 
 #endif
 
 #if LOG4CXX_CFSTRING_API
-    void testInsertCFString() {
-        MessageBuffer buf;
-        const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o', 
-                                  ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
-        UniCharMessageBuffer& retval = buf << CFSTR("Hello") 
-                                           << CFSTR(", World");
-        LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval)); 
-        LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
-    }
+	void testInsertCFString()
+	{
+		MessageBuffer buf;
+		const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o',
+				',', ' ', 'W', 'o', 'r', 'l', 'd', 0
+			};
+		UniCharMessageBuffer& retval = buf << CFSTR("Hello")
+			<< CFSTR(", World");
+		LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval));
+		LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
+	}
 
 #endif
 
diff --git a/src/test/cpp/helpers/optionconvertertestcase.cpp b/src/test/cpp/helpers/optionconvertertestcase.cpp
index 1cc3a82..d3c128a 100644
--- a/src/test/cpp/helpers/optionconvertertestcase.cpp
+++ b/src/test/cpp/helpers/optionconvertertestcase.cpp
@@ -38,182 +38,197 @@ using namespace log4cxx::spi;
 
 LOGUNIT_CLASS(OptionConverterTestCase)
 {
-   LOGUNIT_TEST_SUITE(OptionConverterTestCase);
-      LOGUNIT_TEST(varSubstTest1);
-      LOGUNIT_TEST(varSubstTest2);
-      LOGUNIT_TEST(varSubstTest3);
-      LOGUNIT_TEST(varSubstTest4);
-      LOGUNIT_TEST(varSubstTest5);
-      LOGUNIT_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
-      LOGUNIT_TEST(testUserHome);
-      LOGUNIT_TEST(testUserName);
+	LOGUNIT_TEST(testUserHome);
+	LOGUNIT_TEST(testUserName);
 #endif
-      LOGUNIT_TEST(testUserDir);
-   LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST(testUserDir);
+	LOGUNIT_TEST_SUITE_END();
 
-   Properties props;
-   Properties nullProperties;
+	Properties props;
+	Properties nullProperties;
 
 public:
-   void setUp()
-   {
-   }
-
-   void tearDown()
-   {
-   }
-
-   /**
-   * Checks that environment variables were properly set
-   * before invoking tests.  ::putenv not reliable.
-   */
-   void envCheck() {
-     Pool p;
-     char* toto;
-     apr_status_t stat = apr_env_get(&toto, "TOTO", 
-         p.getAPRPool());
-     LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-     LOGUNIT_ASSERT_EQUAL("wonderful", toto);
-     char* key1;
-     stat = apr_env_get(&key1, "key1", 
-         p.getAPRPool());
-     LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-     LOGUNIT_ASSERT_EQUAL("value1", key1);
-     char* key2;
-     stat = apr_env_get(&key2, "key2", 
-         p.getAPRPool());
-     LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-     LOGUNIT_ASSERT_EQUAL("value2", key2);
-   }
-
-   void varSubstTest1()
-   {
-      envCheck();
-      LogString r(OptionConverter::substVars(LOG4CXX_STR("hello world."), nullProperties));
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello world."), r);
-
-      r = OptionConverter::substVars(LOG4CXX_STR("hello ${TOTO} world."), nullProperties);
-
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello wonderful world."), r);
-   }
-
-
-   void varSubstTest2()
-   {
-     envCheck();
-      LogString r(OptionConverter::substVars(LOG4CXX_STR("Test2 ${key1} mid ${key2} end."),
-         nullProperties));
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test2 value1 mid value2 end."), r);
-   }
-
-
-   void varSubstTest3()
-   {
-     envCheck();
-      LogString r(OptionConverter::substVars(
-         LOG4CXX_STR("Test3 ${unset} mid ${key1} end."), nullProperties));
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test3  mid value1 end."), r);
-   }
-
-
-   void varSubstTest4()
-   {
-      LogString res;
-      LogString val(LOG4CXX_STR("Test4 ${incomplete "));
-      try
-      {
-         res = OptionConverter::substVars(val, nullProperties);
-      }
-      catch(IllegalArgumentException& e)
-      {
-         std::string witness("\"Test4 ${incomplete \" has no closing brace. Opening brace at position 6.");
-         LOGUNIT_ASSERT_EQUAL(witness, (std::string) e.what());
-      }
-   }
-
-
-   void varSubstTest5()
-   {
-      Properties props1;
-      props1.setProperty(LOG4CXX_STR("p1"), LOG4CXX_STR("x1"));
-      props1.setProperty(LOG4CXX_STR("p2"), LOG4CXX_STR("${p1}"));
-      LogString res = OptionConverter::substVars(LOG4CXX_STR("${p2}"), props1);
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("x1"), res);
-   }
-
-    void testTmpDir()
-    {
-       LogString actual(OptionConverter::substVars(
-          LOG4CXX_STR("${java.io.tmpdir}"), nullProperties));
-       Pool p;
-       const char* tmpdir = NULL;
-       apr_status_t stat = apr_temp_dir_get(&tmpdir, p.getAPRPool());
-       LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
-       LogString expected;
-       Transcoder::decode(tmpdir, expected);
-
-       LOGUNIT_ASSERT_EQUAL(expected, actual);
-    }
+	void setUp()
+	{
+	}
+
+	void tearDown()
+	{
+	}
+
+	/**
+	* Checks that environment variables were properly set
+	* before invoking tests.  ::putenv not reliable.
+	*/
+	void envCheck()
+	{
+		Pool p;
+		char* toto;
+		apr_status_t stat = apr_env_get(&toto, "TOTO",
+				p.getAPRPool());
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL("wonderful", toto);
+		char* key1;
+		stat = apr_env_get(&key1, "key1",
+				p.getAPRPool());
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL("value1", key1);
+		char* key2;
+		stat = apr_env_get(&key2, "key2",
+				p.getAPRPool());
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LOGUNIT_ASSERT_EQUAL("value2", key2);
+	}
+
+	void varSubstTest1()
+	{
+		envCheck();
+		LogString r(OptionConverter::substVars(LOG4CXX_STR("hello world."), nullProperties));
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello world."), r);
+
+		r = OptionConverter::substVars(LOG4CXX_STR("hello ${TOTO} world."), nullProperties);
+
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("hello wonderful world."), r);
+	}
+
+
+	void varSubstTest2()
+	{
+		envCheck();
+		LogString r(OptionConverter::substVars(LOG4CXX_STR("Test2 ${key1} mid ${key2} end."),
+				nullProperties));
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test2 value1 mid value2 end."), r);
+	}
+
+
+	void varSubstTest3()
+	{
+		envCheck();
+		LogString r(OptionConverter::substVars(
+				LOG4CXX_STR("Test3 ${unset} mid ${key1} end."), nullProperties));
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("Test3  mid value1 end."), r);
+	}
+
+
+	void varSubstTest4()
+	{
+		LogString res;
+		LogString val(LOG4CXX_STR("Test4 ${incomplete "));
+
+		try
+		{
+			res = OptionConverter::substVars(val, nullProperties);
+		}
+		catch (IllegalArgumentException& e)
+		{
+			std::string witness("\"Test4 ${incomplete \" has no closing brace. Opening brace at position 6.");
+			LOGUNIT_ASSERT_EQUAL(witness, (std::string) e.what());
+		}
+	}
+
+
+	void varSubstTest5()
+	{
+		Properties props1;
+		props1.setProperty(LOG4CXX_STR("p1"), LOG4CXX_STR("x1"));
+		props1.setProperty(LOG4CXX_STR("p2"), LOG4CXX_STR("${p1}"));
+		LogString res = OptionConverter::substVars(LOG4CXX_STR("${p2}"), props1);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("x1"), res);
+	}
+
+	void testTmpDir()
+	{
+		LogString actual(OptionConverter::substVars(
+				LOG4CXX_STR("${java.io.tmpdir}"), nullProperties));
+		Pool p;
+		const char* tmpdir = NULL;
+		apr_status_t stat = apr_temp_dir_get(&tmpdir, p.getAPRPool());
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		LogString expected;
+		Transcoder::decode(tmpdir, expected);
+
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
 
 #if APR_HAS_USER
-    void testUserHome() {
-      LogString actual(OptionConverter::substVars(
-         LOG4CXX_STR("${user.home}"), nullProperties));
-      Pool p;
-
-      apr_uid_t userid;
-      apr_gid_t groupid;
-      apr_status_t stat = apr_uid_current(&userid, &groupid, p.getAPRPool());
-      if (stat == APR_SUCCESS) {
-         char* username = NULL;
-         stat = apr_uid_name_get(&username, userid, p.getAPRPool());
-         if (stat == APR_SUCCESS) {
-            char* dirname = NULL;
-            stat = apr_uid_homepath_get(&dirname, username, p.getAPRPool());
-            if (stat == APR_SUCCESS) {
-               LogString expected;
-               Transcoder::decode(dirname, expected);
-               LOGUNIT_ASSERT_EQUAL(expected, actual);
-             }
-          }
-      }   
-
-    }
-
-    void testUserName() {
-       LogString actual(OptionConverter::substVars(
-           LOG4CXX_STR("${user.name}"), nullProperties));
-       Pool p;
-       apr_uid_t userid;
-       apr_gid_t groupid;
-       apr_status_t stat = apr_uid_current(&userid, &groupid, p.getAPRPool());
-       if (stat == APR_SUCCESS) {
-           char* username = NULL;
-          stat = apr_uid_name_get(&username, userid, p.getAPRPool());
-          if (stat == APR_SUCCESS) {
-             LogString expected;
-             Transcoder::decode(username, expected);
-             LOGUNIT_ASSERT_EQUAL(expected, actual);
-          }
-       }
-   }
+	void testUserHome()
+	{
+		LogString actual(OptionConverter::substVars(
+				LOG4CXX_STR("${user.home}"), nullProperties));
+		Pool p;
+
+		apr_uid_t userid;
+		apr_gid_t groupid;
+		apr_status_t stat = apr_uid_current(&userid, &groupid, p.getAPRPool());
+
+		if (stat == APR_SUCCESS)
+		{
+			char* username = NULL;
+			stat = apr_uid_name_get(&username, userid, p.getAPRPool());
+
+			if (stat == APR_SUCCESS)
+			{
+				char* dirname = NULL;
+				stat = apr_uid_homepath_get(&dirname, username, p.getAPRPool());
+
+				if (stat == APR_SUCCESS)
+				{
+					LogString expected;
+					Transcoder::decode(dirname, expected);
+					LOGUNIT_ASSERT_EQUAL(expected, actual);
+				}
+			}
+		}
+
+	}
+
+	void testUserName()
+	{
+		LogString actual(OptionConverter::substVars(
+				LOG4CXX_STR("${user.name}"), nullProperties));
+		Pool p;
+		apr_uid_t userid;
+		apr_gid_t groupid;
+		apr_status_t stat = apr_uid_current(&userid, &groupid, p.getAPRPool());
+
+		if (stat == APR_SUCCESS)
+		{
+			char* username = NULL;
+			stat = apr_uid_name_get(&username, userid, p.getAPRPool());
+
+			if (stat == APR_SUCCESS)
+			{
+				LogString expected;
+				Transcoder::decode(username, expected);
+				LOGUNIT_ASSERT_EQUAL(expected, actual);
+			}
+		}
+	}
 #endif
 
-    void testUserDir() {
-      LogString actual(OptionConverter::substVars(
-          LOG4CXX_STR("${user.dir}"), nullProperties));
-      Pool p;
+	void testUserDir()
+	{
+		LogString actual(OptionConverter::substVars(
+				LOG4CXX_STR("${user.dir}"), nullProperties));
+		Pool p;
 
-      char* dirname = NULL;
-      apr_status_t stat = apr_filepath_get(&dirname, APR_FILEPATH_NATIVE, p.getAPRPool());
-      LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
+		char* dirname = NULL;
+		apr_status_t stat = apr_filepath_get(&dirname, APR_FILEPATH_NATIVE, p.getAPRPool());
+		LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
 
-      LogString expected;
-      Transcoder::decode(dirname, expected);
+		LogString expected;
+		Transcoder::decode(dirname, expected);
 
-      LOGUNIT_ASSERT_EQUAL(expected, actual);
-    }
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(OptionConverterTestCase);
diff --git a/src/test/cpp/helpers/propertiestestcase.cpp b/src/test/cpp/helpers/propertiestestcase.cpp
index 07ded38..b97fff3 100644
--- a/src/test/cpp/helpers/propertiestestcase.cpp
+++ b/src/test/cpp/helpers/propertiestestcase.cpp
@@ -26,225 +26,240 @@ using namespace log4cxx::helpers;
 
 LOGUNIT_CLASS(PropertiesTestCase)
 {
-        LOGUNIT_TEST_SUITE(PropertiesTestCase);
-                LOGUNIT_TEST(testLoad1);
-                LOGUNIT_TEST(testTab1);
-                LOGUNIT_TEST(testTab2);
-                LOGUNIT_TEST(testTab3);
-                LOGUNIT_TEST(testTab4);
-                LOGUNIT_TEST(testTab5);
-                LOGUNIT_TEST(testTab6);
-                LOGUNIT_TEST(testTab7);
-                LOGUNIT_TEST(testCRLF1);
-                LOGUNIT_TEST(testEscT1);
-                LOGUNIT_TEST(testEscT2);
-                LOGUNIT_TEST(testEscN1);
-                LOGUNIT_TEST(testEscN2);
-                LOGUNIT_TEST(testEscR1);
-                LOGUNIT_TEST(testEscR2);
-        LOGUNIT_TEST_SUITE_END();
+	LOGUNIT_TEST_SUITE(PropertiesTestCase);
+	LOGUNIT_TEST(testLoad1);
+	LOGUNIT_TEST(testTab1);
+	LOGUNIT_TEST(testTab2);
+	LOGUNIT_TEST(testTab3);
+	LOGUNIT_TEST(testTab4);
+	LOGUNIT_TEST(testTab5);
+	LOGUNIT_TEST(testTab6);
+	LOGUNIT_TEST(testTab7);
+	LOGUNIT_TEST(testCRLF1);
+	LOGUNIT_TEST(testEscT1);
+	LOGUNIT_TEST(testEscT2);
+	LOGUNIT_TEST(testEscN1);
+	LOGUNIT_TEST(testEscN2);
+	LOGUNIT_TEST(testEscR1);
+	LOGUNIT_TEST(testEscR2);
+	LOGUNIT_TEST_SUITE_END();
 
 public:
-        void testLoad1() {
-          //
-          //    read patternLayout1.properties
-          FileInputStreamPtr propFile = 
-            new FileInputStream(LOG4CXX_STR("input/patternLayout1.properties"));
-          Properties properties;
-          properties.load(propFile);
-          LogString pattern(properties.getProperty(LOG4CXX_STR("log4j.appender.testAppender.layout.ConversionPattern")));
-          LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("%-5p - %m%n"), pattern);
-        }
-        
-        /**
-         *  Test tab as separator between key and value, see LOGCXX-291.
-        */
-        void testTab1() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab1")));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab delimited")), actual);
-        }
-
-        /**
-         *  Test tab as whitespace before key, see LOGCXX-291.
-        */
-        void testTab2() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab2")));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab before key")), actual);
-        }
-
-        /**
-         *  Test tab as escaped within key, see LOGCXX-291.
-        */
-        void testTab3() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString key(LOG4CXX_STR("propertiestestcase.tab3"));
-          key.append(1, 0x09);
-          LogString actual(properties.getProperty(key));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains tab")), actual);
-        }
-
-        /**
-         *  Test tab after delimitor, see LOGCXX-291.
-        */
-        void testTab4() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab4")));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab after equals")), actual);
-        }
-
-        /**
-         *  Test tab after continuation in key, see LOGCXX-291.
-        */
-        void testTab5() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab5")));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab after continue")), actual);
-        }
-
-        /**
-         *  Test tab escaped in value, see LOGCXX-291.
-        */
-        void testTab6() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab6")));
-          LogString expected(1, 0x09);
-          expected.append(LOG4CXX_STR(" in value"));
-          LOGUNIT_ASSERT_EQUAL(expected, actual);
-        }
-
-        /**
-         *  Test tab in value continuation, see LOGCXX-291.
-        */
-        void testTab7() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab7")));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("continuedvalue")), actual);
-        }
-
-        /**
-         *  Test tab in value continuation, see LOGCXX-292.
-        */
-        void testCRLF1() {
-          FileInputStreamPtr propFile(
-            new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-          Properties properties;
-          properties.load(propFile);
-          LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.crlf1")));
-          LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("continuedvalue")), actual);
-        }
-
-    /**
-     *  Test tab as escaped within key, see LOGCXX-293.
-    */
-    void testEscT1()  {
-      FileInputStreamPtr propFile(
-        new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-      Properties properties;
-      properties.load(propFile);
-      LogString key(LOG4CXX_STR("propertiestestcase.esct1"));
-      key.append(1, 0x09);
-      LogString actual(properties.getProperty(key));
-      LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains tab")), actual);
-    }
-
-
-
-    /**
-     *  Test tab escaped in value, see LOGCXX-293.
-    */
-    void testEscT2()  {
-      FileInputStreamPtr propFile(
-        new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-      Properties properties;
-      properties.load(propFile);
-      LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.esct2")));
-      LogString expected(1, 0x09);
-      expected.append(LOG4CXX_STR(" in value"));
-      LOGUNIT_ASSERT_EQUAL(expected, actual);
-    }
-
-    /**
-     *  Test \n within key, see LOGCXX-293.
-    */
-    void testEscN1()  {
-      FileInputStreamPtr propFile(
-        new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-      Properties properties;;
-      properties.load(propFile);
-      LogString key(LOG4CXX_STR("propertiestestcase.escn1"));
-      key.append(1, 0x0A);
-      LogString actual(properties.getProperty(key));
-      LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains lf")), actual);
-    }
-
-
-
-    /**
-     *  Test \n in value, see LOGCXX-293.
-    */
-    void testEscN2()  {
-      FileInputStreamPtr propFile(
-        new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-      Properties properties;
-      properties.load(propFile);
-      LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.escn2")));
-      LogString expected(1, 0x0A);
-      expected.append(LOG4CXX_STR(" in value"));
-      LOGUNIT_ASSERT_EQUAL(expected, actual);
-    }
-
-    /**
-     *  Test \r within key, see LOGCXX-293.
-    */
-    void testEscR1()  {
-      FileInputStreamPtr propFile(
-        new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-      Properties properties;
-      properties.load(propFile);
-      LogString key(LOG4CXX_STR("propertiestestcase.escr1"));
-      key.append(1, 0x0D);
-      LogString actual(properties.getProperty(key));
-      LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains cr")), actual);
-    }
-
-
-
-    /**
-     *  Test \r in value, see LOGCXX-293.
-    */
-    void testEscR2()  {
-      FileInputStreamPtr propFile(
-        new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
-      Properties properties;
-      properties.load(propFile);
-      LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.escr2")));
-      LogString expected(1, 0x0D);
-      expected.append(LOG4CXX_STR(" in value"));
-      LOGUNIT_ASSERT_EQUAL(expected, actual);
-    }
+	void testLoad1()
+	{
+		//
+		//    read patternLayout1.properties
+		FileInputStreamPtr propFile =
+			new FileInputStream(LOG4CXX_STR("input/patternLayout1.properties"));
+		Properties properties;
+		properties.load(propFile);
+		LogString pattern(properties.getProperty(LOG4CXX_STR("log4j.appender.testAppender.layout.ConversionPattern")));
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("%-5p - %m%n"), pattern);
+	}
+
+	/**
+	 *  Test tab as separator between key and value, see LOGCXX-291.
+	*/
+	void testTab1()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab1")));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab delimited")), actual);
+	}
+
+	/**
+	 *  Test tab as whitespace before key, see LOGCXX-291.
+	*/
+	void testTab2()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab2")));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab before key")), actual);
+	}
+
+	/**
+	 *  Test tab as escaped within key, see LOGCXX-291.
+	*/
+	void testTab3()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString key(LOG4CXX_STR("propertiestestcase.tab3"));
+		key.append(1, 0x09);
+		LogString actual(properties.getProperty(key));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains tab")), actual);
+	}
+
+	/**
+	 *  Test tab after delimitor, see LOGCXX-291.
+	*/
+	void testTab4()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab4")));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab after equals")), actual);
+	}
+
+	/**
+	 *  Test tab after continuation in key, see LOGCXX-291.
+	*/
+	void testTab5()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab5")));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("tab after continue")), actual);
+	}
+
+	/**
+	 *  Test tab escaped in value, see LOGCXX-291.
+	*/
+	void testTab6()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab6")));
+		LogString expected(1, 0x09);
+		expected.append(LOG4CXX_STR(" in value"));
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
+
+	/**
+	 *  Test tab in value continuation, see LOGCXX-291.
+	*/
+	void testTab7()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.tab7")));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("continuedvalue")), actual);
+	}
+
+	/**
+	 *  Test tab in value continuation, see LOGCXX-292.
+	*/
+	void testCRLF1()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.crlf1")));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("continuedvalue")), actual);
+	}
+
+	/**
+	 *  Test tab as escaped within key, see LOGCXX-293.
+	*/
+	void testEscT1()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString key(LOG4CXX_STR("propertiestestcase.esct1"));
+		key.append(1, 0x09);
+		LogString actual(properties.getProperty(key));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains tab")), actual);
+	}
+
+
+
+	/**
+	 *  Test tab escaped in value, see LOGCXX-293.
+	*/
+	void testEscT2()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.esct2")));
+		LogString expected(1, 0x09);
+		expected.append(LOG4CXX_STR(" in value"));
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
+
+	/**
+	 *  Test \n within key, see LOGCXX-293.
+	*/
+	void testEscN1()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;;
+		properties.load(propFile);
+		LogString key(LOG4CXX_STR("propertiestestcase.escn1"));
+		key.append(1, 0x0A);
+		LogString actual(properties.getProperty(key));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains lf")), actual);
+	}
+
+
+
+	/**
+	 *  Test \n in value, see LOGCXX-293.
+	*/
+	void testEscN2()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.escn2")));
+		LogString expected(1, 0x0A);
+		expected.append(LOG4CXX_STR(" in value"));
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
+
+	/**
+	 *  Test \r within key, see LOGCXX-293.
+	*/
+	void testEscR1()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString key(LOG4CXX_STR("propertiestestcase.escr1"));
+		key.append(1, 0x0D);
+		LogString actual(properties.getProperty(key));
+		LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("key contains cr")), actual);
+	}
+
+
+
+	/**
+	 *  Test \r in value, see LOGCXX-293.
+	*/
+	void testEscR2()
+	{
+		FileInputStreamPtr propFile(
+			new FileInputStream(LOG4CXX_STR("input/propertiestestcase.properties")));
+		Properties properties;
+		properties.load(propFile);
+		LogString actual(properties.getProperty(LOG4CXX_STR("propertiestestcase.escr2")));
+		LogString expected(1, 0x0D);
+		expected.append(LOG4CXX_STR(" in value"));
+		LOGUNIT_ASSERT_EQUAL(expected, actual);
+	}
 
 
 };
diff --git a/src/test/cpp/helpers/relativetimedateformattestcase.cpp b/src/test/cpp/helpers/relativetimedateformattestcase.cpp
index 88d4351..a28ebce 100644
--- a/src/test/cpp/helpers/relativetimedateformattestcase.cpp
+++ b/src/test/cpp/helpers/relativetimedateformattestcase.cpp
@@ -33,60 +33,64 @@ using namespace log4cxx::spi;
 
 /**
    Unit test {@link RelativeTimeDateFormat} class.
-   
+
    */
-LOGUNIT_CLASS(RelativeTimeDateFormatTestCase) {
-     LOGUNIT_TEST_SUITE(RelativeTimeDateFormatTestCase);
-             LOGUNIT_TEST(test1);
-             LOGUNIT_TEST(test2);
-             LOGUNIT_TEST(test3);
-     LOGUNIT_TEST_SUITE_END();
+LOGUNIT_CLASS(RelativeTimeDateFormatTestCase)
+{
+	LOGUNIT_TEST_SUITE(RelativeTimeDateFormatTestCase);
+	LOGUNIT_TEST(test1);
+	LOGUNIT_TEST(test2);
+	LOGUNIT_TEST(test3);
+	LOGUNIT_TEST_SUITE_END();
 
 
-  public:
+public:
 
-  /**
-  *   Convert 2 Jan 2004
-  */
-  void test1() {
-    log4cxx_time_t jan2 = Date::getMicrosecondsPerDay() * 12419;
-    log4cxx_time_t preStartTime = LoggingEvent::getStartTime();
+	/**
+	*   Convert 2 Jan 2004
+	*/
+	void test1()
+	{
+		log4cxx_time_t jan2 = Date::getMicrosecondsPerDay() * 12419;
+		log4cxx_time_t preStartTime = LoggingEvent::getStartTime();
 
-    RelativeTimeDateFormat formatter;
+		RelativeTimeDateFormat formatter;
 
-    Pool p;
+		Pool p;
 
-    LogString actual;
+		LogString actual;
 
-    formatter.format(actual, jan2, p);
+		formatter.format(actual, jan2, p);
 
-    log4cxx_time_t elapsed = log4cxx::helpers::StringHelper::toInt64(actual);
+		log4cxx_time_t elapsed = log4cxx::helpers::StringHelper::toInt64(actual);
 
 
-    LOGUNIT_ASSERT(preStartTime + elapsed*1000 > jan2 - 2000);
-    LOGUNIT_ASSERT(preStartTime + elapsed*1000 < jan2 + 2000);
-  }
+		LOGUNIT_ASSERT(preStartTime + elapsed * 1000 > jan2 - 2000);
+		LOGUNIT_ASSERT(preStartTime + elapsed * 1000 < jan2 + 2000);
+	}
 
 
-    /**
-     * Checks that numberFormat works as expected.
-     */
-    void test2() {
-      LogString numb;
-      Pool p;
-      RelativeTimeDateFormat formatter;
-      formatter.numberFormat(numb, 87, p);
-      LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
-    }
+	/**
+	 * Checks that numberFormat works as expected.
+	 */
+	void test2()
+	{
+		LogString numb;
+		Pool p;
+		RelativeTimeDateFormat formatter;
+		formatter.numberFormat(numb, 87, p);
+		LOGUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("87"), numb);
+	}
 
 
-  /**
-   * Checks that setting timezone doesn't throw an exception.
-   */
-  void test3() {
-    RelativeTimeDateFormat formatter;
-    formatter.setTimeZone(TimeZone::getGMT());
-  }
+	/**
+	 * Checks that setting timezone doesn't throw an exception.
+	 */
+	void test3()
+	{
+		RelativeTimeDateFormat formatter;
+		formatter.setTimeZone(TimeZone::getGMT());
+	}
 
 };
 
diff --git a/src/test/cpp/helpers/stringhelpertestcase.cpp b/src/test/cpp/helpers/stringhelpertestcase.cpp
index 1085265..aba933e 100644
--- a/src/test/cpp/helpers/stringhelpertestcase.cpp
+++ b/src/test/cpp/helpers/stringhelpertestcase.cpp
@@ -26,98 +26,108 @@ using namespace log4cxx::helpers;
 
 /**
    Unit test for StringHelper.
-   
-   
+
+
 */
 LOGUNIT_CLASS(StringHelperTestCase)
-   {
-     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();
+{
+	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:
 
-  /**
-   * Check that startsWith("foobar", "foo") returns true.
-   */
-  void testStartsWith1() {
-    LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foo")));
-  }
-
-  /**
-   * Check that startsWith("bar", "foobar") returns false.
-   */
-  void testStartsWith2() {
-    LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foo"), LOG4CXX_STR("foobar")));
-  }
-
-  /**
-   * Check that startsWith("foobar", "foobar") returns true.
-   */
-  void testStartsWith3() {
-    LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
-  }
-
-  /**
-   * Check that startsWith("foobar", "") returns true.
-   */
-  void testStartsWith4() {
-    LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
-  }
-
-  /**
-   * Check that startsWith("foobar", "abc") returns false.
-   */
-  void testStartsWith5() {
-    LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
-  }
-
-
-
-  /**
-   * Check that endsWith("foobar", "bar") returns true.
-   */
-  void testEndsWith1() {
-    LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("bar")));
-  }
-
-  /**
-   * Check that endsWith("bar", "foobar") returns false.
-   */
-  void testEndsWith2() {
-    LOGUNIT_ASSERT_EQUAL(false, StringHelper::endsWith(LOG4CXX_STR("bar"), LOG4CXX_STR("foobar")));
-  }
-
-  /**
-   * Check that endsWith("foobar", "foobar") returns true.
-   */
-  void testEndsWith3() {
-    LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
-  }
-
-  /**
-   * Check that endsWith("foobar", "") returns true.
-   */
-  void testEndsWith4() {
-    LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
-  }
-
-  /**
-   * Check that endsWith("foobar", "abc") returns false.
-   */
-  void testEndsWith5() {
-    LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
-  }
+	/**
+	 * Check that startsWith("foobar", "foo") returns true.
+	 */
+	void testStartsWith1()
+	{
+		LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foo")));
+	}
+
+	/**
+	 * Check that startsWith("bar", "foobar") returns false.
+	 */
+	void testStartsWith2()
+	{
+		LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foo"), LOG4CXX_STR("foobar")));
+	}
+
+	/**
+	 * Check that startsWith("foobar", "foobar") returns true.
+	 */
+	void testStartsWith3()
+	{
+		LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
+	}
+
+	/**
+	 * Check that startsWith("foobar", "") returns true.
+	 */
+	void testStartsWith4()
+	{
+		LOGUNIT_ASSERT_EQUAL(true, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
+	}
+
+	/**
+	 * Check that startsWith("foobar", "abc") returns false.
+	 */
+	void testStartsWith5()
+	{
+		LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
+	}
+
+
+
+	/**
+	 * Check that endsWith("foobar", "bar") returns true.
+	 */
+	void testEndsWith1()
+	{
+		LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("bar")));
+	}
+
+	/**
+	 * Check that endsWith("bar", "foobar") returns false.
+	 */
+	void testEndsWith2()
+	{
+		LOGUNIT_ASSERT_EQUAL(false, StringHelper::endsWith(LOG4CXX_STR("bar"), LOG4CXX_STR("foobar")));
+	}
+
+	/**
+	 * Check that endsWith("foobar", "foobar") returns true.
+	 */
+	void testEndsWith3()
+	{
+		LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("foobar")));
+	}
+
+	/**
+	 * Check that endsWith("foobar", "") returns true.
+	 */
+	void testEndsWith4()
+	{
+		LOGUNIT_ASSERT_EQUAL(true, StringHelper::endsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("")));
+	}
+
+	/**
+	 * Check that endsWith("foobar", "abc") returns false.
+	 */
+	void testEndsWith5()
+	{
+		LOGUNIT_ASSERT_EQUAL(false, StringHelper::startsWith(LOG4CXX_STR("foobar"), LOG4CXX_STR("abc")));
+	}
 
 
 };
diff --git a/src/test/cpp/helpers/stringtokenizertestcase.cpp b/src/test/cpp/helpers/stringtokenizertestcase.cpp
index 85043e5..b0b9bf4 100644
--- a/src/test/cpp/helpers/stringtokenizertestcase.cpp
+++ b/src/test/cpp/helpers/stringtokenizertestcase.cpp
@@ -25,110 +25,136 @@ using namespace log4cxx::helpers;
 
 LOGUNIT_CLASS(StringTokenizerTestCase)
 {
-   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();
+	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() {
-           LogString src;
-           LogString delim(LOG4CXX_STR(" "));
-           StringTokenizer tokenizer(src, delim);
-           try {
-             LogString token(tokenizer.nextToken());
-           } catch (NoSuchElementException &ex) {
-             return;
-           }
-           LOGUNIT_ASSERT(false);
-        }
-
-        void testHasMoreTokensEmptyString() {
-           LogString src;
-           LogString delim(LOG4CXX_STR(" "));
-           StringTokenizer tokenizer(src, delim);
-           LOGUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
-        }
-
-        void testNextTokenAllDelim() {
-           LogString src(LOG4CXX_STR("==="));
-           LogString delim(LOG4CXX_STR("="));
-           StringTokenizer tokenizer(src, delim);
-           try {
-             LogString token(tokenizer.nextToken());
-           } catch (NoSuchElementException &ex) {
-             return;
-           }
-           LOGUNIT_ASSERT(false);
-        }
-
-        void testHasMoreTokensAllDelim() {
-           LogString src(LOG4CXX_STR("==="));
-           LogString delim(LOG4CXX_STR("="));
-           StringTokenizer tokenizer(src, delim);
-           LOGUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
-        }
-
-        void testBody(const LogString& src, const LogString& delim) {
-           StringTokenizer tokenizer(src, delim);
-           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;
-           }
-           LOGUNIT_ASSERT(false);
-        }
-
-        void test1() {
-          LogString src(LOG4CXX_STR("log4j.properties.txt"));
-          LogString delim(LOG4CXX_STR("."));
-          testBody(src, delim);
-        }
-
-        void test2() {
-          LogString src(LOG4CXX_STR(".log4j.properties.txt"));
-          LogString delim(LOG4CXX_STR("."));
-          testBody(src, delim);
-        }
-
-        void test3() {
-          LogString src(LOG4CXX_STR("log4j.properties.txt."));
-          LogString delim(LOG4CXX_STR("."));
-          testBody(src, delim);
-        }
-
-        void test4() {
-          LogString src(LOG4CXX_STR("log4j..properties....txt"));
-          LogString delim(LOG4CXX_STR("."));
-          testBody(src, delim);
-        }
-
-        void test5() {
-          LogString src(LOG4CXX_STR("log4j properties,txt"));
-          LogString delim(LOG4CXX_STR(" ,"));
-          testBody(src, delim);
-        }
-
-        void test6() {
-           LogString src(LOG4CXX_STR(" log4j properties,txt "));
-           LogString delim(LOG4CXX_STR(" ,"));
-           testBody(src, delim);
-        }
+	void testNextTokenEmptyString()
+	{
+		LogString src;
+		LogString delim(LOG4CXX_STR(" "));
+		StringTokenizer tokenizer(src, delim);
+
+		try
+		{
+			LogString token(tokenizer.nextToken());
+		}
+		catch (NoSuchElementException& ex)
+		{
+			return;
+		}
+
+		LOGUNIT_ASSERT(false);
+	}
+
+	void testHasMoreTokensEmptyString()
+	{
+		LogString src;
+		LogString delim(LOG4CXX_STR(" "));
+		StringTokenizer tokenizer(src, delim);
+		LOGUNIT_ASSERT_EQUAL(false, tokenizer.hasMoreTokens());
+	}
+
+	void testNextTokenAllDelim()
+	{
+		LogString src(LOG4CXX_STR("==="));
+		LogString delim(LOG4CXX_STR("="));
+		StringTokenizer tokenizer(src, delim);
+
+		try
+		{
+			LogString token(tokenizer.nextToken());
+		}
+		catch (NoSuchElementException& ex)
+		{
+			return;
+		}
+
+		LOGUNIT_ASSERT(false);
+	}
+
+	void testHasMoreTokensAllDelim()
+	{
+		LogString src(LOG4CXX_STR("==="));
... 16132 lines suppressed ...