Properly constrain folly::Function's generic conversion constructor and fix its noexc...
[folly.git] / folly / test / MathTest.cpp
index 166d2a748e3b785b796383614d4fec9c4b5f7239..dba0d35c6ef1375df42f0d4af5a2e480829701db 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.
@@ -22,9 +22,9 @@
 #include <vector>
 
 #include <glog/logging.h>
-#include <gtest/gtest.h>
 
 #include <folly/Portability.h>
+#include <folly/portability/GTest.h>
 
 using namespace folly;
 using namespace folly::detail;
@@ -106,14 +106,14 @@ std::vector<T> cornerValues() {
   std::vector<T> rv;
   for (T i = 1; i < 24; ++i) {
     rv.push_back(i);
-    rv.push_back(std::numeric_limits<T>::max() / i);
-    rv.push_back(std::numeric_limits<T>::max() - i);
-    rv.push_back(std::numeric_limits<T>::max() / 2 - i);
+    rv.push_back(T(std::numeric_limits<T>::max() / i));
+    rv.push_back(T(std::numeric_limits<T>::max() - i));
+    rv.push_back(T(std::numeric_limits<T>::max() / T(2) - i));
     if (std::is_signed<T>::value) {
       rv.push_back(-i);
-      rv.push_back(std::numeric_limits<T>::min() / i);
-      rv.push_back(std::numeric_limits<T>::min() + i);
-      rv.push_back(std::numeric_limits<T>::min() / 2 + i);
+      rv.push_back(T(std::numeric_limits<T>::min() / i));
+      rv.push_back(T(std::numeric_limits<T>::min() + i));
+      rv.push_back(T(std::numeric_limits<T>::min() / T(2) + i));
     }
   }
   return rv;