summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 18:13:07 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 18:13:07 +0000
commit9b6fee14acedde5c6b627d5f9b691776fc8d868c (patch)
tree8cd3438dc3b6504066f89096e37db4cff4b903ed /base
parentb1ed7b9beaf3069b54084c453da6db6bed56607c (diff)
downloadchromium_src-9b6fee14acedde5c6b627d5f9b691776fc8d868c.zip
chromium_src-9b6fee14acedde5c6b627d5f9b691776fc8d868c.tar.gz
chromium_src-9b6fee14acedde5c6b627d5f9b691776fc8d868c.tar.bz2
Avoid potential "NULL used as int" warnings by changing ASSERT_EQ(NULL, ...) to ASSERT_TRUE(... == NULL). Patch by Jacob Mandelson (see http://codereview.chromium.org/202057 ), r=me.
BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/field_trial_unittest.cc4
-rw-r--r--base/waitable_event_watcher_unittest.cc6
-rw-r--r--base/weak_ptr_unittest.cc10
3 files changed, 10 insertions, 10 deletions
diff --git a/base/field_trial_unittest.cc b/base/field_trial_unittest.cc
index 430fd67..671376d 100644
--- a/base/field_trial_unittest.cc
+++ b/base/field_trial_unittest.cc
@@ -160,8 +160,8 @@ TEST_F(FieldTrialTest, Save) {
}
TEST_F(FieldTrialTest, Restore) {
- EXPECT_EQ(NULL, FieldTrialList::Find("Some_name"));
- EXPECT_EQ(NULL, FieldTrialList::Find("xxx"));
+ EXPECT_TRUE(FieldTrialList::Find("Some_name") == NULL);
+ EXPECT_TRUE(FieldTrialList::Find("xxx") == NULL);
FieldTrialList::StringAugmentsState("Some_name/Winner/xxx/yyyy/");
diff --git a/base/waitable_event_watcher_unittest.cc b/base/waitable_event_watcher_unittest.cc
index 049de38..c1d930a 100644
--- a/base/waitable_event_watcher_unittest.cc
+++ b/base/waitable_event_watcher_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -38,7 +38,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
WaitableEvent event(true, false);
WaitableEventWatcher watcher;
- EXPECT_EQ(NULL, watcher.GetWatchedEvent());
+ EXPECT_TRUE(watcher.GetWatchedEvent() == NULL);
QuitDelegate delegate;
watcher.StartWatching(&event, &delegate);
@@ -48,7 +48,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
MessageLoop::current()->Run();
- EXPECT_EQ(NULL, watcher.GetWatchedEvent());
+ EXPECT_TRUE(watcher.GetWatchedEvent() == NULL);
}
void RunTest_BasicCancel(MessageLoop::Type message_loop_type) {
diff --git a/base/weak_ptr_unittest.cc b/base/weak_ptr_unittest.cc
index 4f53358..6d38caa 100644
--- a/base/weak_ptr_unittest.cc
+++ b/base/weak_ptr_unittest.cc
@@ -54,13 +54,13 @@ TEST(WeakPtrTest, Comparison) {
TEST(WeakPtrTest, OutOfScope) {
WeakPtr<int> ptr;
- EXPECT_EQ(NULL, ptr.get());
+ EXPECT_TRUE(ptr.get() == NULL);
{
int data;
WeakPtrFactory<int> factory(&data);
ptr = factory.GetWeakPtr();
}
- EXPECT_EQ(NULL, ptr.get());
+ EXPECT_TRUE(ptr.get() == NULL);
}
TEST(WeakPtrTest, Multiple) {
@@ -73,8 +73,8 @@ TEST(WeakPtrTest, Multiple) {
EXPECT_EQ(&data, a.get());
EXPECT_EQ(&data, b.get());
}
- EXPECT_EQ(NULL, a.get());
- EXPECT_EQ(NULL, b.get());
+ EXPECT_TRUE(a.get() == NULL);
+ EXPECT_TRUE(b.get() == NULL);
}
TEST(WeakPtrTest, UpCast) {
@@ -98,7 +98,7 @@ TEST(WeakPtrTest, InvalidateWeakPtrs) {
EXPECT_EQ(&data, ptr.get());
EXPECT_TRUE(factory.HasWeakPtrs());
factory.InvalidateWeakPtrs();
- EXPECT_EQ(NULL, ptr.get());
+ EXPECT_TRUE(ptr.get() == NULL);
EXPECT_FALSE(factory.HasWeakPtrs());
}