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

Unified Diff: net/quic/core/congestion_control/simulation/simulator_test.cc

Issue 2336913006: Introduce ExpectApproxEq, a helper function that allows making assertions that certain values are e… (Closed)
Patch Set: Fix MSVC warnings 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/net.gypi ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/congestion_control/simulation/simulator_test.cc
diff --git a/net/quic/core/congestion_control/simulation/simulator_test.cc b/net/quic/core/congestion_control/simulation/simulator_test.cc
index a3dc349691c59a46bf52e59a2d19c23be8530989..c952a12342b45b18263089db87729b13ebedc27a 100644
--- a/net/quic/core/congestion_control/simulation/simulator_test.cc
+++ b/net/quic/core/congestion_control/simulation/simulator_test.cc
@@ -8,6 +8,7 @@
#include "net/quic/core/congestion_control/simulation/queue.h"
#include "net/quic/core/congestion_control/simulation/simulator.h"
#include "net/quic/core/congestion_control/simulation/switch.h"
+#include "net/quic/test_tools/quic_test_utils.h"
#include "net/test/gtest_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -208,9 +209,7 @@ TEST(SimulatorTest, DirectLinkSaturation) {
const QuicTime end_time = simulator.GetClock()->Now();
const QuicBandwidth observed_bandwidth = QuicBandwidth::FromBytesAndTimeDelta(
saturator_a.bytes_transmitted(), end_time - start_time);
- EXPECT_NEAR(static_cast<double>(link.bandwidth().ToBitsPerSecond()) /
- observed_bandwidth.ToBitsPerSecond(),
- 1, 0.01);
+ test::ExpectApproxEq(link.bandwidth(), observed_bandwidth, 0.01);
}
// Accepts packets and stores them internally.
« no previous file with comments | « net/net.gypi ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698