OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "webrtc/system_wrappers/interface/rtp_to_ntp.h" | 12 #include "webrtc/system_wrappers/include/rtp_to_ntp.h" |
13 | 13 |
14 namespace webrtc { | 14 namespace webrtc { |
15 | 15 |
16 TEST(WrapAroundTests, NoWrap) { | 16 TEST(WrapAroundTests, NoWrap) { |
17 EXPECT_EQ(0, CheckForWrapArounds(0xFFFFFFFF, 0xFFFFFFFE)); | 17 EXPECT_EQ(0, CheckForWrapArounds(0xFFFFFFFF, 0xFFFFFFFE)); |
18 EXPECT_EQ(0, CheckForWrapArounds(1, 0)); | 18 EXPECT_EQ(0, CheckForWrapArounds(1, 0)); |
19 EXPECT_EQ(0, CheckForWrapArounds(0x00010000, 0x0000FFFF)); | 19 EXPECT_EQ(0, CheckForWrapArounds(0x00010000, 0x0000FFFF)); |
20 } | 20 } |
21 | 21 |
22 TEST(WrapAroundTests, ForwardWrap) { | 22 TEST(WrapAroundTests, ForwardWrap) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 rtcp.push_front(RtcpMeasurement(ntp_sec, ntp_frac, timestamp)); | 137 rtcp.push_front(RtcpMeasurement(ntp_sec, ntp_frac, timestamp)); |
138 ntp_frac += kOneMsInNtpFrac; | 138 ntp_frac += kOneMsInNtpFrac; |
139 timestamp -= kTimestampTicksPerMs; | 139 timestamp -= kTimestampTicksPerMs; |
140 rtcp.push_front(RtcpMeasurement(ntp_sec, ntp_frac, timestamp)); | 140 rtcp.push_front(RtcpMeasurement(ntp_sec, ntp_frac, timestamp)); |
141 ntp_frac += kOneMsInNtpFrac; | 141 ntp_frac += kOneMsInNtpFrac; |
142 timestamp += 2*kTimestampTicksPerMs; | 142 timestamp += 2*kTimestampTicksPerMs; |
143 int64_t timestamp_in_ms = -1; | 143 int64_t timestamp_in_ms = -1; |
144 EXPECT_FALSE(RtpToNtpMs(timestamp, rtcp, ×tamp_in_ms)); | 144 EXPECT_FALSE(RtpToNtpMs(timestamp, rtcp, ×tamp_in_ms)); |
145 } | 145 } |
146 }; // namespace webrtc | 146 }; // namespace webrtc |
OLD | NEW |