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

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

Issue 2275443002: Minor fixes in FEC and RtpSender{,Video}. (pt. 2) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@header_reader_writer-pt1-move_copy_column
Patch Set: Created 4 years, 4 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
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
(...skipping 23 matching lines...) Expand all
34 EXPECT_EQ(red_payload_type, data[1] & 0x7F); 34 EXPECT_EQ(red_payload_type, data[1] & 0x7F);
35 EXPECT_EQ(seq_num, (data[2] << 8) + data[3]); 35 EXPECT_EQ(seq_num, (data[2] << 8) + data[3]);
36 uint32_t parsed_timestamp = (data[4] << 24) + (data[5] << 16) + 36 uint32_t parsed_timestamp = (data[4] << 24) + (data[5] << 16) +
37 (data[6] << 8) + data[7]; 37 (data[6] << 8) + data[7];
38 EXPECT_EQ(timestamp, parsed_timestamp); 38 EXPECT_EQ(timestamp, parsed_timestamp);
39 EXPECT_EQ(static_cast<uint8_t>(fec_payload_type), data[kRtpHeaderSize]); 39 EXPECT_EQ(static_cast<uint8_t>(fec_payload_type), data[kRtpHeaderSize]);
40 } 40 }
41 41
42 class ProducerFecTest : public ::testing::Test { 42 class ProducerFecTest : public ::testing::Test {
43 protected: 43 protected:
44 ProducerFecTest() : producer_(&fec_) {}
45
46 ForwardErrorCorrection fec_;
47 ProducerFec producer_; 44 ProducerFec producer_;
48 FrameGenerator generator_; 45 FrameGenerator generator_;
49 }; 46 };
50 47
51 // Verifies bug found via fuzzing, where a gap in the packet sequence caused us 48 // Verifies bug found via fuzzing, where a gap in the packet sequence caused us
52 // to move past the end of the current FEC packet mask byte without moving to 49 // to move past the end of the current FEC packet mask byte without moving to
53 // the next byte. That likely caused us to repeatedly read from the same byte, 50 // the next byte. That likely caused us to repeatedly read from the same byte,
54 // and if that byte didn't protect packets we would generate empty FEC. 51 // and if that byte didn't protect packets we would generate empty FEC.
55 TEST_F(ProducerFecTest, NoEmptyFecWithSeqNumGaps) { 52 TEST_F(ProducerFecTest, NoEmptyFecWithSeqNumGaps) {
56 struct Packet { 53 struct Packet {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 kRedPayloadType, 176 kRedPayloadType,
180 packet->header.header.payloadType, 177 packet->header.header.payloadType,
181 red_packet.get(), 178 red_packet.get(),
182 true); // Marker bit set. 179 true); // Marker bit set.
183 for (int i = 0; i < 10; ++i) 180 for (int i = 0; i < 10; ++i)
184 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]); 181 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]);
185 delete packet; 182 delete packet;
186 } 183 }
187 184
188 } // namespace webrtc 185 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698