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

Side by Side Diff: net/ftp/ftp_network_transaction_unittest.cc

Issue 374033002: Fixes for re-enabling more MSVC level 4 warnings: net/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comment Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/dns/host_resolver.h ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ftp/ftp_network_transaction.h" 5 #include "net/ftp/ftp_network_transaction.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 FtpSocketDataProviderEvilEpsv ctrl_socket("227 Portscan (||||)\r\n", 1179 FtpSocketDataProviderEvilEpsv ctrl_socket("227 Portscan (||||)\r\n",
1180 FtpSocketDataProvider::PRE_QUIT); 1180 FtpSocketDataProvider::PRE_QUIT);
1181 ExecuteTransaction(&ctrl_socket, "ftp://host/file", 1, ERR_INVALID_RESPONSE); 1181 ExecuteTransaction(&ctrl_socket, "ftp://host/file", 1, ERR_INVALID_RESPONSE);
1182 } 1182 }
1183 1183
1184 TEST_P(FtpNetworkTransactionTest, DownloadTransactionEvilEpsvReallyBadFormat5) { 1184 TEST_P(FtpNetworkTransactionTest, DownloadTransactionEvilEpsvReallyBadFormat5) {
1185 // This test makes no sense for IPv4 connections (we don't use EPSV there). 1185 // This test makes no sense for IPv4 connections (we don't use EPSV there).
1186 if (GetFamily() == AF_INET) 1186 if (GetFamily() == AF_INET)
1187 return; 1187 return;
1188 1188
1189 const char response[] = "227 Portscan (\0\0\031773\0)\r\n"; 1189 // Breaking the string in the next line prevents MSVC warning C4125.
1190 const char response[] = "227 Portscan (\0\0\031" "773\0)\r\n";
1190 FtpSocketDataProviderEvilEpsv ctrl_socket(response, sizeof(response)-1, 1191 FtpSocketDataProviderEvilEpsv ctrl_socket(response, sizeof(response)-1,
1191 FtpSocketDataProvider::PRE_QUIT); 1192 FtpSocketDataProvider::PRE_QUIT);
1192 ExecuteTransaction(&ctrl_socket, "ftp://host/file", 1, ERR_INVALID_RESPONSE); 1193 ExecuteTransaction(&ctrl_socket, "ftp://host/file", 1, ERR_INVALID_RESPONSE);
1193 } 1194 }
1194 1195
1195 TEST_P(FtpNetworkTransactionTest, DownloadTransactionEvilEpsvUnsafePort1) { 1196 TEST_P(FtpNetworkTransactionTest, DownloadTransactionEvilEpsvUnsafePort1) {
1196 // This test makes no sense for IPv4 connections (we don't use EPSV there). 1197 // This test makes no sense for IPv4 connections (we don't use EPSV there).
1197 if (GetFamily() == AF_INET) 1198 if (GetFamily() == AF_INET)
1198 return; 1199 return;
1199 1200
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 FtpSocketDataProvider::PRE_TYPE, 1594 FtpSocketDataProvider::PRE_TYPE,
1594 "257 \"\"\r\n", 1595 "257 \"\"\r\n",
1595 OK); 1596 OK);
1596 } 1597 }
1597 1598
1598 INSTANTIATE_TEST_CASE_P(FTP, 1599 INSTANTIATE_TEST_CASE_P(FTP,
1599 FtpNetworkTransactionTest, 1600 FtpNetworkTransactionTest,
1600 ::testing::Values(AF_INET, AF_INET6)); 1601 ::testing::Values(AF_INET, AF_INET6));
1601 1602
1602 } // namespace net 1603 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver.h ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698