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 |
(...skipping 22 matching lines...) Expand all Loading... |
33 Pli mutable_parsed; | 33 Pli mutable_parsed; |
34 EXPECT_TRUE(test::ParseSinglePacket(kPacket, &mutable_parsed)); | 34 EXPECT_TRUE(test::ParseSinglePacket(kPacket, &mutable_parsed)); |
35 const Pli& parsed = mutable_parsed; // Read values from constant object. | 35 const Pli& parsed = mutable_parsed; // Read values from constant object. |
36 | 36 |
37 EXPECT_EQ(kSenderSsrc, parsed.sender_ssrc()); | 37 EXPECT_EQ(kSenderSsrc, parsed.sender_ssrc()); |
38 EXPECT_EQ(kRemoteSsrc, parsed.media_ssrc()); | 38 EXPECT_EQ(kRemoteSsrc, parsed.media_ssrc()); |
39 } | 39 } |
40 | 40 |
41 TEST(RtcpPacketPliTest, Create) { | 41 TEST(RtcpPacketPliTest, Create) { |
42 Pli pli; | 42 Pli pli; |
43 pli.From(kSenderSsrc); | 43 pli.SetSenderSsrc(kSenderSsrc); |
44 pli.To(kRemoteSsrc); | 44 pli.SetMediaSsrc(kRemoteSsrc); |
45 | 45 |
46 rtc::Buffer packet = pli.Build(); | 46 rtc::Buffer packet = pli.Build(); |
47 | 47 |
48 EXPECT_THAT(make_tuple(packet.data(), packet.size()), | 48 EXPECT_THAT(make_tuple(packet.data(), packet.size()), |
49 ElementsAreArray(kPacket)); | 49 ElementsAreArray(kPacket)); |
50 } | 50 } |
51 | 51 |
52 TEST(RtcpPacketPliTest, ParseFailsOnTooSmallPacket) { | 52 TEST(RtcpPacketPliTest, ParseFailsOnTooSmallPacket) { |
53 const uint8_t kTooSmallPacket[] = {0x81, 206, 0x00, 0x01, | 53 const uint8_t kTooSmallPacket[] = {0x81, 206, 0x00, 0x01, |
54 0x12, 0x34, 0x56, 0x78}; | 54 0x12, 0x34, 0x56, 0x78}; |
55 | 55 |
56 Pli parsed; | 56 Pli parsed; |
57 EXPECT_FALSE(test::ParseSinglePacket(kTooSmallPacket, &parsed)); | 57 EXPECT_FALSE(test::ParseSinglePacket(kTooSmallPacket, &parsed)); |
58 } | 58 } |
59 | 59 |
60 } // namespace webrtc | 60 } // namespace webrtc |
OLD | NEW |