| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_directory_listing_parser_unittest.h" | 5 #include "net/ftp/ftp_directory_listing_parser_unittest.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/string_split.h" | 8 #include "base/string_split.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RWED,RE,RE,RE)", | 99 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RWED,RE,RE,RE)", |
| 100 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RWEDRWED,RE,RE)", | 100 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RWEDRWED,RE,RE)", |
| 101 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,DEWR,RE,RE)", | 101 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,DEWR,RE,RE)", |
| 102 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RWED,Q,RE)", | 102 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RWED,Q,RE)", |
| 103 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RRWWEEDD,RE,RE)", | 103 "Directory ROOT|X.TXT;2 1 12-MAR-2005 08:44:57 [X] (RWED,RRWWEEDD,RE,RE)", |
| 104 }; | 104 }; |
| 105 for (size_t i = 0; i < arraysize(bad_cases); i++) { | 105 for (size_t i = 0; i < arraysize(bad_cases); i++) { |
| 106 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, bad_cases[i])); | 106 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, bad_cases[i])); |
| 107 | 107 |
| 108 std::vector<std::string> lines; | 108 std::vector<std::string> lines; |
| 109 SplitString(bad_cases[i], '|', &lines); | 109 base::SplitString(bad_cases[i], '|', &lines); |
| 110 net::FtpDirectoryListingParserVms parser; | 110 net::FtpDirectoryListingParserVms parser; |
| 111 bool failed = false; | 111 bool failed = false; |
| 112 for (std::vector<std::string>::const_iterator i = lines.begin(); | 112 for (std::vector<std::string>::const_iterator i = lines.begin(); |
| 113 i != lines.end(); ++i) { | 113 i != lines.end(); ++i) { |
| 114 if (!parser.ConsumeLine(UTF8ToUTF16(*i))) { | 114 if (!parser.ConsumeLine(UTF8ToUTF16(*i))) { |
| 115 failed = true; | 115 failed = true; |
| 116 break; | 116 break; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 EXPECT_TRUE(failed); | 119 EXPECT_TRUE(failed); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace | 123 } // namespace |
| OLD | NEW |