carnold 2004/11/14 13:09:27
Modified: . build.xml
tests/src main.cpp
Log:
LOGCXX 11,15,17,40: dateformatting, missing APR init in unit test
Revision Changes Path
1.7 +3 -0 logging-log4cxx/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/logging-log4cxx/build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.xml 13 Nov 2004 23:02:11 -0000 1.6
+++ build.xml 14 Nov 2004 21:09:27 -0000 1.7
@@ -427,8 +427,10 @@
</fileset>
<includepath path="${cppunit.include.dir}"/>
<includepath path="${include.dir}"/>
+ <includepath path="${apr.include.dir}"/>
<defineset define="APR_DECLARE_STATIC"/>
<defineset define="WIN32" if="is-windows"/>
+ <defineset define="APR_DECLARE_STATIC"/>
<libset libs="log4cxx${lib-suffix}" dir="${build.dir}"/>
<libset libs="${apr.lib.name} ${aprutil.lib.name}"
dir="${apr.lib.dir}" if="apr.lib.dir"/>
@@ -441,6 +443,7 @@
<libset libs="stdc++" if="is-gcc"/>
<libset libs="boost_regex-gcc" if="is-gcc"/>
<libset libs="${cppunit.lib.name}" dir="${cppunit.lib.dir}"/>
+ <syslibset libs="Ws2_32 ws2 advapi32" if="is-windows"/>
<project outfile="cbx/log4cxx-testcase3" type="cbuilderx"
if="gen-cbx"/>
<project outfile="msvc/log4cxx-testcase3" type="msvc6" if="gen-dsw"/>
<project outfile="xcode/log4cxx-testcase3" type="xcode"
if="gen-xcode"/>
1.5 +7 -4 logging-log4cxx/tests/src/main.cpp
Index: main.cpp
===================================================================
RCS file: /home/cvs/logging-log4cxx/tests/src/main.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- main.cpp 13 Nov 2004 23:02:14 -0000 1.4
+++ main.cpp 14 Nov 2004 21:09:27 -0000 1.5
@@ -20,14 +20,16 @@
#include <iostream>
#include <log4cxx/logger.h>
+#include <apr-1/apr_general.h>
//
-// initializing a logger will cause APR to be initialized
+// initializing a logger will cause the APR used by log4cxx library to be
initialized
//
log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("log4cxx_unittest"));
-int main( int argc, char **argv)
-{
+int main( int argc, const char * const argv[])
+{
+ apr_app_initialize(&argc, &argv, NULL);
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry ®istry =
@@ -57,6 +59,7 @@
{
bool wasSuccessful = runner.run("", false);
}
-
+
+ apr_terminate();
return wasSuccessful ? EXIT_SUCCESS : EXIT_FAILURE;
}