OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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/modules/rtp_rtcp/source/rtcp_packet/report_block.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/report_block.h" |
12 | 12 |
13 #include <limits> | 13 #include <limits> |
14 | 14 |
| 15 #include "webrtc/base/random.h" |
15 #include "webrtc/test/gtest.h" | 16 #include "webrtc/test/gtest.h" |
16 #include "webrtc/base/random.h" | |
17 | 17 |
18 using webrtc::rtcp::ReportBlock; | 18 using webrtc::rtcp::ReportBlock; |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 namespace { | 21 namespace { |
22 | 22 |
23 const uint32_t kRemoteSsrc = 0x23456789; | 23 const uint32_t kRemoteSsrc = 0x23456789; |
24 const uint8_t kFractionLost = 55; | 24 const uint8_t kFractionLost = 55; |
25 // Use values that are streamed differently LE and BE. | 25 // Use values that are streamed differently LE and BE. |
26 const uint32_t kCumulativeLost = 0x111213; | 26 const uint32_t kCumulativeLost = 0x111213; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 TEST(RtcpPacketReportBlockTest, ValidateCumulativeLost) { | 78 TEST(RtcpPacketReportBlockTest, ValidateCumulativeLost) { |
79 const uint32_t kMaxCumulativeLost = 0xffffff; | 79 const uint32_t kMaxCumulativeLost = 0xffffff; |
80 ReportBlock rb; | 80 ReportBlock rb; |
81 EXPECT_FALSE(rb.SetCumulativeLost(kMaxCumulativeLost + 1)); | 81 EXPECT_FALSE(rb.SetCumulativeLost(kMaxCumulativeLost + 1)); |
82 EXPECT_TRUE(rb.SetCumulativeLost(kMaxCumulativeLost)); | 82 EXPECT_TRUE(rb.SetCumulativeLost(kMaxCumulativeLost)); |
83 } | 83 } |
84 | 84 |
85 } // namespace | 85 } // namespace |
86 } // namespace webrtc | 86 } // namespace webrtc |
OLD | NEW |