summaryrefslogtreecommitdiffstats
path: root/chrome/common
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 /chrome/common
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 'chrome/common')
-rw-r--r--chrome/common/extensions/extension_unittest.cc8
-rw-r--r--chrome/common/property_bag_unittest.cc10
2 files changed, 9 insertions, 9 deletions
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index 249c719..43e116f 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -283,14 +283,14 @@ TEST(ExtensionTest, LoadPageActionHelper) {
DictionaryValue input;
// First try with an empty dictionary. We should get nothing back.
- ASSERT_EQ(NULL, extension.LoadExtensionActionHelper(
- &input, 0, &error_msg, ExtensionAction::PAGE_ACTION));
+ ASSERT_TRUE(extension.LoadExtensionActionHelper(
+ &input, 0, &error_msg, ExtensionAction::PAGE_ACTION) == NULL);
ASSERT_STRNE("", error_msg.c_str());
error_msg = "";
// Now try the same, but as a browser action. Ensure same results.
- ASSERT_EQ(NULL, extension.LoadExtensionActionHelper(
- &input, 0, &error_msg, ExtensionAction::BROWSER_ACTION));
+ ASSERT_TRUE(extension.LoadExtensionActionHelper(
+ &input, 0, &error_msg, ExtensionAction::BROWSER_ACTION) == NULL);
ASSERT_STRNE("", error_msg.c_str());
error_msg = "";
diff --git a/chrome/common/property_bag_unittest.cc b/chrome/common/property_bag_unittest.cc
index 51db07c..f63bbc2 100644
--- a/chrome/common/property_bag_unittest.cc
+++ b/chrome/common/property_bag_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.
@@ -10,7 +10,7 @@ TEST(PropertyBagTest, AddQueryRemove) {
PropertyAccessor<int> adaptor;
// Should be no match initially.
- EXPECT_EQ(NULL, adaptor.GetProperty(&bag));
+ EXPECT_TRUE(adaptor.GetProperty(&bag) == NULL);
// Add the value and make sure we get it back.
const int kFirstValue = 1;
@@ -26,7 +26,7 @@ TEST(PropertyBagTest, AddQueryRemove) {
// Remove the value and make sure it's gone.
adaptor.DeleteProperty(&bag);
- EXPECT_EQ(NULL, adaptor.GetProperty(&bag));
+ EXPECT_TRUE(adaptor.GetProperty(&bag) == NULL);
}
TEST(PropertyBagTest, Copy) {
@@ -57,6 +57,6 @@ TEST(PropertyBagTest, Copy) {
// Clear it out, neither property should be left.
copy = PropertyBag();
- EXPECT_EQ(NULL, adaptor1.GetProperty(&copy));
- EXPECT_EQ(NULL, adaptor2.GetProperty(&copy));
+ EXPECT_TRUE(adaptor1.GetProperty(&copy) == NULL);
+ EXPECT_TRUE(adaptor2.GetProperty(&copy) == NULL);
}