Browse Source

[1622] remove log4cplus lock file used in unit tests more explicitly

JINMEI Tatuya 12 years ago
parent
commit
7100794064
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/lib/log/tests/logger_manager_unittest.cc

+ 5 - 1
src/lib/log/tests/logger_manager_unittest.cc

@@ -77,7 +77,11 @@ public:
     // Destructor, remove the file.  This is only a test, so ignore failures
     // Destructor, remove the file.  This is only a test, so ignore failures
     ~SpecificationForFileLogger() {
     ~SpecificationForFileLogger() {
         if (! name_.empty()) {
         if (! name_.empty()) {
-            (void) unlink(name_.c_str());
+            static_cast<void>(unlink(name_.c_str()));
+
+            // Depending on the log4cplus version, a lock file may also be
+            // created.
+            static_cast<void>(unlink((name_ + ".lock").c_str()));
         }
         }
     }
     }