Use newer version of TimeDelta and TimeStamp factories in modules/

This change generated with following commands:
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g"
git cl format

Bug: None
Change-Id: I117d64a54950be040d996035c54bc0043310943a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168340
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30489}
This commit is contained in:
Danil Chapovalov
2020-02-07 14:53:52 +01:00
committed by Commit Bot
parent 2fe31a47b6
commit 5528402ef8
71 changed files with 517 additions and 498 deletions

View File

@ -21,18 +21,18 @@ TEST(TimeUtilTest, TimeMicrosToNtpDoesntChangeBetweenRuns) {
// TimeMicrosToNtp is not pure: it behave differently between different
// execution of the program, but should behave same during same execution.
const int64_t time_us = 12345;
clock.SetTime(Timestamp::us(2));
clock.SetTime(Timestamp::Micros(2));
NtpTime time_ntp = TimeMicrosToNtp(time_us);
clock.SetTime(Timestamp::us(time_us));
clock.SetTime(Timestamp::Micros(time_us));
EXPECT_EQ(TimeMicrosToNtp(time_us), time_ntp);
clock.SetTime(Timestamp::us(1000000));
clock.SetTime(Timestamp::Micros(1000000));
EXPECT_EQ(TimeMicrosToNtp(time_us), time_ntp);
}
TEST(TimeUtilTest, TimeMicrosToNtpKeepsIntervals) {
rtc::ScopedFakeClock clock;
NtpTime time_ntp1 = TimeMicrosToNtp(rtc::TimeMicros());
clock.AdvanceTime(TimeDelta::ms(20));
clock.AdvanceTime(TimeDelta::Millis(20));
NtpTime time_ntp2 = TimeMicrosToNtp(rtc::TimeMicros());
EXPECT_EQ(time_ntp2.ToMs() - time_ntp1.ToMs(), 20);
}