| Index: base/mac/scoped_nsobject_unittest.mm
|
| diff --git a/base/memory/scoped_nsobject_unittest.mm b/base/mac/scoped_nsobject_unittest.mm
|
| similarity index 74%
|
| rename from base/memory/scoped_nsobject_unittest.mm
|
| rename to base/mac/scoped_nsobject_unittest.mm
|
| index 8c3f5ecb4903fd0643a6e18661d45413ba6fbb77..f290c3aef0922241b6b445ff79fddaed293a83ba 100644
|
| --- a/base/memory/scoped_nsobject_unittest.mm
|
| +++ b/base/mac/scoped_nsobject_unittest.mm
|
| @@ -6,23 +6,23 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/mac/scoped_nsautorelease_pool.h"
|
| -#include "base/memory/scoped_nsobject.h"
|
| +#include "base/mac/scoped_nsobject.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| namespace {
|
|
|
| TEST(ScopedNSObjectTest, ScopedNSObject) {
|
| - scoped_nsobject<NSObject> p1([[NSObject alloc] init]);
|
| + base::scoped_nsobject<NSObject> p1([[NSObject alloc] init]);
|
| ASSERT_TRUE(p1.get());
|
| ASSERT_EQ(1u, [p1 retainCount]);
|
| - scoped_nsobject<NSObject> p2(p1);
|
| + base::scoped_nsobject<NSObject> p2(p1);
|
| ASSERT_EQ(p1.get(), p2.get());
|
| ASSERT_EQ(2u, [p1 retainCount]);
|
| p2.reset();
|
| ASSERT_EQ(nil, p2.get());
|
| ASSERT_EQ(1u, [p1 retainCount]);
|
| {
|
| - scoped_nsobject<NSObject> p3 = p1;
|
| + base::scoped_nsobject<NSObject> p3 = p1;
|
| ASSERT_EQ(p1.get(), p3.get());
|
| ASSERT_EQ(2u, [p1 retainCount]);
|
| p3 = p1;
|
| @@ -30,19 +30,19 @@ TEST(ScopedNSObjectTest, ScopedNSObject) {
|
| ASSERT_EQ(2u, [p1 retainCount]);
|
| }
|
| ASSERT_EQ(1u, [p1 retainCount]);
|
| - scoped_nsobject<NSObject> p4([p1.get() retain]);
|
| + base::scoped_nsobject<NSObject> p4([p1.get() retain]);
|
| ASSERT_EQ(2u, [p1 retainCount]);
|
| ASSERT_TRUE(p1 == p1.get());
|
| ASSERT_TRUE(p1 == p1);
|
| ASSERT_FALSE(p1 != p1);
|
| ASSERT_FALSE(p1 != p1.get());
|
| - scoped_nsobject<NSObject> p5([[NSObject alloc] init]);
|
| + base::scoped_nsobject<NSObject> p5([[NSObject alloc] init]);
|
| ASSERT_TRUE(p1 != p5);
|
| ASSERT_TRUE(p1 != p5.get());
|
| ASSERT_FALSE(p1 == p5);
|
| ASSERT_FALSE(p1 == p5.get());
|
|
|
| - scoped_nsobject<NSObject> p6 = p1;
|
| + base::scoped_nsobject<NSObject> p6 = p1;
|
| ASSERT_EQ(3u, [p6 retainCount]);
|
| {
|
| base::mac::ScopedNSAutoreleasePool pool;
|
| @@ -54,15 +54,15 @@ TEST(ScopedNSObjectTest, ScopedNSObject) {
|
| }
|
|
|
| TEST(ScopedNSObjectTest, ScopedNSObjectInContainer) {
|
| - scoped_nsobject<id> p([[NSObject alloc] init]);
|
| + base::scoped_nsobject<id> p([[NSObject alloc] init]);
|
| ASSERT_TRUE(p.get());
|
| ASSERT_EQ(1u, [p retainCount]);
|
| {
|
| - std::vector<scoped_nsobject<id> > objects;
|
| + std::vector<base::scoped_nsobject<id>> objects;
|
| objects.push_back(p);
|
| ASSERT_EQ(2u, [p retainCount]);
|
| ASSERT_EQ(p.get(), objects[0].get());
|
| - objects.push_back(scoped_nsobject<id>([[NSObject alloc] init]));
|
| + objects.push_back(base::scoped_nsobject<id>([[NSObject alloc] init]));
|
| ASSERT_TRUE(objects[1].get());
|
| ASSERT_EQ(1u, [objects[1] retainCount]);
|
| }
|
| @@ -70,11 +70,11 @@ TEST(ScopedNSObjectTest, ScopedNSObjectInContainer) {
|
| }
|
|
|
| TEST(ScopedNSObjectTest, ScopedNSObjectFreeFunctions) {
|
| - scoped_nsobject<id> p1([[NSObject alloc] init]);
|
| + base::scoped_nsobject<id> p1([[NSObject alloc] init]);
|
| id o1 = p1.get();
|
| ASSERT_TRUE(o1 == p1);
|
| ASSERT_FALSE(o1 != p1);
|
| - scoped_nsobject<id> p2([[NSObject alloc] init]);
|
| + base::scoped_nsobject<id> p2([[NSObject alloc] init]);
|
| ASSERT_TRUE(o1 != p2);
|
| ASSERT_FALSE(o1 == p2);
|
| id o2 = p2.get();
|
|
|