fixed a lot of issues, now successfully runs the test with --enable-pedantic; refs #8

This commit is contained in:
Marc Wäckerlin
2014-03-28 11:50:39 +00:00
parent e846c326f1
commit 190b469d56
33 changed files with 398 additions and 409 deletions

View File

@@ -83,9 +83,9 @@ namespace mrw {
void testcase() {
mrw::StackTrace::createSymtable();
#ifdef _MT
try {mrw::File::remove("mrwautofunctiontracelog4cxx_test-mt.log");}
try {mrw::File::remove("mrwautofunctiontracelog4cxx_test-mt.trace");}
#else
try {mrw::File::remove("mrwautofunctiontracelog4cxx_test.log");}
try {mrw::File::remove("mrwautofunctiontracelog4cxx_test.trace");}
#endif
catch (...) {}
log4cxx::helpers::Properties properties;
@@ -157,7 +157,7 @@ namespace mrw {
std::string(cont.begin(), cont.end())));
properties.setProperty((name="log4j.appender.A1.filename",
std::string(name.begin(), name.end())),
(cont="mrwautofunctiontracelog4cxx_test-mt.log",
(cont="mrwautofunctiontracelog4cxx_test-mt.trace",
std::string(cont.begin(), cont.end())));
#else
properties.setProperty((name="log4j.appender.A1.layout.ConversionPattern",
@@ -166,7 +166,7 @@ namespace mrw {
std::string(cont.begin(), cont.end())));
properties.setProperty((name="log4j.appender.A1.filename",
std::string(name.begin(), name.end())),
(cont="mrwautofunctiontracelog4cxx_test.log",
(cont="mrwautofunctiontracelog4cxx_test.trace",
std::string(cont.begin(), cont.end())));
#endif
log4cxx::PropertyConfigurator::configure(properties);
@@ -203,7 +203,7 @@ namespace mrw {
"mrw\\.fn\\.HalloWelt\\.fn1 \\1 / HalloWelt::fn1\\(\\)\n"
"mrw\\.fn\\.anotherFunction \\1/ anotherFunction\\(\\)\n$");
#ifdef _MT
std::string log(mrw::File::read("mrwautofunctiontracelog4cxx_test-mt.log"));
std::string log(mrw::File::read("mrwautofunctiontracelog4cxx_test-mt.trace"));
typedef std::map<unsigned long, std::string> Logs;
Logs logs;
for (std::string::size_type pos(0), last(0);
@@ -220,15 +220,15 @@ namespace mrw {
"Expectation:\n--------------------\n"
+it->second+"--------------------",
match(it->second));
mrw::File::remove("mrwautofunctiontracelog4cxx_test-mt.log");
mrw::File::remove("mrwautofunctiontracelog4cxx_test-mt.trace");
#else
CPPUNIT_ASSERT_MESSAGE
("The following text does not match the "
"Expectation:\n--------------------\n"
+mrw::File::read("mrwautofunctiontracelog4cxx_test.log")
+mrw::File::read("mrwautofunctiontracelog4cxx_test.trace")
+"--------------------",
match(mrw::File::read("mrwautofunctiontracelog4cxx_test.log")));
mrw::File::remove("mrwautofunctiontracelog4cxx_test.log");
match(mrw::File::read("mrwautofunctiontracelog4cxx_test.trace")));
mrw::File::remove("mrwautofunctiontracelog4cxx_test.trace");
#endif
}
CPPUNIT_TEST_SUITE(AutoFunctionTraceLog4CxxTest);