Fix copyright lines
[folly.git] / folly / io / async / test / HHWheelTimerSlowTests.cpp
index 6e71ed7dcacf7ff0aef4cd2775cdef5519cd5c23..081b8018ccac2be2e767482fcb926043c8717bd7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -56,10 +56,8 @@ class TestTimeout : public HHWheelTimer::Callback {
 
 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);
   }
 };
 
@@ -298,7 +296,7 @@ TEST_F(HHWheelTimerTest, Stress) {
           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));
@@ -309,7 +307,7 @@ TEST_F(HHWheelTimerTest, Stress) {
         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;
         };