rename ExpectedStorage::isThis to isSelfAssign so that the self-assign check in opera...
[folly.git] / folly / test / IndexedMemPoolTest.cpp
index b8e9fce79810ef5031db5402b4427ecc9313b2fa..1cfa69071b71b6d0aaac6f0b7276e28715494ed1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 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/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();
-}