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

Side by Side Diff: webrtc/base/ratetracker_unittest.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/ratetracker.cc ('k') | webrtc/base/rtccertificate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/base/gunit.h" 11 #include "webrtc/base/gunit.h"
12 #include "webrtc/base/ratetracker.h" 12 #include "webrtc/base/ratetracker.h"
13 13
14 namespace rtc { 14 namespace rtc {
15 15
16 class RateTrackerForTest : public RateTracker { 16 class RateTrackerForTest : public RateTracker {
17 public: 17 public:
18 RateTrackerForTest() : RateTracker(100u, 10u), time_(0) {} 18 RateTrackerForTest() : RateTracker(100u, 10u), time_(0) {}
19 virtual uint32 Time() const { return time_; } 19 virtual uint32_t Time() const { return time_; }
20 void AdvanceTime(uint32 delta) { time_ += delta; } 20 void AdvanceTime(uint32_t delta) { time_ += delta; }
21 21
22 private: 22 private:
23 uint32 time_; 23 uint32_t time_;
24 }; 24 };
25 25
26 TEST(RateTrackerTest, Test30FPS) { 26 TEST(RateTrackerTest, Test30FPS) {
27 RateTrackerForTest tracker; 27 RateTrackerForTest tracker;
28 28
29 for (int i = 0; i < 300; ++i) { 29 for (int i = 0; i < 300; ++i) {
30 tracker.AddSamples(1); 30 tracker.AddSamples(1);
31 tracker.AdvanceTime(33); 31 tracker.AdvanceTime(33);
32 if (i % 3 == 0) { 32 if (i % 3 == 0) {
33 tracker.AdvanceTime(1); 33 tracker.AdvanceTime(1);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 154
155 TEST(RateTrackerTest, TestGetUnitSecondsAfterInitialValue) { 155 TEST(RateTrackerTest, TestGetUnitSecondsAfterInitialValue) {
156 RateTrackerForTest tracker; 156 RateTrackerForTest tracker;
157 tracker.AddSamples(1234); 157 tracker.AddSamples(1234);
158 tracker.AdvanceTime(1000); 158 tracker.AdvanceTime(1000);
159 EXPECT_DOUBLE_EQ(1234.0, tracker.ComputeRateForInterval(1000u)); 159 EXPECT_DOUBLE_EQ(1234.0, tracker.ComputeRateForInterval(1000u));
160 } 160 }
161 161
162 } // namespace rtc 162 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/ratetracker.cc ('k') | webrtc/base/rtccertificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698