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

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

Issue 1507413003: clang/win: Let some chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_browsertests Created 5 years 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/crosscall_params.h ('k') | sandbox/win/src/interception_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/handle_closer_test.cc
diff --git a/sandbox/win/src/handle_closer_test.cc b/sandbox/win/src/handle_closer_test.cc
index 1cb2bb5276abc22bdabe31e2ead109cf2a2c231d..10ebe3b7e01e73b2b0a956ef6fb91cc4847fa05e 100644
--- a/sandbox/win/src/handle_closer_test.cc
+++ b/sandbox/win/src/handle_closer_test.cc
@@ -86,8 +86,8 @@ SBOX_TESTS_COMMAND int CheckForFileHandles(int argc, wchar_t **argv) {
case BEFORE_INIT:
// Create a unique marker file that is open while the test is running.
// The handles leak, but it will be closed by the test or on exit.
- for (int i = 0; i < arraysize(kFileExtensions); ++i)
- CHECK_NE(GetMarkerFile(kFileExtensions[i]), INVALID_HANDLE_VALUE);
+ for (const wchar_t* kExtension : kFileExtensions)
+ CHECK_NE(GetMarkerFile(kExtension), INVALID_HANDLE_VALUE);
return SBOX_TEST_SUCCEEDED;
case AFTER_REVERT: {
@@ -134,8 +134,8 @@ SBOX_TESTS_COMMAND int CheckForEventHandles(int argc, wchar_t** argv) {
switch (state++) {
case BEFORE_INIT:
// Create a unique marker file that is open while the test is running.
- for (int i = 0; i < arraysize(kFileExtensions); ++i) {
- HANDLE handle = GetMarkerFile(kFileExtensions[i]);
+ for (const wchar_t* kExtension : kFileExtensions) {
+ HANDLE handle = GetMarkerFile(kExtension);
CHECK_NE(handle, INVALID_HANDLE_VALUE);
to_check.push_back(handle);
}
@@ -195,9 +195,9 @@ TEST(HandleCloserTest, CheckForMarkerFiles) {
runner.SetTestState(EVERY_STATE);
base::string16 command = base::string16(L"CheckForFileHandles Y");
- for (int i = 0; i < arraysize(kFileExtensions); ++i) {
+ for (const wchar_t* kExtension : kFileExtensions) {
base::string16 handle_name;
- base::win::ScopedHandle marker(GetMarkerFile(kFileExtensions[i]));
+ base::win::ScopedHandle marker(GetMarkerFile(kExtension));
CHECK(marker.IsValid());
CHECK(sandbox::GetHandleName(marker.Get(), &handle_name));
command += (L" ");
@@ -215,9 +215,9 @@ TEST(HandleCloserTest, CloseMarkerFiles) {
sandbox::TargetPolicy* policy = runner.GetPolicy();
base::string16 command = base::string16(L"CheckForFileHandles N");
- for (int i = 0; i < arraysize(kFileExtensions); ++i) {
+ for (const wchar_t* kExtension : kFileExtensions) {
base::string16 handle_name;
- base::win::ScopedHandle marker(GetMarkerFile(kFileExtensions[i]));
+ base::win::ScopedHandle marker(GetMarkerFile(kExtension));
CHECK(marker.IsValid());
CHECK(sandbox::GetHandleName(marker.Get(), &handle_name));
CHECK_EQ(policy->AddKernelObjectToClose(L"File", handle_name.c_str()),
@@ -236,9 +236,9 @@ TEST(HandleCloserTest, CheckStuffedHandle) {
runner.SetTestState(EVERY_STATE);
sandbox::TargetPolicy* policy = runner.GetPolicy();
- for (int i = 0; i < arraysize(kFileExtensions); ++i) {
+ for (const wchar_t* kExtension : kFileExtensions) {
base::string16 handle_name;
- base::win::ScopedHandle marker(GetMarkerFile(kFileExtensions[i]));
+ base::win::ScopedHandle marker(GetMarkerFile(kExtension));
CHECK(marker.IsValid());
CHECK(sandbox::GetHandleName(marker.Get(), &handle_name));
CHECK_EQ(policy->AddKernelObjectToClose(L"File", handle_name.c_str()),
« no previous file with comments | « sandbox/win/src/crosscall_params.h ('k') | sandbox/win/src/interception_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698