Make folly's T_CHECK_TIMEOUT/T_CHECK_TIME_LT use SKIP() on failure
[folly.git] / folly / test / TimeoutQueueTest.cpp
index 01e63a137f56378698c7f95ea8e79822437adeb0..07c08105e0438fe4ace9a65b3d8675d67f2508d4 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.
@@ -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));
       }
@@ -102,7 +102,6 @@ TEST(TimeoutQueue, RunOnceReschedule) {
 
   EXPECT_EQ(1, q.add(0, 0, cb));
 
-  int64_t now = 0;
   EXPECT_EQ(0, q.runOnce(0));
   EXPECT_EQ(1, count);
   EXPECT_EQ(0, q.runOnce(0));
@@ -110,4 +109,3 @@ TEST(TimeoutQueue, RunOnceReschedule) {
   EXPECT_EQ(std::numeric_limits<int64_t>::max(), q.runLoop(0));
   EXPECT_EQ(100, count);
 }
-