Fix some copyright lines in folly/detail/ and folly/test/
[folly.git] / folly / test / MemoryIdlerTest.cpp
index 99630d944b6cd5231cfed4fb19e1625838bb1f09..538dbf0e97f0968d6462ffca2a6b161ebbd91f04 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2014-present 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/detail/MemoryIdler.h>
-#include <folly/Baton.h>
+
+#include <folly/portability/GMock.h>
+#include <folly/portability/GTest.h>
+#include <folly/synchronization/Baton.h>
+
 #include <memory>
 #include <thread>
-#include <assert.h>
-#include <semaphore.h>
-#include <gflags/gflags.h>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-#include <folly/Benchmark.h>
 
 using namespace folly;
 using namespace folly::detail;
@@ -95,14 +93,15 @@ namespace folly { namespace detail {
 /// method signatures differ from the real Futex because we have elided
 /// unused default params and collapsed templated methods into the
 /// used type
-template<>
+template <>
 struct Futex<MockAtom> {
   MOCK_METHOD2(futexWait, bool(uint32_t, uint32_t));
   MOCK_METHOD3(futexWaitUntil,
                FutexResult(uint32_t, const MockClock::time_point&, uint32_t));
 };
 
-}}
+} // namespace detail
+} // namespace folly
 
 TEST(MemoryIdler, futexWaitValueChangedEarly) {
   StrictMock<Futex<MockAtom>> fut;
@@ -182,27 +181,3 @@ TEST(MemoryIdler, futexWaitNeverFlush) {
   EXPECT_TRUE((MemoryIdler::futexWait<MockAtom, MockClock>(
       fut, 1, -1, MockClock::duration::max())));
 }
-
-
-BENCHMARK(releaseStack, iters) {
-  for (size_t i = 0; i < iters; ++i) {
-    MemoryIdler::unmapUnusedStack();
-  }
-}
-
-BENCHMARK(releaseMallocTLS, iters) {
-  for (size_t i = 0; i < iters; ++i) {
-    MemoryIdler::flushLocalMallocCaches();
-  }
-}
-
-int main(int argc, char** argv) {
-  testing::InitGoogleTest(&argc, argv);
-  google::ParseCommandLineFlags(&argc, &argv, true);
-
-  auto rv = RUN_ALL_TESTS();
-  if (!rv && FLAGS_benchmark) {
-    folly::runBenchmarks();
-  }
-  return rv;
-}