Remove global std::strings from fileutils.
This is forbidden by the style guide and can cause the static initialization order fiasco. BUG= TEST=test_support_unittests Review URL: http://webrtc-codereview.appspot.com/248006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@846 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
2c74bab8b9
commit
1e10bb32b9
@ -25,7 +25,11 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
const std::string GetProjectRootPath() {
|
// The file we're looking for to identify the project root dir.
|
||||||
|
static const char* kProjectRootFileName = "DEPS";
|
||||||
|
const char* kCannotFindProjectRootDir = "ERROR_CANNOT_FIND_PROJECT_ROOT_DIR";
|
||||||
|
|
||||||
|
std::string GetProjectRootPath() {
|
||||||
char path_buffer[FILENAME_MAX];
|
char path_buffer[FILENAME_MAX];
|
||||||
if (!GET_CURRENT_DIR(path_buffer, sizeof(path_buffer))) {
|
if (!GET_CURRENT_DIR(path_buffer, sizeof(path_buffer))) {
|
||||||
fprintf(stderr, "Cannot get current directory!\n");
|
fprintf(stderr, "Cannot get current directory!\n");
|
||||||
|
@ -66,13 +66,9 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
// The file we're looking for to identify the project root dir.
|
|
||||||
const std::string kProjectRootFileName = "DEPS";
|
|
||||||
|
|
||||||
// This is the "directory" returned if the GetProjectPath() function fails
|
// This is the "directory" returned if the GetProjectPath() function fails
|
||||||
// to find the project root.
|
// to find the project root.
|
||||||
const std::string kCannotFindProjectRootDir =
|
extern const char* kCannotFindProjectRootDir;
|
||||||
"ERROR_CANNOT_FIND_PROJECT_ROOT_DIR";
|
|
||||||
|
|
||||||
// Finds the root dir of the project, to be able to set correct paths to
|
// Finds the root dir of the project, to be able to set correct paths to
|
||||||
// resource files used by tests.
|
// resource files used by tests.
|
||||||
@ -90,9 +86,9 @@ const std::string kCannotFindProjectRootDir =
|
|||||||
// WITH a trailing path delimiter.
|
// WITH a trailing path delimiter.
|
||||||
// If the project root is not found, the string specified by
|
// If the project root is not found, the string specified by
|
||||||
// kCannotFindProjectRootDir is returned.
|
// kCannotFindProjectRootDir is returned.
|
||||||
const std::string GetProjectRootPath();
|
std::string GetProjectRootPath();
|
||||||
|
|
||||||
} // namespace webrtc
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // TEST_TESTSUPPORT_FILEUTILS_H_
|
#endif // TEST_TESTSUPPORT_FILEUTILS_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user