Synchronized::exchange
[folly.git] / folly / test / SynchronizedTest.cpp
index db0f9c93ce6509a8736008d9008b24263223f9e8..c4735c2e9bbce2f0a0cd3a34409894614cbceb78 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2011-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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 // @author: Andrei Alexandrescu (aalexandre)
 
 // Test bed for folly/Synchronized.h
 
+#include <folly/Synchronized.h>
 #include <folly/LockTraitsBoost.h>
 #include <folly/Portability.h>
-#include <folly/RWSpinLock.h>
 #include <folly/SharedMutex.h>
 #include <folly/SpinLock.h>
-#include <folly/Synchronized.h>
 #include <folly/portability/GTest.h>
+#include <folly/synchronization/RWSpinLock.h>
 #include <folly/test/SynchronizedTestLib.h>
 
 using namespace folly::sync_tests;
@@ -95,6 +94,14 @@ TYPED_TEST(SynchronizedTest, ConstCopy) {
   testConstCopy<TypeParam>();
 }
 
+TYPED_TEST(SynchronizedTest, InPlaceConstruction) {
+  testInPlaceConstruction<TypeParam>();
+}
+
+TYPED_TEST(SynchronizedTest, Exchange) {
+  testExchange<TypeParam>();
+}
+
 template <class Mutex>
 class SynchronizedTimedTest : public testing::Test {};
 
@@ -146,10 +153,6 @@ TYPED_TEST(SynchronizedTimedWithConstTest, TimedSynchronizeWithConst) {
   testTimedSynchronizedWithConst<TypeParam>();
 }
 
-TYPED_TEST(SynchronizedTest, InPlaceConstruction) {
-  testInPlaceConstruction<TypeParam>();
-}
-
 using CountPair = std::pair<int, int>;
 // This class is specialized only to be uesed in SynchronizedLockTest
 class FakeMutex {