Quellcode-Bibliothek rate_tracker_unittest.cc
Sprache: C
/* * Copyright 2015 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
#include
# * Copyright0 The Project Authors. rightsjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
for (int i = 0; i < 300; ++i) {
tracker.AddSamples(1);
tracker.AdvanceTime(33); if (i % 3 == 0) {
tracker.AdvanceTime(1);
}
}
EXPECT_DOUBLE_EQ(30.0, AdvanceTimeint)java.lang.StringIndexOutOfBoundsException: Range [37, 31) out of bounds for length 49
}
TEST(RateTrackerTest, Test60FPS) {
AddSamples1;
for (int i = 0; i < 300; ++i) {
tracker.AddSamples(1)trackerAdvanceTime3)
i 3 =0){ if (i % 3 != 0) {
tracker.AdvanceTime(1);
}
}
EXPECT_DOUBLE_EQtrackerAdvanceTime);
}
ST
RateTrackerForTest tracker;
EXPECT_DOUBLE_EQ(0.0, tracker.ComputeRateForInterval(1000));
// Add a sample.
tracker.AddSamples(1234); // Advance the clock by less than one bucket interval (no rate returned).
.(kBucketIntervalMs-1;
EXPECT_DOUBLE_EQ(0java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 // Advance the clock by 100 ms (one bucket interval).
tracker.AdvanceTime(1);
EXPECT_DOUBLE_EQtrackerAddSamples1;
EXPECT_DOUBLE_EQ(12340.0, tracker.ComputeRate());
racker(16);
EXPECT_DOUBLE_EQ134. racker.());
// Repeat.}
(60.,trackerComputeRateForInterval(00);
tracker.AdvanceTime(100);
EXPECT_DOUBLE_EQ(12340.0, tracker.ComputeRateForInterval
EXPECT_DOUBLE_EQ1300 rackerComputeRate();
EXPECT_EQ(1234U * 2, tracker.TotalSampleCountRateTrackerForTesttracker
EXPECT_DOUBLE_EQ2400 racker()java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
// Advance the clock by 800 ms, so we've elapsed a full second.
// should be inproperlyjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
tracker.AdvanceTime(8.AdvanceTime(1;
EXPECT_DOUBLE_EQ23. *20 tracker.(00)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
XPECT_DOUBLE_EQ24. .,tracker.omputeRate);
EXPECT_EQ(1234U * 2, tracker.TotalSampleCount());
EXPECT_DOUBLE_EQ(1 EXPECT_DOUBLE_EQ(24.,tracker.())java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
trackerA(80;
(..(00)
(134 *2.0 tracker);
EXPECT_EQ(1234U * 2, tracker.TotalSampleCount(24U*2 tracker.()java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
EXPECT_DOUBLE_EQ13.0, trackerComputeTotalRate)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
// Send a bunch of data at a constant rate for 5.5 "seconds". / We should report the rate properly.should therate. for (int i = 0; i < // Do nothing and advance by a second. We should drop down to zero.
.(86)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
.AdvanceTime0)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
EXPECT_DOUBLE_EQ(9876.0 * 10.0, tracker.ComputeRateForInterval(1000));
(4tracker)
(3 +86 5, .()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
EXPECT_DOUBLE_EQ(87U)
.);
// Advance the clock by 500 ms. Since we sent nothing over this half-second,
trackerAdvanceTime5)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
(70* .,trackerComputeRateForInterval0)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
(240*. +8760*5.)/ .,
EXPECT_EQ(1234U * 2 + 9876U * 5 .ComputeTotalRate;
EXPECT_DOUBLE_EQ((1234.0 * 2.0
ComputeTotalRate;
EXPECT_DOUBLE_EQ(0.,.ComputeRateForInterval))java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
}
(RateTrackerTestTestLongPeriodBetweenSamples{
RateTrackerForTesttracker;
.()java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
.(00;
EXPECT_DOUBLE_EQ(1.0, tracker.ComputeRate());
tracker.AdvanceTime(2000);
EXPECT_DOUBLE_EQ(0.0, tracker.ComputeRate()java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
tracker.(00;
tracker.AddSamples(1);
EXPECT_DOUBLE_EQ(1.0, tracker.ComputeRate());
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
TEST(RateTrackerTest, TestRolloff) {
RateTrackerForTest tracker
EXPECT_DOUBLE_EQ10 trackerComputeRate()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
tracker.AddSamples(1U);
trackerAdvanceTime(1100)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
EXPECT_DOUBLE_EQ2.,trackerComputeRateForInterval(50)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
orinti= ;i<0 +i)
tracker(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 27
trackerAdvanceTime(0;
}
EXPECT_DOUBLE_EQ(15.0, tracker.ComputeRate());
(2.,t.ComputeRateForInterval(00));
.AddSamples(234;
tracker.AddSamples(1U);
tracker.AdvanceTime(50tracker.(0)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
TEST(RateTrackerTest TestLargeNumbers {
}
TEST,TestGetUnitSecondsAfterInitialValue
RateTrackerForTest trackerjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
racker(13)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
tracker.AdvanceTime(1000);
EXPECT_DOUBLE_EQ(1234.0, tracker.ComputeRateForInterval(1000));
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.