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

Side by Side Diff: webrtc/voice_engine/voe_network_unittest.cc

Issue 3009403002: Drop return value from RtpRtcp::IncomingRtcpPacket. (Closed)
Patch Set: Delete VoENetworkTest.ReceivedRTCPPacketWithJunkDataShouldFail. Created 3 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
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 EXPECT_EQ(-1, network_->ReceivedRTPPacket( 90 EXPECT_EQ(-1, network_->ReceivedRTPPacket(
91 channelID, kPacket, kMinValidSizeOfRtpPacketInBytes - 1)); 91 channelID, kPacket, kMinValidSizeOfRtpPacketInBytes - 1));
92 } 92 }
93 93
94 TEST_F(VoENetworkTest, ReceivedTooLargeRTPPacketShouldFail) { 94 TEST_F(VoENetworkTest, ReceivedTooLargeRTPPacketShouldFail) {
95 int channelID = CreateChannelAndRegisterExternalTransport(); 95 int channelID = CreateChannelAndRegisterExternalTransport();
96 EXPECT_EQ(-1, network_->ReceivedRTPPacket( 96 EXPECT_EQ(-1, network_->ReceivedRTPPacket(
97 channelID, kPacket, kMaxValidSizeOfRtpPacketInBytes + 1)); 97 channelID, kPacket, kMaxValidSizeOfRtpPacketInBytes + 1));
98 } 98 }
99 99
100 TEST_F(VoENetworkTest, ReceivedRTCPPacketWithJunkDataShouldFail) {
101 int channelID = CreateChannelAndRegisterExternalTransport();
102 EXPECT_EQ(0, network_->ReceivedRTCPPacket(channelID, kPacketJunk,
103 sizeof(kPacketJunk)));
104 EXPECT_EQ(VE_SOCKET_TRANSPORT_MODULE_ERROR, base_->LastError());
105 }
106
107 TEST_F(VoENetworkTest, ReceivedRTCPPacketOnNonExistingChannelShouldFail) { 100 TEST_F(VoENetworkTest, ReceivedRTCPPacketOnNonExistingChannelShouldFail) {
108 EXPECT_EQ(0, base_->Init(&adm_, apm_.get(), nullptr)); 101 EXPECT_EQ(0, base_->Init(&adm_, apm_.get(), nullptr));
109 EXPECT_EQ(-1, network_->ReceivedRTCPPacket(kNonExistingChannel, kPacket, 102 EXPECT_EQ(-1, network_->ReceivedRTCPPacket(kNonExistingChannel, kPacket,
110 sizeof(kPacket))); 103 sizeof(kPacket)));
111 } 104 }
112 105
113 TEST_F(VoENetworkTest, ReceivedRTCPPacketOnChannelWithoutTransportShouldFail) { 106 TEST_F(VoENetworkTest, ReceivedRTCPPacketOnChannelWithoutTransportShouldFail) {
114 EXPECT_EQ(0, base_->Init(&adm_, apm_.get(), nullptr)); 107 EXPECT_EQ(0, base_->Init(&adm_, apm_.get(), nullptr));
115 int channelID = base_->CreateChannel(); 108 int channelID = base_->CreateChannel();
116 EXPECT_NE(channelID, -1); 109 EXPECT_NE(channelID, -1);
117 EXPECT_EQ(-1, 110 EXPECT_EQ(-1,
118 network_->ReceivedRTCPPacket(channelID, kPacket, sizeof(kPacket))); 111 network_->ReceivedRTCPPacket(channelID, kPacket, sizeof(kPacket)));
119 } 112 }
120 113
121 TEST_F(VoENetworkTest, ReceivedTooSmallRTCPPacket4ShouldFail) { 114 TEST_F(VoENetworkTest, ReceivedTooSmallRTCPPacket4ShouldFail) {
122 int channelID = CreateChannelAndRegisterExternalTransport(); 115 int channelID = CreateChannelAndRegisterExternalTransport();
123 EXPECT_EQ(-1, network_->ReceivedRTCPPacket( 116 EXPECT_EQ(-1, network_->ReceivedRTCPPacket(
124 channelID, kPacket, kMinValidSizeOfRtcpPacketInBytes - 1)); 117 channelID, kPacket, kMinValidSizeOfRtcpPacketInBytes - 1));
125 } 118 }
126 119
127 } // namespace webrtc 120 } // namespace webrtc
OLDNEW
« webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc ('K') | « webrtc/voice_engine/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698