Author: carnold
Date: Wed Feb 13 06:29:34 2008
New Revision: 627425

URL: http://svn.apache.org/viewvc?rev=627425&view=rev
Log:
LOGCXX-225: Fix test suite names on windows

Modified:
    logging/log4cxx/trunk/src/test/cpp/logunit.cpp
    logging/log4cxx/trunk/src/test/cpp/logunit.h

Modified: logging/log4cxx/trunk/src/test/cpp/logunit.cpp
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.cpp?rev=627425&r1=627424&r2=627425&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.cpp Wed Feb 13 06:29:34 2008
@@ -189,13 +189,21 @@
 }
 
 
-LogUnit::TestSuite::TestSuite(const char* fname) : filename(fname), 
disabled(false) {}
+LogUnit::TestSuite::TestSuite(const char* fname) : filename(fname), 
disabled(false) {
+#if defined(_WIN32)
+    for(size_t i = filename.find('\\');
+        i != std::string::npos;
+        i = filename.find('\\', i+1)) {
+        filename.replace(i, 1, 1, '/');
+    }
+#endif
+}
 
 void LogUnit::TestSuite::addTest(const char*, test_func func) {
    test_funcs.push_back(func);
 }
 
-const char* LogUnit::TestSuite::getName() const {
+std::string LogUnit::TestSuite::getName() const {
    return filename;
 }
 
@@ -208,7 +216,7 @@
 }
 
 abts_suite* TestSuite::run(abts_suite* suite) const {
-    suite = abts_add_suite(suite, filename);
+    suite = abts_add_suite(suite, filename.c_str());
     for(TestList::const_iterator iter = test_funcs.begin();
         iter != test_funcs.end();
         iter++) {

Modified: logging/log4cxx/trunk/src/test/cpp/logunit.h
URL: 
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.h?rev=627425&r1=627424&r2=627425&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.h (original)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.h Wed Feb 13 06:29:34 2008
@@ -137,7 +137,7 @@
         TestSuite(const char* filename);
         void addTest(const char* testName, test_func func);
         abts_suite* run(abts_suite* suite) const;
-        const char* getName() const;
+        std::string getName() const;
         void setDisabled(bool newVal);
         bool isDisabled() const;
     private:
@@ -145,7 +145,7 @@
         TestSuite& operator=(const TestSuite&);
         typedef std::vector<test_func> TestList;
         TestList test_funcs;
-        const char* filename;
+        std::string filename;
         bool disabled;
     };
     typedef std::vector< std::pair<std::string, const TestSuite*> > SuiteList;


Reply via email to