Make folly's T_CHECK_TIMEOUT/T_CHECK_TIME_LT use SKIP() on failure
[folly.git] / folly / test / ApplyTupleTest.cpp
index 51faf457512e920f09283e7c08867a136c571780..971f5b6d8f4ecc2b6199d7579f3ec86696296a95 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2015 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 <iostream>
 
-#include "folly/ApplyTuple.h"
+#include <folly/ApplyTuple.h>
 #include <gtest/gtest.h>
 
-#include <iostream>
 #include <memory>
 
+// this placates visual studio stupidity - see
+// http://stackoverflow.com/questions/5503901
+namespace {}
+
 namespace {
 
 void func(int a, int b, double c) {
@@ -70,7 +73,7 @@ std::function<void (int, int, double)> makeFunc() {
 }
 
 struct GuardObjBase {
-  GuardObjBase(GuardObjBase&&) {}
+  GuardObjBase(GuardObjBase&&) noexcept {}
   GuardObjBase() {}
   GuardObjBase(GuardObjBase const&) = delete;
   GuardObjBase& operator=(GuardObjBase const&) = delete;
@@ -83,7 +86,7 @@ struct GuardObj : GuardObjBase {
     : f_(std::move(f))
     , args_(std::move(args))
   {}
-  GuardObj(GuardObj&& g)
+  GuardObj(GuardObj&& g) noexcept
     : GuardObjBase(std::move(g))
     , f_(std::move(g.f_))
     , args_(std::move(g.args_))
@@ -112,7 +115,7 @@ guard(F&& f, Args&&... args) {
 
 struct Mover {
   Mover() {}
-  Mover(Mover&&) {}
+  Mover(Mover&&) noexcept {}
   Mover(const Mover&) = delete;
   Mover& operator=(const Mover&) = delete;
 };
@@ -160,4 +163,6 @@ TEST(ApplyTuple, Test) {
   Mover m;
   folly::applyTuple(move_only_func,
                     std::forward_as_tuple(std::forward<Mover>(Mover())));
+  const auto tuple3 = std::make_tuple(1, 2, 3.0);
+  folly::applyTuple(func, tuple3);
 }