Add deprecation comments to folly::makeFuture.
[folly.git] / folly / test / ConcurrentSkipListTest.cpp
index bfaf7f5b4d4bda23620298b8e707b4a17f03cb1b..c6c0a8acdbe1957b2efc900fa70e2da65b9a6581 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 <atomic>
 #include <memory>
 #include <set>
-#include <vector>
-#include <thread>
 #include <system_error>
+#include <thread>
+#include <vector>
 
 #include <glog/logging.h>
 
-#include <folly/Arena.h>
-#include <folly/Foreach.h>
 #include <folly/Memory.h>
 #include <folly/String.h>
+#include <folly/container/Foreach.h>
+#include <folly/memory/Arena.h>
 #include <folly/portability/GFlags.h>
 #include <folly/portability/GTest.h>
 
@@ -58,12 +58,12 @@ struct ParanoidArenaAlloc {
   ParentAlloc* arena_;
   std::set<void*> allocated_;
 };
-}
+} // namespace
 
 namespace folly {
 template <>
 struct IsArenaAllocator<ParanoidArenaAlloc<SysArena>> : std::true_type {};
-}
+} // namespace folly
 
 namespace {
 
@@ -115,7 +115,9 @@ static void concurrentSkip(const vector<ValueType> *values,
   int64_t sum = 0;
   SkipListAccessor::Skipper skipper(skipList);
   FOR_EACH(it, *values) {
-    if (skipper.to(*it)) sum += *it;
+    if (skipper.to(*it)) {
+      sum += *it;
+    }
   }
   VLOG(20) << "sum = " << sum;
 }
@@ -266,8 +268,12 @@ TEST(ConcurrentSkipList, TestStringType) {
 struct UniquePtrComp {
   bool operator ()(
       const std::unique_ptr<int> &x, const std::unique_ptr<int> &y) const {
-    if (!x) return false;
-    if (!y) return true;
+    if (!x) {
+      return false;
+    }
+    if (!y) {
+      return true;
+    }
     return *x < *y;
   }
 };
@@ -280,7 +286,7 @@ TEST(ConcurrentSkipList, TestMovableData) {
 
   static const int N = 10;
   for (int i = 0; i < N; ++i) {
-    accessor.insert(std::unique_ptr<int>(new int(i)));
+    accessor.insert(std::make_unique<int>(i));
   }
 
   for (int i = 0; i < N; ++i) {
@@ -492,7 +498,7 @@ TEST(ConcurrentSkipList, NonTrivialDeallocationWithSysArena) {
   TestNonTrivialDeallocation(list);
 }
 
-}  // namespace
+} // namespace
 
 int main(int argc, char* argv[]) {
   testing::InitGoogleTest(&argc, argv);