Fix SimpleBarrier
[folly.git] / folly / test / IndexedMemPoolTest.cpp
index 606d9565abbb3ac16f34086c5def6020cf93ddf1..1cfa69071b71b6d0aaac6f0b7276e28715494ed1 100644 (file)
 
 #include <folly/IndexedMemPool.h>
 #include <folly/test/DeterministicSchedule.h>
+#include <folly/portability/GTest.h>
+#include <folly/portability/Unistd.h>
+
 #include <string>
 #include <thread>
-#include <unistd.h>
 #include <semaphore.h>
-#include <gflags/gflags.h>
-#include <gtest/gtest.h>
 
 using namespace folly;
 using namespace folly::test;
@@ -157,7 +157,7 @@ TEST(IndexedMemPool, locate_elem) {
 }
 
 struct NonTrivialStruct {
-  static __thread int count;
+  static FOLLY_TLS int count;
 
   int elem_;
 
@@ -176,7 +176,7 @@ struct NonTrivialStruct {
   }
 };
 
-__thread int NonTrivialStruct::count;
+FOLLY_TLS int NonTrivialStruct::count;
 
 TEST(IndexedMemPool, eager_recycle) {
   typedef IndexedMemPool<NonTrivialStruct> Pool;
@@ -216,9 +216,3 @@ TEST(IndexedMemPool, late_recycle) {
   }
   EXPECT_EQ(NonTrivialStruct::count, 0);
 }
-
-int main(int argc, char** argv) {
-  testing::InitGoogleTest(&argc, argv);
-  gflags::ParseCommandLineFlags(&argc, &argv, true);
-  return RUN_ALL_TESTS();
-}