Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
64df8e34
Commit
64df8e34
authored
Jul 29, 2014
by
kosak
Browse files
Mock out GetCurrentDir in NaCl.
parent
b54098a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/gtest-filepath.cc
src/gtest-filepath.cc
+8
-1
No files found.
src/gtest-filepath.cc
View file @
64df8e34
...
...
@@ -106,7 +106,14 @@ FilePath FilePath::GetCurrentDir() {
return
FilePath
(
_getcwd
(
cwd
,
sizeof
(
cwd
))
==
NULL
?
""
:
cwd
);
#else
char
cwd
[
GTEST_PATH_MAX_
+
1
]
=
{
'\0'
};
return
FilePath
(
getcwd
(
cwd
,
sizeof
(
cwd
))
==
NULL
?
""
:
cwd
);
char
*
result
=
getcwd
(
cwd
,
sizeof
(
cwd
));
# if GTEST_OS_NACL
// getcwd will likely fail in NaCl due to the sandbox, so return something
// reasonable. The user may have provided a shim implementation for getcwd,
// however, so fallback only when failure is detected.
return
FilePath
(
result
==
NULL
?
kCurrentDirectoryString
:
cwd
);
# endif // GTEST_OS_NACL
return
FilePath
(
result
==
NULL
?
""
:
cwd
);
#endif // GTEST_OS_WINDOWS_MOBILE
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment