Adds product operator for TimeDelta and Frequency

Also adding kHz factory function for Frequency class.

Bug: webrtc:9883
Change-Id: Ide44910d50eb9616de2bb0c66b8c62493d2be92e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167725
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30416}
This commit is contained in:
Sebastian Jansson
2020-01-29 10:56:25 +01:00
committed by Commit Bot
parent 184ea66aed
commit 1cf15bfe55
2 changed files with 13 additions and 0 deletions

View File

@ -154,6 +154,7 @@ TEST(FrequencyTest, InfinityOperations) {
TEST(UnitConversionTest, TimeDeltaAndFrequency) {
EXPECT_EQ(1 / Frequency::hertz(50), TimeDelta::ms(20));
EXPECT_EQ(1 / TimeDelta::ms(20), Frequency::hertz(50));
EXPECT_EQ(Frequency::kHz(200) * TimeDelta::ms(2), 400.0);
}
} // namespace test
} // namespace webrtc