Move RequestContext definitions to source files
[folly.git] / folly / futures / test / WindowTest.cpp
index a7e9b82801ab54085dd2942e35cd854d8246c2d3..6eecedc199ef544d90155c475b04f447acb91ecf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 
 #include <boost/thread/barrier.hpp>
 
+#include <folly/Conv.h>
 #include <folly/futures/Future.h>
 
 #include <vector>
@@ -34,7 +35,7 @@ TEST(Window, basic) {
       window(
         input,
         [](int i) { return makeFuture(i); },
-        2),
+        window_size),
       0,
       [](int sum, const Try<int>& b) {
         return sum + *b;
@@ -52,22 +53,20 @@ TEST(Window, basic) {
     fn(input, 4, 6);
   }
   {
-    // empty inpt
+    // empty input
     std::vector<int> input;
     fn(input, 1, 0);
   }
   {
     // int -> Future<Unit>
-    auto res = reduce(
-      window(
-        std::vector<int>({1, 2, 3}),
-        [](int i) { return makeFuture(); },
-        2),
-      0,
-      [](int sum, const Try<Unit>& b) {
-        EXPECT_TRUE(b.hasValue());
-        return sum + 1;
-      }).get();
+    auto res = reduce(window(std::vector<int>({1, 2, 3}),
+                             [](int /* i */) { return makeFuture(); },
+                             2),
+                      0,
+                      [](int sum, const Try<Unit>& b) {
+                        EXPECT_TRUE(b.hasValue());
+                        return sum + 1;
+                      }).get();
     EXPECT_EQ(3, res);
   }
   {