in thread pools, take factory as shared ptr
[folly.git] / folly / test / TimeoutQueueTest.cpp
index 01e63a137f56378698c7f95ea8e79822437adeb0..991505266fc7974df7d86771f00664456c918fab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2014 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
  */
 
 #include <gtest/gtest.h>
-#include "folly/TimeoutQueue.h"
+#include <folly/TimeoutQueue.h>
 
 using namespace folly;
 
@@ -93,8 +93,8 @@ TEST(TimeoutQueue, RunOnceRepeating) {
 TEST(TimeoutQueue, RunOnceReschedule) {
   int count = 0;
   TimeoutQueue q;
-  TimeoutQueue::Callback cb =
-    [&count, &q, &cb](TimeoutQueue::Id id, int64_t now) {
+  TimeoutQueue::Callback cb;
+  cb = [&count, &q, &cb](TimeoutQueue::Id id, int64_t now) {
       if (++count < 100) {
         EXPECT_LT(id, q.add(now, 0, cb));
       }
@@ -110,4 +110,3 @@ TEST(TimeoutQueue, RunOnceReschedule) {
   EXPECT_EQ(std::numeric_limits<int64_t>::max(), q.runLoop(0));
   EXPECT_EQ(100, count);
 }
-