fix a multiline comment warning
[folly.git] / folly / test / MoveWrapperTest.cpp
index d427e1f8ea6380e6645666b3bbfe8f617cc8eb4c..305a3774666363b4d025c176c7301055b2343cf8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2013-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.
  * limitations under the License.
  */
 
-#include <gtest/gtest.h>
+#include <folly/MoveWrapper.h>
 
-#include "folly/MoveWrapper.h"
 #include <memory>
 
+#include <folly/portability/GTest.h>
+
 namespace folly {
 
 TEST(makeMoveWrapper, Empty) {
@@ -27,11 +28,26 @@ TEST(makeMoveWrapper, Empty) {
 }
 
 TEST(makeMoveWrapper, NonEmpty) {
-  auto u = std::unique_ptr<int>(new int(5));
+  auto u = std::make_unique<int>(5);
   EXPECT_EQ(*u, 5);
   auto p = makeMoveWrapper(std::move(u));
   EXPECT_TRUE(!u);
   EXPECT_EQ(**p, 5);
 }
 
-} // namespace
+TEST(makeMoveWrapper, rvalue) {
+  std::unique_ptr<int> p;
+  makeMoveWrapper(std::move(p));
+}
+
+TEST(makeMoveWrapper, lvalue) {
+  std::unique_ptr<int> p;
+  makeMoveWrapper(p);
+}
+
+TEST(makeMoveWrapper, lvalue_copyable) {
+  std::shared_ptr<int> p;
+  makeMoveWrapper(p);
+}
+
+} // namespace folly