Fix the linking of various tests against GMock
[folly.git] / folly / test / TryTest.cpp
index e1f2c4e9c65b4448a7660e850377446ec50d1af7..c986f40d471cbe74ffd485db74ddc68987de2b19 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.
  * limitations under the License.
  */
 
-#include <gtest/gtest.h>
-
 #include <folly/Memory.h>
 #include <folly/Try.h>
+#include <folly/portability/GTest.h>
 
 using namespace folly;
 
@@ -56,7 +55,7 @@ TEST(Try, moveOnly) {
 
 TEST(Try, makeTryWith) {
   auto func = []() {
-    return folly::make_unique<int>(1);
+    return std::make_unique<int>(1);
   };
 
   auto result = makeTryWith(func);
@@ -65,9 +64,8 @@ TEST(Try, makeTryWith) {
 }
 
 TEST(Try, makeTryWithThrow) {
-  auto func = []() {
+  auto func = []() -> std::unique_ptr<int> {
     throw std::runtime_error("Runtime");
-    return folly::make_unique<int>(1);
   };
 
   auto result = makeTryWith(func);
@@ -86,7 +84,6 @@ TEST(Try, makeTryWithVoid) {
 TEST(Try, makeTryWithVoidThrow) {
   auto func = []() {
     throw std::runtime_error("Runtime");
-    return;
   };
 
   auto result = makeTryWith(func);