logging: fix unused variable warning in non-debug builds
[folly.git] / folly / test / RWSpinLockTest.cpp
index a6a40415b4c00a3e5fdc777980a7068ef7a1a88d..8c031f17275772f4ab910e0ee8f6f6e9da4aeefa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <folly/RWSpinLock.h>
 
 #include <stdlib.h>
-#include <vector>
 #include <thread>
+#include <vector>
 
 #include <glog/logging.h>
-#include <gtest/gtest.h>
 
 #include <folly/portability/GFlags.h>
+#include <folly/portability/GTest.h>
 #include <folly/portability/Unistd.h>
 
 DEFINE_int32(num_threads, 8, "num threads");
@@ -38,7 +38,7 @@ static const int kMaxReaders = 50;
 static std::atomic<bool> stopThread;
 using namespace folly;
 
-template<typename RWSpinLockT> struct RWSpinLockTest: public testing::Test {
+template <typename RWSpinLockT> struct RWSpinLockTest: public testing::Test {
   typedef RWSpinLockT RWSpinLockType;
 };
 
@@ -53,7 +53,7 @@ typedef testing::Types<RWSpinLock
 
 TYPED_TEST_CASE(RWSpinLockTest, Implementations);
 
-template<typename RWSpinLockType>
+template <typename RWSpinLockType>
 static void run(RWSpinLockType* lock) {
   int64_t reads = 0;
   int64_t writes = 0;
@@ -228,11 +228,13 @@ TEST(RWSpinLock, concurrent_holder_test) {
   sleep(5);
   stop.store(true, std::memory_order_release);
 
-  for (auto& t : threads) t.join();
+  for (auto& t : threads) {
+    t.join();
+  }
 
   LOG(INFO) << "reads: " << reads.load(std::memory_order_acquire)
     << "; writes: " << writes.load(std::memory_order_acquire)
     << "; upgrades: " << upgrades.load(std::memory_order_acquire);
 }
 
-}
+} // namespace