logging: convert assert() checks to FOLLY_SAFE_DCHECK()
[folly.git] / folly / experimental / logging / test / AsyncFileWriterTest.cpp
index f2a779a7ad4b1c38e1ada4c736e15fae48ed57b5..753b07e7ed9969a5db2296b694d705755f6a5c58 100644 (file)
@@ -29,6 +29,7 @@
 #include <folly/futures/Future.h>
 #include <folly/futures/Promise.h>
 #include <folly/init/Init.h>
+#include <folly/lang/SafeAssert.h>
 #include <folly/portability/GFlags.h>
 #include <folly/portability/GMock.h>
 #include <folly/portability/GTest.h>
@@ -294,7 +295,9 @@ class ReadStats {
   }
   void writerFinished(size_t threadID, size_t messagesWritten, uint32_t flags) {
     auto map = perThreadWriteData_.wlock();
-    assert(map->find(threadID) == map->end());
+    FOLLY_SAFE_CHECK(
+        map->find(threadID) == map->end(),
+        "multiple writer threads with same ID");
     auto& data = (*map)[threadID];
     data.numMessagesWritten = messagesWritten;
     data.flags = flags;