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

Unified Diff: tests/syscalls/syscalls.cc

Issue 195393003: Enable syscall_test on windows. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/syscalls/nacl.scons ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/syscalls/syscalls.cc
diff --git a/tests/syscalls/syscalls.cc b/tests/syscalls/syscalls.cc
index 2ff8c153e7df0e043a5d5f2445afed9b06a343ff..cc17f76bb226b2819a5f7695746e4bb7faef1cab 100644
--- a/tests/syscalls/syscalls.cc
+++ b/tests/syscalls/syscalls.cc
@@ -174,7 +174,12 @@ bool test_getcwd() {
// Calculate parent folder.
strncpy(parent, dirname, PATH_MAX);
- strrchr(parent, '/')[0] = '\0';
+ char *basename_start = strrchr(parent, '/');
+ if (basename_start == NULL) {
+ basename_start = strrchr(parent, '\\');
+ ASSERT_NE_MSG(basename_start, NULL, "test_file contains no dir seperator");
+ }
+ basename_start[0] = '\0';
int retcode = chdir("..");
ASSERT_EQ_MSG(retcode, 0, "chdir() failed");
« no previous file with comments | « tests/syscalls/nacl.scons ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698