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

Side by Side Diff: base/files/file_path_unittest.cc

Issue 1139883004: Testing: Fixed printing FilePaths when a test fails comparing them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bauerb-profiles-ephemeral
Patch Set: Remove unnecessary qualifier. Created 5 years, 7 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
« base/files/file_path.h ('K') | « base/files/file_path.cc ('k') | no next file » | 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 <sstream>
6
5 #include "base/basictypes.h" 7 #include "base/basictypes.h"
6 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
7 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
8 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/platform_test.h" 11 #include "testing/platform_test.h"
10 12
11 // This macro helps avoid wrapped lines in the test structs. 13 // This macro helps avoid wrapped lines in the test structs.
12 #define FPL(x) FILE_PATH_LITERAL(x) 14 #define FPL(x) FILE_PATH_LITERAL(x)
13 15
14 // This macro constructs strings which can contain NULs. 16 // This macro constructs strings which can contain NULs.
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 1268
1267 for (size_t i = 0; i < arraysize(cases); ++i) { 1269 for (size_t i = 0; i < arraysize(cases); ++i) {
1268 FilePath input(cases[i].input); 1270 FilePath input(cases[i].input);
1269 bool observed = input.IsContentUri(); 1271 bool observed = input.IsContentUri();
1270 EXPECT_EQ(cases[i].expected, observed) << 1272 EXPECT_EQ(cases[i].expected, observed) <<
1271 "i: " << i << ", input: " << input.value(); 1273 "i: " << i << ", input: " << input.value();
1272 } 1274 }
1273 } 1275 }
1274 #endif 1276 #endif
1275 1277
1278 // Test the PrintTo overload for FilePath (used when a test fails to compare two
1279 // FilePaths).
1280 TEST_F(FilePathTest, PrintTo) {
1281 std::stringstream ss;
1282 FilePath fp("foo");
1283 base::PrintTo(fp, &ss);
1284 EXPECT_EQ("foo", ss.str());
1285 }
1286
1276 } // namespace base 1287 } // namespace base
OLDNEW
« base/files/file_path.h ('K') | « base/files/file_path.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698