/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2015-present 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 <mutex>
#include <queue>
-#include <gtest/gtest.h>
-#include <glog/logging.h>
-
#include <folly/futures/Future.h>
#include <folly/futures/Promise.h>
+#include <folly/portability/GTest.h>
using namespace folly;
std::mutex& ps_mutex) {
return [&]() mutable {
auto p = std::make_shared<Promise<Unit>>();
- p->setInterruptHandler([&](exception_wrapper const& e) {
- ++interrupt;
- });
+ p->setInterruptHandler(
+ [&](exception_wrapper const& /* e */) { ++interrupt; });
ps_mutex.lock();
ps.push(p);
ps_mutex.unlock();
bool failure = false;
auto thunk = makeThunk(ps, interrupt, ps_mutex);
- auto f = folly::times(3, thunk)
- .then([&]() mutable { complete = true; })
- .onError([&] (FutureException& e) { failure = true; });
+ auto f = folly::times(3, thunk).then([&]() mutable {
+ complete = true;
+ }).onError([&](FutureException& /* e */) { failure = true; });
popAndFulfillPromise(ps, ps_mutex);
EXPECT_FALSE(complete);
bool failure = false;
auto thunk = makeThunk(ps, interrupt, ps_mutex);
- auto f = folly::times(3, thunk)
- .then([&]() mutable { complete = true; })
- .onError([&] (FutureException& e) { failure = true; });
+ auto f = folly::times(3, thunk).then([&]() mutable {
+ complete = true;
+ }).onError([&](FutureException& /* e */) { failure = true; });
popAndFulfillPromise(ps, ps_mutex);
EXPECT_FALSE(complete);
bool failure = false;
auto thunk = makeThunk(ps, interrupt, ps_mutex);
- auto f = folly::times(3, thunk)
- .then([&]() mutable { complete = true; })
- .onError([&] (FutureException& e) { failure = true; });
+ auto f = folly::times(3, thunk).then([&]() mutable {
+ complete = true;
+ }).onError([&](FutureException& /* e */) { failure = true; });
EXPECT_EQ(0, interrupt);