summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 03:51:56 +0000
committerskerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 03:51:56 +0000
commit094f97627b26c6cc7d81f51981d80982755d7b15 (patch)
tree8834d4f504f9705edeb09424d90afe71fc7a9b67 /base
parent24db026c5f670bd4482025fba34848ee69eb614f (diff)
downloadchromium_src-094f97627b26c6cc7d81f51981d80982755d7b15.zip
chromium_src-094f97627b26c6cc7d81f51981d80982755d7b15.tar.gz
chromium_src-094f97627b26c6cc7d81f51981d80982755d7b15.tar.bz2
Fix incorect tests against INVALID_FILE_HANDLE, as pointed out by cpu on chrome-team.
BUG=NONE TEST=FileUtilTest.NormalizeFilePath* Review URL: http://codereview.chromium.org/3031041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_util_unittest.cc6
-rw-r--r--base/file_util_win.cc4
2 files changed, 5 insertions, 5 deletions
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 4a1417a..7ee7628 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -575,7 +575,7 @@ TEST_F(FileUtilTest, NormalizeFilePathReparsePoints) {
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, // Needed to open a directory.
NULL));
- ASSERT_NE(INVALID_HANDLE_VALUE, reparse_to_sub_a.Get());
+ ASSERT_TRUE(reparse_to_sub_a.IsValid());
ASSERT_TRUE(SetReparsePoint(reparse_to_sub_a, sub_a));
FilePath to_base_b = base_b.Append(FPL("to_base_b"));
@@ -588,7 +588,7 @@ TEST_F(FileUtilTest, NormalizeFilePathReparsePoints) {
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, // Needed to open a directory.
NULL));
- ASSERT_NE(INVALID_HANDLE_VALUE, reparse_to_base_b.Get());
+ ASSERT_TRUE(reparse_to_base_b.IsValid());
ASSERT_TRUE(SetReparsePoint(reparse_to_base_b, base_b));
FilePath to_sub_long = base_b.Append(FPL("to_sub_long"));
@@ -601,7 +601,7 @@ TEST_F(FileUtilTest, NormalizeFilePathReparsePoints) {
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, // Needed to open a directory.
NULL));
- ASSERT_NE(INVALID_HANDLE_VALUE, reparse_to_sub_long.Get());
+ ASSERT_TRUE(reparse_to_sub_long.IsValid());
ASSERT_TRUE(SetReparsePoint(reparse_to_sub_long, sub_long));
// Normalize a junction free path: base_a\sub_a\file.txt .
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 33491ed..aa965bf 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -976,7 +976,7 @@ bool NormalizeFilePath(const FilePath& path, FilePath* real_path) {
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL));
- if (path_handle == INVALID_HANDLE_VALUE)
+ if (!path_handle.IsValid())
return false;
// In Vista, GetFinalPathNameByHandle() would give us the real path
@@ -1002,7 +1002,7 @@ bool NormalizeFilePath(const FilePath& path, FilePath* real_path) {
1, // Just one byte. No need to look at the data.
NULL));
- if (file_map_handle == INVALID_HANDLE_VALUE)
+ if (!file_map_handle.IsValid())
return false;
// Use a view of the file to get the path to the file.