From 5f83cf0c6d842352d8e017321f0223aefebb1bef Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Tue, 8 May 2018 14:52:22 +0200 Subject: Replacing rtc::TimeDelta with webrtc::TimeDelta. This removes the redundant type and replaces all usages. A slight change in behavior is that we no longer get nanosecond resolution. This should not matter since no current code requires nanosecond resolution. Bug: webrtc:9155 Change-Id: I04334e08c686d95731621a6c8a7e40400d0ae3b2 Reviewed-on: https://webrtc-review.googlesource.com/71163 Commit-Queue: Sebastian Jansson Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#23174} --- common_audio/smoothing_filter_unittest.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'common_audio') diff --git a/common_audio/smoothing_filter_unittest.cc b/common_audio/smoothing_filter_unittest.cc index d173c9ab85..abe4272a82 100644 --- a/common_audio/smoothing_filter_unittest.cc +++ b/common_audio/smoothing_filter_unittest.cc @@ -25,7 +25,7 @@ constexpr int64_t kClockInitialTime = 123456; struct SmoothingFilterStates { explicit SmoothingFilterStates(int init_time_ms) : smoothing_filter(init_time_ms) { - fake_clock.AdvanceTime(rtc::TimeDelta::FromMilliseconds(kClockInitialTime)); + fake_clock.AdvanceTime(TimeDelta::ms(kClockInitialTime)); } rtc::ScopedFakeClock fake_clock; SmoothingFilterImpl smoothing_filter; @@ -41,8 +41,7 @@ void CheckOutput(SmoothingFilterStates* states, int advance_time_ms, float expected_ouput) { states->smoothing_filter.AddSample(sample); - states->fake_clock.AdvanceTime( - rtc::TimeDelta::FromMilliseconds(advance_time_ms)); + states->fake_clock.AdvanceTime(TimeDelta::ms(advance_time_ms)); auto output = states->smoothing_filter.GetAverage(); EXPECT_TRUE(output); EXPECT_NEAR(expected_ouput, *output, kMaxAbsError); @@ -141,14 +140,13 @@ TEST(SmoothingFilterTest, CannotChangeTimeConstantDuringInitialization) { states.smoothing_filter.AddSample(0.0); // During initialization, |SetTimeConstantMs| does not take effect. - states.fake_clock.AdvanceTime( - rtc::TimeDelta::FromMilliseconds(kInitTimeMs - 1)); + states.fake_clock.AdvanceTime(TimeDelta::ms(kInitTimeMs - 1)); states.smoothing_filter.AddSample(0.0); EXPECT_FALSE(states.smoothing_filter.SetTimeConstantMs(kInitTimeMs * 2)); EXPECT_NE(exp(-1.0f / (kInitTimeMs * 2)), states.smoothing_filter.alpha()); - states.fake_clock.AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); + states.fake_clock.AdvanceTime(TimeDelta::ms(1)); states.smoothing_filter.AddSample(0.0); // When initialization finishes, the time constant should be come // |kInitTimeConstantMs|. -- cgit v1.2.3