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

Side by Side Diff: util/test/scoped_temp_dir_test.cc

Issue 836833003: Fix function name in error message of scoped_temp_dir_test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: [] Created 5 years, 11 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
« no previous file with comments | « no previous file | 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 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 21 matching lines...) Expand all
32 #endif // OS_POSIX 32 #endif // OS_POSIX
33 33
34 namespace crashpad { 34 namespace crashpad {
35 namespace test { 35 namespace test {
36 namespace { 36 namespace {
37 37
38 bool FileExists(const base::FilePath& path) { 38 bool FileExists(const base::FilePath& path) {
39 #if defined(OS_POSIX) 39 #if defined(OS_POSIX)
40 struct stat st; 40 struct stat st;
41 int rv = lstat(path.value().c_str(), &st); 41 int rv = lstat(path.value().c_str(), &st);
42 const char stat_function[] = "lstat";
42 #elif defined(OS_WIN) 43 #elif defined(OS_WIN)
43 struct _stat st; 44 struct _stat st;
44 int rv = _wstat(path.value().c_str(), &st); 45 int rv = _wstat(path.value().c_str(), &st);
46 const char stat_function[] = "_wstat";
45 #else 47 #else
46 #error "Not implemented" 48 #error "Not implemented"
47 #endif 49 #endif
48 if (rv < 0) { 50 if (rv < 0) {
49 EXPECT_EQ(ENOENT, errno) << ErrnoMessage("lstat") << " " << path.value(); 51 EXPECT_EQ(ENOENT, errno) << ErrnoMessage(stat_function) << " "
52 << path.value();
50 return false; 53 return false;
51 } 54 }
52 return true; 55 return true;
53 } 56 }
54 57
55 void CreateFile(const base::FilePath& path) { 58 void CreateFile(const base::FilePath& path) {
56 #if defined(OS_POSIX) 59 #if defined(OS_POSIX)
57 int fd = HANDLE_EINTR(creat(path.value().c_str(), 0644)); 60 int fd = HANDLE_EINTR(creat(path.value().c_str(), 0644));
58 ASSERT_GE(fd, 0) << ErrnoMessage("creat") << " " << path.value(); 61 ASSERT_GE(fd, 0) << ErrnoMessage("creat") << " " << path.value();
59 ASSERT_EQ(0, IGNORE_EINTR(close(fd))) 62 ASSERT_EQ(0, IGNORE_EINTR(close(fd)))
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 134
132 EXPECT_FALSE(FileExists(file1)); 135 EXPECT_FALSE(FileExists(file1));
133 EXPECT_FALSE(FileExists(file2)); 136 EXPECT_FALSE(FileExists(file2));
134 EXPECT_FALSE(FileExists(child_dir)); 137 EXPECT_FALSE(FileExists(child_dir));
135 EXPECT_FALSE(FileExists(parent)); 138 EXPECT_FALSE(FileExists(parent));
136 } 139 }
137 140
138 } // namespace 141 } // namespace
139 } // namespace test 142 } // namespace test
140 } // namespace crashpad 143 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698