Parcourir la source

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

JINMEI Tatuya il y a 12 ans
Parent
commit
7100794064
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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
     ~SpecificationForFileLogger() {
         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()));
         }
     }