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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_nack_stats_unittest.cc

Issue 2680183004: Remove rtcp_utility as mostly unused. (Closed)
Patch Set: NackStats -> RtcpNackStats Created 3 years, 10 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
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "webrtc/modules/rtp_rtcp/source/rtcp_nack_stats.h"
12 #include "webrtc/test/gtest.h"
13
14 namespace webrtc {
15
16 TEST(RtcpNackStatsTest, Requests) {
17 RtcpNackStats stats;
18 EXPECT_EQ(0U, stats.unique_requests());
19 EXPECT_EQ(0U, stats.requests());
20 stats.ReportRequest(10);
21 EXPECT_EQ(1U, stats.unique_requests());
22 EXPECT_EQ(1U, stats.requests());
23
24 stats.ReportRequest(10);
25 EXPECT_EQ(1U, stats.unique_requests());
26 stats.ReportRequest(11);
27 EXPECT_EQ(2U, stats.unique_requests());
28
29 stats.ReportRequest(11);
30 EXPECT_EQ(2U, stats.unique_requests());
31 stats.ReportRequest(13);
32 EXPECT_EQ(3U, stats.unique_requests());
33
34 stats.ReportRequest(11);
35 EXPECT_EQ(3U, stats.unique_requests());
36 EXPECT_EQ(6U, stats.requests());
37 }
38
39 TEST(RtcpNackStatsTest, RequestsWithWrap) {
40 RtcpNackStats stats;
41 stats.ReportRequest(65534);
42 EXPECT_EQ(1U, stats.unique_requests());
43
44 stats.ReportRequest(65534);
45 EXPECT_EQ(1U, stats.unique_requests());
46 stats.ReportRequest(65535);
47 EXPECT_EQ(2U, stats.unique_requests());
48
49 stats.ReportRequest(65535);
50 EXPECT_EQ(2U, stats.unique_requests());
51 stats.ReportRequest(0);
52 EXPECT_EQ(3U, stats.unique_requests());
53
54 stats.ReportRequest(65535);
55 EXPECT_EQ(3U, stats.unique_requests());
56 stats.ReportRequest(0);
57 EXPECT_EQ(3U, stats.unique_requests());
58 stats.ReportRequest(1);
59 EXPECT_EQ(4U, stats.unique_requests());
60 EXPECT_EQ(8U, stats.requests());
61 }
62
63 } // namespace webrtc
64
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_nack_stats.cc ('k') | webrtc/modules/rtp_rtcp/source/rtcp_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698