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

Unified Diff: sandbox/win/src/process_policy_test.cc

Issue 382613002: Fixes for re-enabling more MSVC level 4 warnings: sandbox/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments + cleanup Created 6 years, 5 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 | « sandbox/win/src/handle_interception.cc ('k') | sandbox/win/src/sync_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/process_policy_test.cc
diff --git a/sandbox/win/src/process_policy_test.cc b/sandbox/win/src/process_policy_test.cc
index af64f14f79127c6536744cf5aea1d9119bf8cf01..ae6260633aca459739d24696f0f5f629f2bda367 100644
--- a/sandbox/win/src/process_policy_test.cc
+++ b/sandbox/win/src/process_policy_test.cc
@@ -154,28 +154,20 @@ SBOX_TESTS_COMMAND int Process_RunApp4(int argc, wchar_t **argv) {
// TEST 4: Try file name in the app_name and current directory sets correctly.
base::string16 system32 = MakeFullPathToSystem32(L"");
wchar_t current_directory[MAX_PATH + 1];
- int result4;
- bool test_succeeded = false;
DWORD ret = ::GetCurrentDirectory(MAX_PATH, current_directory);
if (!ret)
return SBOX_TEST_FIRST_ERROR;
+ if (ret >= MAX_PATH)
+ return SBOX_TEST_FAILED;
- if (ret < MAX_PATH) {
- current_directory[ret] = L'\\';
- current_directory[ret+1] = L'\0';
- if (::SetCurrentDirectory(system32.c_str())) {
- result4 = CreateProcessHelper(argv[0], base::string16());
- if (::SetCurrentDirectory(current_directory)) {
- test_succeeded = true;
- }
- } else {
- return SBOX_TEST_SECOND_ERROR;
- }
+ current_directory[ret] = L'\\';
+ current_directory[ret+1] = L'\0';
+ if (!::SetCurrentDirectory(system32.c_str())) {
+ return SBOX_TEST_SECOND_ERROR;
}
- if (!test_succeeded)
- result4 = SBOX_TEST_FAILED;
- return result4;
+ const int result4 = CreateProcessHelper(argv[0], base::string16());
+ return ::SetCurrentDirectory(current_directory) ? result4 : SBOX_TEST_FAILED;
}
SBOX_TESTS_COMMAND int Process_RunApp5(int argc, wchar_t **argv) {
« no previous file with comments | « sandbox/win/src/handle_interception.cc ('k') | sandbox/win/src/sync_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698