1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-10 21:22:20 +03:00

Replace std::chrono::duration_cast<milliseconds> with folly::chrono::ceil in

Summary:
duration_cast round towards zero. The diff uses folly::chrono::ceil
rather than std::chrono::ceil since we still need to compile with c++14

Differential Revision: D22870632

fbshipit-source-id: 18439488e879164807b1676a0105073348800412
This commit is contained in:
Yang Chi
2020-07-31 23:03:37 -07:00
committed by Facebook GitHub Bot
parent 9151f3dc92
commit 93c94e0ea5
4 changed files with 15 additions and 14 deletions

View File

@@ -1014,8 +1014,7 @@ TEST_F(QuicLossFunctionsTest, LossTimePreemptsCryptoTimer) {
MockClock::mockNow = [=]() { return sendTime; };
auto alarm = calculateAlarmDuration<MockClock>(*conn);
EXPECT_EQ(
std::chrono::duration_cast<std::chrono::milliseconds>(
expectedDelayUntilLost),
folly::chrono::ceil<std::chrono::milliseconds>(expectedDelayUntilLost),
alarm.first);
EXPECT_EQ(LossState::AlarmMethod::EarlyRetransmitOrReordering, alarm.second);
// Manual set lossState. Calling setLossDetectionAlarm requries a Timeout