X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2FTimeoutQueueTest.cpp;h=581bf0d747aa4877b5a7b1f35ff2d4b92ce50c9c;hb=321542683a01c3f334047531e9b487f047129775;hp=a07bc22ee5beda9f7606c9d3f4af6c5c261b2859;hpb=ce64f0f685111ac24c7a321ea56d0c3524621df1;p=folly.git diff --git a/folly/test/TimeoutQueueTest.cpp b/folly/test/TimeoutQueueTest.cpp index a07bc22e..581bf0d7 100644 --- a/folly/test/TimeoutQueueTest.cpp +++ b/folly/test/TimeoutQueueTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2014 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. @@ -24,10 +24,8 @@ TEST(TimeoutQueue, Simple) { EventVec events; TimeoutQueue q; - TimeoutQueue::Callback cb = - [&events](TimeoutQueue::Id id, int64_t now) { - events.push_back(id); - }; + TimeoutQueue::Callback cb = [&events]( + TimeoutQueue::Id id, int64_t /* now */) { events.push_back(id); }; EXPECT_EQ(1, q.add(0, 10, cb)); EXPECT_EQ(2, q.add(0, 11, cb)); @@ -51,12 +49,12 @@ TEST(TimeoutQueue, Erase) { TimeoutQueue q; TimeoutQueue::Callback cb = - [&events, &q](TimeoutQueue::Id id, int64_t now) { - events.push_back(id); - if (id == 2) { - q.erase(1); - } - }; + [&events, &q](TimeoutQueue::Id id, int64_t /* now */) { + events.push_back(id); + if (id == 2) { + q.erase(1); + } + }; EXPECT_EQ(1, q.addRepeating(0, 10, cb)); EXPECT_EQ(2, q.add(0, 35, cb)); @@ -74,11 +72,11 @@ TEST(TimeoutQueue, RunOnceRepeating) { int count = 0; TimeoutQueue q; TimeoutQueue::Callback cb = - [&count, &q](TimeoutQueue::Id id, int64_t now) { - if (++count == 100) { - EXPECT_TRUE(q.erase(id)); - } - }; + [&count, &q](TimeoutQueue::Id id, int64_t /* now */) { + if (++count == 100) { + EXPECT_TRUE(q.erase(id)); + } + }; EXPECT_EQ(1, q.addRepeating(0, 0, cb)); @@ -102,7 +100,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 +107,3 @@ TEST(TimeoutQueue, RunOnceReschedule) { EXPECT_EQ(std::numeric_limits::max(), q.runLoop(0)); EXPECT_EQ(100, count); } -