| Index: base/memory/ref_counted_unittest.cc
|
| diff --git a/base/memory/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc
|
| index e8eb0fd90f6c507912299eec14a53ef015e027c2..265f31d0ac2b1a9fd3296c6cdfd7a27b277a0e8a 100644
|
| --- a/base/memory/ref_counted_unittest.cc
|
| +++ b/base/memory/ref_counted_unittest.cc
|
| @@ -60,3 +60,20 @@ TEST(RefCountedUnitTest, ScopedRefPtrToSelf) {
|
| check->SelfDestruct();
|
| EXPECT_TRUE(ScopedRefPtrToSelf::was_destroyed());
|
| }
|
| +
|
| +TEST(RefCountedUnitTest, ScopedRefPtrBooleanOperations) {
|
| + scoped_refptr<SelfAssign> p1 = new SelfAssign;
|
| + scoped_refptr<SelfAssign> p2;
|
| + EXPECT_TRUE(p1);
|
| + EXPECT_FALSE(!p1);
|
| + EXPECT_TRUE(!p2);
|
| + EXPECT_FALSE(p2);
|
| + EXPECT_NE(p1, p2);
|
| + SelfAssign* raw_p = new SelfAssign;
|
| + p2 = raw_p;
|
| + EXPECT_NE(p1, p2);
|
| + EXPECT_EQ(raw_p, p2);
|
| + p2 = p1;
|
| + EXPECT_NE(raw_p, p2);
|
| + EXPECT_EQ(p1, p2);
|
| +}
|
|
|