move InlineExecutor, ManualExecutor, and GlobalThreadPoolList to
[folly.git] / folly / futures / test / ExecutorTest.cpp
index d4b24e0974cf567cb838d9620494ce3efac2232c..1755a2fc9e210fdcb37a50291b33de6b83c6c38a 100644 (file)
  */
 
 #include <folly/Baton.h>
+#include <folly/executors/InlineExecutor.h>
+#include <folly/executors/ManualExecutor.h>
+#include <folly/executors/QueuedImmediateExecutor.h>
 #include <folly/futures/Future.h>
-#include <folly/futures/InlineExecutor.h>
-#include <folly/futures/ManualExecutor.h>
-#include <folly/futures/QueuedImmediateExecutor.h>
 #include <folly/portability/GTest.h>
 
+// TODO(jsedgwick) move this test to executors/test/ once the tested executors
+// have all moved
+
 using namespace folly;
 
 TEST(ManualExecutor, runIsStable) {
@@ -217,24 +220,14 @@ TEST(Executor, Runnable) {
   EXPECT_EQ(counter, 1);
 }
 
-TEST(Executor, RunnablePtr) {
-  InlineExecutor x;
-  struct Runnable {
-    std::function<void()> fn;
-    void operator()() { fn(); }
-  };
-  size_t counter = 0;
-  auto fnp = std::make_shared<Runnable>();
-  fnp->fn = [&]{ counter++; };
-  x.addPtr(fnp);
-  EXPECT_EQ(counter, 1);
-}
-
 TEST(Executor, ThrowableThen) {
   InlineExecutor x;
+  auto f = Future<Unit>().then([]() { throw std::runtime_error("Faildog"); });
+
+  /*
   auto f = Future<Unit>().via(&x).then([](){
     throw std::runtime_error("Faildog");
-  });
+  });*/
   EXPECT_THROW(f.value(), std::exception);
 }