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

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

Issue 2294243005: Fix off-by-one error in DCHECK in ProducerFec. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/producer_fec.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 packet->header.header.timestamp, 178 packet->header.header.timestamp,
179 kRedPayloadType, 179 kRedPayloadType,
180 packet->header.header.payloadType, 180 packet->header.header.payloadType,
181 red_packet.get(), 181 red_packet.get(),
182 true); // Marker bit set. 182 true); // Marker bit set.
183 for (int i = 0; i < 10; ++i) 183 for (int i = 0; i < 10; ++i)
184 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]); 184 EXPECT_EQ(i, red_packet->data()[kRtpHeaderSize + 1 + i]);
185 delete packet; 185 delete packet;
186 } 186 }
187 187
188 TEST_F(ProducerFecTest, BuildRedPacketWithEmptyPayload) {
189 constexpr size_t kNumFrames = 1;
190 constexpr size_t kFrameId = 0;
danilchap 2016/09/01 07:59:17 may be constexpr int kOffset = 0; NextPacket name
brandtr 2016/09/01 09:29:18 I'm not a fan of unnamed literals in the tests, bu
191 constexpr size_t kPayloadLength = 0;
192
193 generator_.NewFrame(kNumFrames);
194 std::unique_ptr<test::RawRtpPacket> packet(
195 generator_.NextPacket(kFrameId, kPayloadLength));
196 std::unique_ptr<RedPacket> red_packet =
197 ProducerFec::BuildRedPacket(packet->data, packet->length - kRtpHeaderSize,
198 kRtpHeaderSize, kRedPayloadType);
199 EXPECT_EQ(packet->length + 1, red_packet->length());
danilchap 2016/09/01 07:59:17 this + 1 is + kRedForFecHeaderLength?
brandtr 2016/09/01 09:29:18 Yes, clarified.
200 VerifyHeader(packet->header.header.sequenceNumber,
201 packet->header.header.timestamp, kRedPayloadType,
202 packet->header.header.payloadType, red_packet.get(),
203 true); // Marker bit set.
204 }
205
188 } // namespace webrtc 206 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/producer_fec.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698