Go to the documentation of this file.
23 #include <gtest/gtest.h>
61 TEST(BdpEstimatorTest, EstimateBdpNoSamples) {
73 for (
size_t i = 0;
i <
n;
i++) {
82 void AddSample(BdpEstimator* estimator,
int64_t sample) {
83 AddSamples(estimator, &sample, 1);
87 TEST(BdpEstimatorTest, GetEstimate1Sample) {
93 TEST(BdpEstimatorTest, GetEstimate2Samples) {
100 TEST(BdpEstimatorTest, GetEstimate3Samples) {
102 AddSample(&est, 100);
103 AddSample(&est, 100);
104 AddSample(&est, 100);
126 const int kMaxSample = 65535;
127 int min = kMaxSample;
129 for (
size_t i = 0;
i < GetParam();
i++) {
130 int sample = rand() % (kMaxSample + 1);
131 if (sample <
min)
min = sample;
132 if (sample >
max)
max = sample;
133 AddSample(&est, sample);
136 <<
" min:" <<
min <<
" max:" <<
max <<
" sample:" << sample;
142 ::
testing::Values(3, 4, 6, 9, 13, 19, 28, 42, 63, 94,
143 141, 211, 316, 474, 711));
148 int main(
int argc,
char** argv) {
void grpc_timer_manager_set_threading(bool enabled)
int64_t EstimateBdp() const
gpr_timespec(* gpr_now_impl)(gpr_clock_type clock_type)
#define EXPECT_LE(val1, val2)
GPRAPI void gpr_sleep_until(gpr_timespec until)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
int main(int argc, char **argv)
gpr_clock_type clock_type
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
internal::ValueArray< T... > Values(T... v)
GPRAPI gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
struct gpr_timespec gpr_timespec
grpc_core::ExecCtx exec_ctx
UniquePtr< SSL_SESSION > ret
INSTANTIATE_TEST_SUITE_P(TooManyNames, BdpEstimatorRandomTest, ::testing::Values(3, 4, 6, 9, 13, 19, 28, 42, 63, 94, 141, 211, 316, 474, 711))
GPRAPI gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type clock_type)
TEST(ServiceConfigParserTest, DoubleRegistration)
void AddIncomingBytes(int64_t num_bytes)
TEST_P(BdpEstimatorRandomTest, GetEstimateRandomValues)
GRPCAPI void grpc_init(void)
GRPCAPI void grpc_shutdown(void)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:45