summaryrefslogtreecommitdiffstats
path: root/sandbox/src
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 22:05:45 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 22:05:45 +0000
commitbc2ff51999fe9ef5c041f2df2ffbbdb4c30baec9 (patch)
tree98113aa6f92a67972c0000db1ef6dbd5979f94bd /sandbox/src
parentff0450cc3834b456ab6eb8ee664eb5b98dcecbc0 (diff)
downloadchromium_src-bc2ff51999fe9ef5c041f2df2ffbbdb4c30baec9.zip
chromium_src-bc2ff51999fe9ef5c041f2df2ffbbdb4c30baec9.tar.gz
chromium_src-bc2ff51999fe9ef5c041f2df2ffbbdb4c30baec9.tar.bz2
Implement most of the ridealong fixes/cleanups I suggested during review for enabling warn-on-signed-versus-unsigned-equality-comparisions on Windows.
BUG=none TEST=none Review URL: http://codereview.chromium.org/2395001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48666 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src')
-rw-r--r--sandbox/src/job_unittest.cc16
-rw-r--r--sandbox/src/win_utils_unittest.cc2
2 files changed, 9 insertions, 9 deletions
diff --git a/sandbox/src/job_unittest.cc b/sandbox/src/job_unittest.cc
index f7174e3..0f7010d 100644
--- a/sandbox/src/job_unittest.cc
+++ b/sandbox/src/job_unittest.cc
@@ -20,7 +20,7 @@ TEST(JobTest, TestCreation) {
// check if the job exists.
HANDLE job_handle = ::OpenJobObjectW(GENERIC_ALL, FALSE,
L"my_test_job_name");
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_TRUE(job_handle != NULL);
if (job_handle)
CloseHandle(job_handle);
@@ -28,7 +28,7 @@ TEST(JobTest, TestCreation) {
// Check if the job is destroyed when the object goes out of scope.
HANDLE job_handle = ::OpenJobObjectW(GENERIC_ALL, FALSE, L"my_test_job_name");
- ASSERT_EQ(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_TRUE(job_handle == NULL);
ASSERT_EQ(ERROR_FILE_NOT_FOUND, ::GetLastError());
}
@@ -42,14 +42,14 @@ TEST(JobTest, TestDetach) {
ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0));
job_handle = job.Detach();
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_TRUE(job_handle != NULL);
}
// Check to be sure that the job is still alive even after the object is gone
// out of scope.
HANDLE job_handle_dup = ::OpenJobObjectW(GENERIC_ALL, FALSE,
L"my_test_job_name");
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle_dup);
+ ASSERT_TRUE(job_handle_dup != NULL);
// Remove all references.
if (job_handle_dup)
@@ -60,7 +60,7 @@ TEST(JobTest, TestDetach) {
// Check if the jbo is really dead.
job_handle = ::OpenJobObjectW(GENERIC_ALL, FALSE, L"my_test_job_name");
- ASSERT_EQ(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_TRUE(job_handle == NULL);
ASSERT_EQ(ERROR_FILE_NOT_FOUND, ::GetLastError());
}
@@ -75,7 +75,7 @@ TEST(JobTest, TestExceptions) {
JOB_OBJECT_UILIMIT_READCLIPBOARD));
job_handle = job.Detach();
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_TRUE(job_handle != NULL);
JOBOBJECT_BASIC_UI_RESTRICTIONS jbur = {0};
DWORD size = sizeof(jbur);
@@ -95,7 +95,7 @@ TEST(JobTest, TestExceptions) {
ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0));
job_handle = job.Detach();
- ASSERT_NE(reinterpret_cast<HANDLE>(NULL), job_handle);
+ ASSERT_TRUE(job_handle != NULL);
JOBOBJECT_BASIC_UI_RESTRICTIONS jbur = {0};
DWORD size = sizeof(jbur);
@@ -124,7 +124,7 @@ TEST(JobTest, NoInit) {
Job job;
ASSERT_EQ(ERROR_NO_DATA, job.UserHandleGrantAccess(NULL));
ASSERT_EQ(ERROR_NO_DATA, job.AssignProcessToJob(NULL));
- ASSERT_EQ(reinterpret_cast<HANDLE>(NULL), job.Detach());
+ ASSERT_TRUE(job.Detach() == NULL);
}
// Tests the initialization of the job with different security level.
diff --git a/sandbox/src/win_utils_unittest.cc b/sandbox/src/win_utils_unittest.cc
index 27b49af..3afa78d 100644
--- a/sandbox/src/win_utils_unittest.cc
+++ b/sandbox/src/win_utils_unittest.cc
@@ -37,7 +37,7 @@ TEST(WinUtils, IsReparsePoint) {
HANDLE dir = ::CreateFile(my_folder, FILE_ALL_ACCESS,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
- EXPECT_TRUE(INVALID_HANDLE_VALUE != dir);
+ EXPECT_NE(INVALID_HANDLE_VALUE, dir);
std::wstring temp_dir_nt = std::wstring(L"\\??\\") + temp_directory;
EXPECT_TRUE(SetReparsePoint(dir, temp_dir_nt.c_str()));