| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_parsers.h" | 5 #include "net/ftp/ftp_directory_listing_parsers.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 2001, 1, 6, 2, 42 }, | 110 2001, 1, 6, 2, 42 }, |
| 111 { "01-06-00 02:42AM 458 Corner1.txt", | 111 { "01-06-00 02:42AM 458 Corner1.txt", |
| 112 net::FtpDirectoryListingEntry::FILE, "Corner1.txt", 458, | 112 net::FtpDirectoryListingEntry::FILE, "Corner1.txt", 458, |
| 113 2000, 1, 6, 2, 42 }, | 113 2000, 1, 6, 2, 42 }, |
| 114 { "01-06-99 02:42AM 458 Corner2.txt", | 114 { "01-06-99 02:42AM 458 Corner2.txt", |
| 115 net::FtpDirectoryListingEntry::FILE, "Corner2.txt", 458, | 115 net::FtpDirectoryListingEntry::FILE, "Corner2.txt", 458, |
| 116 1999, 1, 6, 2, 42 }, | 116 1999, 1, 6, 2, 42 }, |
| 117 { "01-06-80 02:42AM 458 Corner3.txt", | 117 { "01-06-80 02:42AM 458 Corner3.txt", |
| 118 net::FtpDirectoryListingEntry::FILE, "Corner3.txt", 458, | 118 net::FtpDirectoryListingEntry::FILE, "Corner3.txt", 458, |
| 119 1980, 1, 6, 2, 42 }, | 119 1980, 1, 6, 2, 42 }, |
| 120 #if !defined(OS_LINUX) |
| 121 // TODO(phajdan.jr): Re-enable when 2038-year problem is fixed on Linux. |
| 120 { "01-06-79 02:42AM 458 Corner4", | 122 { "01-06-79 02:42AM 458 Corner4", |
| 121 net::FtpDirectoryListingEntry::FILE, "Corner4", 458, | 123 net::FtpDirectoryListingEntry::FILE, "Corner4", 458, |
| 122 2079, 1, 6, 2, 42 }, | 124 2079, 1, 6, 2, 42 }, |
| 125 #endif // !defined (OS_LINUX) |
| 123 { "01-06-1979 02:42AM 458 Readme.txt", | 126 { "01-06-1979 02:42AM 458 Readme.txt", |
| 124 net::FtpDirectoryListingEntry::FILE, "Readme.txt", 458, | 127 net::FtpDirectoryListingEntry::FILE, "Readme.txt", 458, |
| 125 1979, 1, 6, 2, 42 }, | 128 1979, 1, 6, 2, 42 }, |
| 126 }; | 129 }; |
| 127 for (size_t i = 0; i < arraysize(good_cases); i++) { | 130 for (size_t i = 0; i < arraysize(good_cases); i++) { |
| 128 SCOPED_TRACE(StringPrintf("Test[%d]: %s", i, good_cases[i].input)); | 131 SCOPED_TRACE(StringPrintf("Test[%d]: %s", i, good_cases[i].input)); |
| 129 | 132 |
| 130 net::FtpWindowsDirectoryListingParser parser; | 133 net::FtpWindowsDirectoryListingParser parser; |
| 131 RunSingleLineTestCase(&parser, good_cases[i]); | 134 RunSingleLineTestCase(&parser, good_cases[i]); |
| 132 } | 135 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (!parser.ConsumeLine(UTF8ToUTF16(*i))) { | 245 if (!parser.ConsumeLine(UTF8ToUTF16(*i))) { |
| 243 failed = true; | 246 failed = true; |
| 244 break; | 247 break; |
| 245 } | 248 } |
| 246 } | 249 } |
| 247 EXPECT_TRUE(failed); | 250 EXPECT_TRUE(failed); |
| 248 } | 251 } |
| 249 } | 252 } |
| 250 | 253 |
| 251 } // namespace | 254 } // namespace |
| OLD | NEW |