Index: base/memory/ref_counted_unittest.cc |
diff --git a/base/memory/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc |
index 54f62cf4cc579cf0525b23386956144a7753ba09..7c4e07af49e4a1e48fba7019d38e4177278a4665 100644 |
--- a/base/memory/ref_counted_unittest.cc |
+++ b/base/memory/ref_counted_unittest.cc |
@@ -204,6 +204,16 @@ TEST(RefCountedUnitTest, Equality) { |
EXPECT_NE(p2, p1); |
} |
+TEST(RefCountedUnitTest, NullptrEquality) { |
+ scoped_refptr<SelfAssign> ptr_to_an_instance(new SelfAssign); |
+ scoped_refptr<SelfAssign> ptr_to_nullptr; |
+ |
+ EXPECT_NE(nullptr, ptr_to_an_instance); |
+ EXPECT_NE(ptr_to_an_instance, nullptr); |
+ EXPECT_EQ(nullptr, ptr_to_nullptr); |
+ EXPECT_EQ(ptr_to_nullptr, nullptr); |
+} |
+ |
TEST(RefCountedUnitTest, ConvertibleEquality) { |
scoped_refptr<Derived> p1(new Derived); |
scoped_refptr<SelfAssign> p2; |