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

Unified Diff: net/ftp/ftp_directory_listing_parser_windows_unittest.cc

Issue 3013029: Fix a bug with parsing ftp directory listing lines. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« base/time.h ('K') | « net/ftp/ftp_directory_listing_parser_windows.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_parser_windows_unittest.cc
===================================================================
--- net/ftp/ftp_directory_listing_parser_windows_unittest.cc (revision 53666)
+++ net/ftp/ftp_directory_listing_parser_windows_unittest.cc (working copy)
@@ -50,6 +50,12 @@
{ "11-02-09 05:32PM <DIR> My Directory",
net::FtpDirectoryListingEntry::DIRECTORY, "My Directory", -1,
2009, 11, 2, 17, 32 },
+ { "12-25-10 12:00AM <DIR> Christmas Midnight",
+ net::FtpDirectoryListingEntry::DIRECTORY, "Christmas Midnight", -1,
+ 2010, 12, 25, 0, 0 },
+ { "12-25-10 12:00PM <DIR> Christmas Midday",
+ net::FtpDirectoryListingEntry::DIRECTORY, "Christmas Midday", -1,
+ 2010, 12, 25, 12, 0 },
};
for (size_t i = 0; i < arraysize(good_cases); i++) {
SCOPED_TRACE(StringPrintf("Test[%" PRIuS "]: %s", i, good_cases[i].input));
@@ -68,6 +74,11 @@
"11-FEB-09 05:32PM <DIR> NT",
"11-02 05:32PM <DIR> NT",
"11-02-09 05:32PM -1 NT",
+ "99-25-10 12:00AM 0 months out of range",
+ "12-99-10 12:00AM 0 days out of range",
+ "12-25-10 99:00AM 0 hours out of range",
+ "12-25-10 12:99AM 0 minutes out of range",
+ "12-25-10 12:00ZM 0 what does ZM mean",
};
for (size_t i = 0; i < arraysize(bad_cases); i++) {
net::FtpDirectoryListingParserWindows parser;
« base/time.h ('K') | « net/ftp/ftp_directory_listing_parser_windows.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698