Fix failing defaultinittestcase
diff --git a/src/test/cpp/defaultinit/testcase1.cpp b/src/test/cpp/defaultinit/testcase1.cpp
index 9d60bb5..b0059a4 100644
--- a/src/test/cpp/defaultinit/testcase1.cpp
+++ b/src/test/cpp/defaultinit/testcase1.cpp
@@ -48,5 +48,5 @@
};
-LOGUNIT_TEST_SUITE_REGISTRATION_DISABLED(TestCase1)
+LOGUNIT_TEST_SUITE_REGISTRATION(TestCase1)
diff --git a/src/test/cpp/defaultinit/testcase2.cpp b/src/test/cpp/defaultinit/testcase2.cpp
index 13c755d..1c362c2 100644
--- a/src/test/cpp/defaultinit/testcase2.cpp
+++ b/src/test/cpp/defaultinit/testcase2.cpp
@@ -21,6 +21,8 @@
#include <log4cxx/logmanager.h>
#include <log4cxx/logger.h>
+#include <log4cxx/helpers/pool.h>
+#include <apr_file_io.h>
#include "../insertwide.h"
#include "../logunit.h"
@@ -35,17 +37,21 @@
public:
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 xmlTest()
{
LoggerPtr root = Logger::getRootLogger();
- LOG4CXX_DEBUG(root, "Hello, world");
+ LOG4CXX_DEBUG(root, "Hello, world");
bool rootIsConfigured = !root->getAllAppenders().empty();
LOGUNIT_ASSERT(rootIsConfigured);
@@ -56,6 +62,6 @@
};
-LOGUNIT_TEST_SUITE_REGISTRATION_DISABLED(TestCase2)
+LOGUNIT_TEST_SUITE_REGISTRATION(TestCase2)
diff --git a/src/test/cpp/defaultinit/testcase3.cpp b/src/test/cpp/defaultinit/testcase3.cpp
index 37e0761..2b36f28 100644
--- a/src/test/cpp/defaultinit/testcase3.cpp
+++ b/src/test/cpp/defaultinit/testcase3.cpp
@@ -17,6 +17,8 @@
#include <log4cxx/logmanager.h>
#include <log4cxx/logger.h>
+#include <log4cxx/helpers/pool.h>
+#include <apr_file_io.h>
#include "../insertwide.h"
#include "../logunit.h"
@@ -31,10 +33,14 @@
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();
}
@@ -52,4 +58,4 @@
};
-LOGUNIT_TEST_SUITE_REGISTRATION_DISABLED(TestCase3)
+LOGUNIT_TEST_SUITE_REGISTRATION(TestCase3)
diff --git a/src/test/cpp/defaultinit/testcase4.cpp b/src/test/cpp/defaultinit/testcase4.cpp
index 64bc06e..d22806a 100644
--- a/src/test/cpp/defaultinit/testcase4.cpp
+++ b/src/test/cpp/defaultinit/testcase4.cpp
@@ -21,6 +21,8 @@
#include <log4cxx/logmanager.h>
#include <log4cxx/logger.h>
+#include <log4cxx/helpers/pool.h>
+#include <apr_file_io.h>
#include "../insertwide.h"
#include "../logunit.h"
@@ -35,10 +37,14 @@
public:
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();
}
@@ -57,5 +63,5 @@
};
-LOGUNIT_TEST_SUITE_REGISTRATION_DISABLED(TestCase4)
+LOGUNIT_TEST_SUITE_REGISTRATION(TestCase4)