aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/transport
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/transport')
-rw-r--r--test/core/transport/BUILD2
-rw-r--r--test/core/transport/bdp_estimator_test.cc20
2 files changed, 6 insertions, 16 deletions
diff --git a/test/core/transport/BUILD b/test/core/transport/BUILD
index 141381b6bd..edd27b8a5f 100644
--- a/test/core/transport/BUILD
+++ b/test/core/transport/BUILD
@@ -72,7 +72,7 @@ grpc_cc_test(
grpc_cc_test(
name = "pid_controller_test",
srcs = ["pid_controller_test.cc"],
- language = "C",
+ language = "C++",
deps = [
"//:gpr",
"//:grpc",
diff --git a/test/core/transport/bdp_estimator_test.cc b/test/core/transport/bdp_estimator_test.cc
index a944762a88..2c4fc4588b 100644
--- a/test/core/transport/bdp_estimator_test.cc
+++ b/test/core/transport/bdp_estimator_test.cc
@@ -51,8 +51,7 @@ TEST(BdpEstimatorTest, NoOp) { BdpEstimator est("test"); }
TEST(BdpEstimatorTest, EstimateBdpNoSamples) {
BdpEstimator est("test");
- int64_t estimate;
- est.EstimateBdp(&estimate);
+ est.EstimateBdp();
}
namespace {
@@ -80,16 +79,14 @@ void AddSample(BdpEstimator *estimator, int64_t sample) {
TEST(BdpEstimatorTest, GetEstimate1Sample) {
BdpEstimator est("test");
AddSample(&est, 100);
- int64_t estimate;
- est.EstimateBdp(&estimate);
+ est.EstimateBdp();
}
TEST(BdpEstimatorTest, GetEstimate2Samples) {
BdpEstimator est("test");
AddSample(&est, 100);
AddSample(&est, 100);
- int64_t estimate;
- est.EstimateBdp(&estimate);
+ est.EstimateBdp();
}
TEST(BdpEstimatorTest, GetEstimate3Samples) {
@@ -97,17 +94,10 @@ TEST(BdpEstimatorTest, GetEstimate3Samples) {
AddSample(&est, 100);
AddSample(&est, 100);
AddSample(&est, 100);
- int64_t estimate;
- est.EstimateBdp(&estimate);
+ est.EstimateBdp();
}
namespace {
-static int64_t GetEstimate(const BdpEstimator &estimator) {
- int64_t out;
- EXPECT_TRUE(estimator.EstimateBdp(&out));
- return out;
-}
-
int64_t NextPow2(int64_t v) {
v--;
v |= v >> 1;
@@ -134,7 +124,7 @@ TEST_P(BdpEstimatorRandomTest, GetEstimateRandomValues) {
if (sample > max) max = sample;
AddSample(&est, sample);
if (i >= 3) {
- EXPECT_LE(GetEstimate(est), GPR_MAX(65536, 2 * NextPow2(max)))
+ EXPECT_LE(est.EstimateBdp(), GPR_MAX(65536, 2 * NextPow2(max)))
<< " min:" << min << " max:" << max << " sample:" << sample;
}
}