/*
- * 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.
*/
#include <gtest/gtest.h>
-#include "folly/TimeoutQueue.h"
+#include <folly/TimeoutQueue.h>
using namespace folly;
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));
}
EXPECT_EQ(std::numeric_limits<int64_t>::max(), q.runLoop(0));
EXPECT_EQ(100, count);
}
-