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

Side by Side Diff: testing/utils/path_service.cpp

Issue 1773733002: Review and cleanup lint warnings. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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 | « testing/test_support.cpp ('k') | xfa/src/fdp/src/css/fde_csscache.h » ('j') | 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 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium 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 "testing/utils/path_service.h" 5 #include "testing/utils/path_service.h"
6 6
7 #ifdef _WIN32 7 #ifdef _WIN32
8 #include <Windows.h> 8 #include <Windows.h>
9 #elif defined(__APPLE__) 9 #elif defined(__APPLE__)
10 #include <mach-o/dyld.h> 10 #include <mach-o/dyld.h>
11 #else // Linux 11 #else // Linux
12 #include <linux/limits.h> 12 #include <linux/limits.h>
13 #include <unistd.h> 13 #include <unistd.h>
14 #endif // _WIN32 14 #endif // _WIN32
15 15
16 #include <string>
17
16 #include "core/include/fxcrt/fx_system.h" 18 #include "core/include/fxcrt/fx_system.h"
17 19
18 // static 20 // static
19 bool PathService::EndsWithSeparator(const std::string& path) { 21 bool PathService::EndsWithSeparator(const std::string& path) {
20 return path.size() > 1 && path[path.size() - 1] == PATH_SEPARATOR; 22 return path.size() > 1 && path[path.size() - 1] == PATH_SEPARATOR;
21 } 23 }
22 24
23 // static 25 // static
24 bool PathService::GetExecutableDir(std::string* path) { 26 bool PathService::GetExecutableDir(std::string* path) {
25 // Get the current executable file path. 27 // Get the current executable file path.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 bool PathService::GetTestFilePath(const std::string& file_name, 94 bool PathService::GetTestFilePath(const std::string& file_name,
93 std::string* path) { 95 std::string* path) {
94 if (!GetTestDataDir(path)) 96 if (!GetTestDataDir(path))
95 return false; 97 return false;
96 98
97 if (!EndsWithSeparator(*path)) 99 if (!EndsWithSeparator(*path))
98 path->push_back(PATH_SEPARATOR); 100 path->push_back(PATH_SEPARATOR);
99 path->append(file_name); 101 path->append(file_name);
100 return true; 102 return true;
101 } 103 }
OLDNEW
« no previous file with comments | « testing/test_support.cpp ('k') | xfa/src/fdp/src/css/fde_csscache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698