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

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

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/ftp/ftp_directory_listing_parser_os2.h" 10 #include "net/ftp/ftp_directory_listing_parser_os2.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 std::vector<FtpDirectoryListingEntry> entries; 58 std::vector<FtpDirectoryListingEntry> entries;
59 EXPECT_TRUE(ParseFtpDirectoryListingOS2( 59 EXPECT_TRUE(ParseFtpDirectoryListingOS2(
60 GetSingleLineTestCase(good_cases[i].input), 60 GetSingleLineTestCase(good_cases[i].input),
61 &entries)); 61 &entries));
62 VerifySingleLineTestCase(good_cases[i], entries); 62 VerifySingleLineTestCase(good_cases[i], entries);
63 } 63 }
64 } 64 }
65 65
66 TEST_F(FtpDirectoryListingParserOS2Test, Ignored) { 66 TEST_F(FtpDirectoryListingParserOS2Test, Ignored) {
67 const char* ignored_cases[] = { 67 const char* const ignored_cases[] = {
68 "1234 A 12-07-10 12:05", 68 "1234 A 12-07-10 12:05",
69 "0 DIR 11-02-09 05:32", 69 "0 DIR 11-02-09 05:32",
70 }; 70 };
71 for (size_t i = 0; i < arraysize(ignored_cases); i++) { 71 for (size_t i = 0; i < arraysize(ignored_cases); i++) {
72 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, 72 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i,
73 ignored_cases[i])); 73 ignored_cases[i]));
74 74
75 std::vector<FtpDirectoryListingEntry> entries; 75 std::vector<FtpDirectoryListingEntry> entries;
76 EXPECT_TRUE(ParseFtpDirectoryListingOS2( 76 EXPECT_TRUE(ParseFtpDirectoryListingOS2(
77 GetSingleLineTestCase(ignored_cases[i]), 77 GetSingleLineTestCase(ignored_cases[i]),
78 &entries)); 78 &entries));
79 EXPECT_EQ(0U, entries.size()); 79 EXPECT_EQ(0U, entries.size());
80 } 80 }
81 } 81 }
82 82
83 TEST_F(FtpDirectoryListingParserOS2Test, Bad) { 83 TEST_F(FtpDirectoryListingParserOS2Test, Bad) {
84 const char* bad_cases[] = { 84 const char* const bad_cases[] = {
85 "garbage", 85 "garbage",
86 "0 GARBAGE 11-02-09 05:32", 86 "0 GARBAGE 11-02-09 05:32",
87 "0 GARBAGE 11-02-09 05:32 NT", 87 "0 GARBAGE 11-02-09 05:32 NT",
88 "0 DIR 11-FEB-09 05:32", 88 "0 DIR 11-FEB-09 05:32",
89 "0 DIR 11-02 05:32", 89 "0 DIR 11-02 05:32",
90 "-1 A 11-02-09 05:32", 90 "-1 A 11-02-09 05:32",
91 "0 DIR 11-FEB-09 05:32", 91 "0 DIR 11-FEB-09 05:32",
92 "0 DIR 11-02 05:32 NT", 92 "0 DIR 11-02 05:32 NT",
93 "-1 A 11-02-09 05:32 NT", 93 "-1 A 11-02-09 05:32 NT",
94 "0 A 99-25-10 12:00", 94 "0 A 99-25-10 12:00",
(...skipping 12 matching lines...) Expand all
107 std::vector<FtpDirectoryListingEntry> entries; 107 std::vector<FtpDirectoryListingEntry> entries;
108 EXPECT_FALSE(ParseFtpDirectoryListingOS2( 108 EXPECT_FALSE(ParseFtpDirectoryListingOS2(
109 GetSingleLineTestCase(bad_cases[i]), 109 GetSingleLineTestCase(bad_cases[i]),
110 &entries)); 110 &entries));
111 } 111 }
112 } 112 }
113 113
114 } // namespace 114 } // namespace
115 115
116 } // namespace net 116 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_netware_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698