Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: net/quic/core/quic_time_test.cc

Issue 2308043003: Landing Recent QUIC changes until 5:55 PM, Aug 25, 2016 UTC-4 (Closed)
Patch Set: Fixes for various tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_time.h ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_time_test.cc
diff --git a/net/quic/core/quic_time_test.cc b/net/quic/core/quic_time_test.cc
index 49dcc1740eb0410e08aaed43c7851a5c56532a42..5324002e0e123698660d1df8635e698fca10b994 100644
--- a/net/quic/core/quic_time_test.cc
+++ b/net/quic/core/quic_time_test.cc
@@ -59,6 +59,12 @@ TEST(QuicTimeDeltaTest, Multiply) {
QuicTime::Delta::FromMilliseconds(2) * d);
EXPECT_EQ(QuicTime::Delta::FromMicroseconds(4000),
d * QuicTime::Delta::FromMilliseconds(2));
+
+ // Ensure we are rounding correctly within a single-bit level of precision.
+ EXPECT_EQ(QuicTime::Delta::FromMicroseconds(5),
+ QuicTime::Delta::FromMicroseconds(9) * 0.5);
+ EXPECT_EQ(QuicTime::Delta::FromMicroseconds(2),
+ QuicTime::Delta::FromMicroseconds(12) * 0.2);
}
TEST(QuicTimeDeltaTest, Max) {
« no previous file with comments | « net/quic/core/quic_time.h ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698