/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2016-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.
class TestTimeoutDelayed : public TestTimeout {
protected:
- std::chrono::milliseconds getCurTime() override {
- return std::chrono::duration_cast<std::chrono::milliseconds>(
- std::chrono::steady_clock::now().time_since_epoch()) -
- milliseconds(5);
+ std::chrono::steady_clock::time_point getCurTime() override {
+ return std::chrono::steady_clock::now() - milliseconds(5);
}
};
timeout - 256);
timeouts[i].fn = [&, i, timeout]() {
LOG(INFO) << "FAIL:timer " << i << " still fired in " << timeout;
- EXPECT_FALSE(true);
+ ADD_FAILURE();
};
} else {
t.scheduleTimeout(&timeouts[i], std::chrono::milliseconds(timeout));
runtimeouts++;
/* sleep override */ usleep(1000);
LOG(INFO) << "Ran " << runtimeouts << " timeouts of " << timeoutcount;
- timeouts[i].fn = [&, i]() {
+ timeouts[i].fn = [&]() {
runtimeouts++;
LOG(INFO) << "Ran " << runtimeouts << " timeouts of " << timeoutcount;
};