Index: /code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h
===================================================================
--- /code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h	(revision 10743)
+++ /code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h	(revision 10744)
@@ -158,5 +158,5 @@
             /// Copy-constructor for strong pointers to objects of another class.
             template <class O>
-            inline StrongPtr(const StrongPtr<O>& other) : pointer_(other.get()), base_(other.base_)
+            inline StrongPtr(const StrongPtr<O>& other) : pointer_(other.get()), base_(other.getBase())
             {
                 if (this->base_)
Index: /code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h
===================================================================
--- /code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h	(revision 10743)
+++ /code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h	(revision 10744)
@@ -118,5 +118,5 @@
             /// Copy-constructor for weak pointers to objects of another class.
             template <class O>
-            inline WeakPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.base_), callback_(0)
+            inline WeakPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.getBase()), callback_(0)
             {
                 this->registerAsDestructionListener(this->base_);
Index: /code/branches/cpp11_v2/test/core/object/StrongPtrTest.cc
===================================================================
--- /code/branches/cpp11_v2/test/core/object/StrongPtrTest.cc	(revision 10743)
+++ /code/branches/cpp11_v2/test/core/object/StrongPtrTest.cc	(revision 10744)
@@ -1,2 +1,3 @@
+#include <utility>
 #include <gtest/gtest.h>
 #include "core/object/StrongPtr.h"
@@ -23,4 +24,20 @@
         StrongPtr<DestroyableTest> strongPtr = test;
         EXPECT_EQ(test, strongPtr.get());
+        EXPECT_EQ(test, &(*strongPtr));
+        EXPECT_EQ(static_cast<Destroyable*>(test), strongPtr.getBase());
+        test->destroy();
+    }
+
+    TEST(StrongPtrTest, CanHaveMultiplePointers)
+    {
+        bool bla;
+        DestroyableTest* test = new DestroyableTest(bla);
+        StrongPtr<DestroyableTest> strongPtr1 = test;
+        StrongPtr<DestroyableTest> strongPtr2 = test;
+        StrongPtr<DestroyableTest> strongPtr3 = test;
+        EXPECT_EQ(test, strongPtr1.get());
+        EXPECT_EQ(test, strongPtr2.get());
+        EXPECT_EQ(test, strongPtr3.get());
+        EXPECT_EQ(3u, test->getReferenceCount());
         test->destroy();
     }
@@ -141,3 +158,151 @@
         test->destroy();
     }
+
+    TEST(StrongPtrTest, TestConstructors)
+    {
+        bool bla;
+        DestroyableTest* test = new DestroyableTest(bla);
+
+        // default
+        StrongPtr<DestroyableTest> strongPtr1;
+        EXPECT_EQ(NULL, strongPtr1.get());
+
+        // pointer
+        StrongPtr<DestroyableTest> strongPtr2a = test;
+        StrongPtr<DestroyableTest> strongPtr2b(test);
+        EXPECT_EQ(test, strongPtr2a.get());
+        EXPECT_EQ(test, strongPtr2b.get());
+
+        // copy
+        StrongPtr<DestroyableTest> strongPtr3a = strongPtr2a;
+        StrongPtr<DestroyableTest> strongPtr3b(strongPtr2b);
+        EXPECT_EQ(test, strongPtr3a.get());
+        EXPECT_EQ(test, strongPtr3b.get());
+
+        // move
+        StrongPtr<DestroyableTest> strongPtr4a = std::move(strongPtr3a);
+        StrongPtr<DestroyableTest> strongPtr4b(std::move(strongPtr3b));
+        EXPECT_EQ(test, strongPtr4a.get());
+        EXPECT_EQ(test, strongPtr4b.get());
+
+        // other
+        StrongPtr<Destroyable> strongPtr5a = strongPtr4a;
+        StrongPtr<Destroyable> strongPtr5b(strongPtr4b);
+        EXPECT_EQ(test, strongPtr5a.get());
+        EXPECT_EQ(test, strongPtr5b.get());
+
+        // weakPtr
+        WeakPtr<DestroyableTest> weakPtr = test;
+        StrongPtr<DestroyableTest> strongPtr6a = weakPtr;
+        StrongPtr<DestroyableTest> strongPtr6b(weakPtr);
+        EXPECT_EQ(test, strongPtr6a.get());
+        EXPECT_EQ(test, strongPtr6b.get());
+
+        // weakPtr other
+        StrongPtr<Destroyable> strongPtr7a = weakPtr;
+        StrongPtr<Destroyable> strongPtr7b(weakPtr);
+        EXPECT_EQ(test, strongPtr7a.get());
+        EXPECT_EQ(test, strongPtr7b.get());
+
+        test->destroy();
+    }
+
+    TEST(StrongPtrTest, TestAssignments)
+    {
+        bool bla;
+        DestroyableTest* test = new DestroyableTest(bla);
+
+        // pointer
+        StrongPtr<DestroyableTest> strongPtr1;
+        strongPtr1 = test;
+        EXPECT_EQ(test, strongPtr1.get());
+
+        // copy
+        StrongPtr<DestroyableTest> strongPtr2;
+        strongPtr2 = strongPtr1;
+        EXPECT_EQ(test, strongPtr2.get());
+
+        // move
+        StrongPtr<DestroyableTest> strongPtr3;
+        strongPtr3 = std::move(strongPtr2);
+        EXPECT_EQ(test, strongPtr3.get());
+
+        // other
+        StrongPtr<Destroyable> strongPtr4;
+        strongPtr4 = strongPtr3;
+        EXPECT_EQ(test, strongPtr4.get());
+
+        // weakPtr
+        WeakPtr<DestroyableTest> weakPtr = test;
+        StrongPtr<DestroyableTest> strongPtr5;
+        strongPtr5 = weakPtr;
+        EXPECT_EQ(test, strongPtr5.get());
+
+        // weakPtr other
+        StrongPtr<Destroyable> strongPtr6;
+        strongPtr6 = weakPtr;
+        EXPECT_EQ(test, strongPtr6.get());
+
+        test->destroy();
+    }
+
+    TEST(StrongPtrTest, TestStrongPtrInVector)
+    {
+        bool bla;
+        DestroyableTest* test = new DestroyableTest(bla);
+
+        std::vector<StrongPtr<DestroyableTest>> vector;
+        vector.push_back(test);
+        vector.push_back(test);
+        vector.push_back(test);
+
+        ASSERT_EQ(3, vector.size());
+        EXPECT_EQ(test, vector[0].get());
+        EXPECT_EQ(test, vector[1].get());
+        EXPECT_EQ(test, vector[2].get());
+        EXPECT_EQ(3u, test->getReferenceCount());
+
+        vector.clear();
+        EXPECT_EQ(0u, test->getReferenceCount());
+
+        test->destroy();
+    }
+
+    TEST(StrongPtrTest, TestReset)
+    {
+        bool bla;
+        DestroyableTest* test = new DestroyableTest(bla);
+        StrongPtr<DestroyableTest> strongPtr(test);
+        EXPECT_EQ(test, strongPtr.get());
+        EXPECT_EQ(1u, test->getReferenceCount());
+        strongPtr.reset();
+        EXPECT_EQ(NULL, strongPtr.get());
+        EXPECT_EQ(0u, test->getReferenceCount());
+
+        test->destroy();
+    }
+
+    TEST(StrongPtrTest, TestSwap)
+    {
+        bool bla;
+        DestroyableTest* test1 = new DestroyableTest(bla);
+        DestroyableTest* test2 = new DestroyableTest(bla);
+
+        StrongPtr<DestroyableTest> strongPtr1(test1);
+        StrongPtr<DestroyableTest> strongPtr2(test2);
+        EXPECT_EQ(test1, strongPtr1.get());
+        EXPECT_EQ(test2, strongPtr2.get());
+        EXPECT_EQ(1u, test1->getReferenceCount());
+        EXPECT_EQ(1u, test2->getReferenceCount());
+
+        strongPtr1.swap(strongPtr2);
+
+        EXPECT_EQ(test2, strongPtr1.get());
+        EXPECT_EQ(test1, strongPtr2.get());
+        EXPECT_EQ(1u, test1->getReferenceCount());
+        EXPECT_EQ(1u, test2->getReferenceCount());
+
+        test1->destroy();
+        test2->destroy();
+    }
 }
Index: /code/branches/cpp11_v2/test/core/object/WeakPtrTest.cc
===================================================================
--- /code/branches/cpp11_v2/test/core/object/WeakPtrTest.cc	(revision 10743)
+++ /code/branches/cpp11_v2/test/core/object/WeakPtrTest.cc	(revision 10744)
@@ -1,2 +1,3 @@
+#include <utility>
 #include <gtest/gtest.h>
 #include <gmock/gmock.h>
@@ -24,4 +25,6 @@
         WeakPtr<DestroyableTest> weakPtr = test;
         EXPECT_EQ(test, weakPtr.get());
+        EXPECT_EQ(test, &(*weakPtr));
+        EXPECT_EQ(static_cast<Destroyable*>(test), weakPtr.getBase());
         test->destroy();
     }
@@ -34,4 +37,19 @@
         test->destroy();
         EXPECT_EQ(NULL, weakPtr.get());
+    }
+
+    TEST(WeakPtrTest, CanHaveMultiplePointers)
+    {
+        DestroyableTest* test = new DestroyableTest();
+        WeakPtr<DestroyableTest> weakPtr1 = test;
+        WeakPtr<DestroyableTest> weakPtr2 = test;
+        WeakPtr<DestroyableTest> weakPtr3 = test;
+        EXPECT_EQ(test, weakPtr1.get());
+        EXPECT_EQ(test, weakPtr2.get());
+        EXPECT_EQ(test, weakPtr3.get());
+        test->destroy();
+        EXPECT_EQ(NULL, weakPtr1.get());
+        EXPECT_EQ(NULL, weakPtr2.get());
+        EXPECT_EQ(NULL, weakPtr3.get());
     }
 
@@ -94,3 +112,116 @@
         test->destroy();
     }
+
+    TEST(WeakPtrTest, TestConstructors)
+    {
+        DestroyableTest* test = new DestroyableTest();
+
+        // default
+        WeakPtr<DestroyableTest> weakPtr1;
+        EXPECT_EQ(NULL, weakPtr1.get());
+
+        // pointer
+        WeakPtr<DestroyableTest> weakPtr2a = test;
+        WeakPtr<DestroyableTest> weakPtr2b(test);
+        EXPECT_EQ(test, weakPtr2a.get());
+        EXPECT_EQ(test, weakPtr2b.get());
+
+        // copy
+        WeakPtr<DestroyableTest> weakPtr3a = weakPtr2a;
+        WeakPtr<DestroyableTest> weakPtr3b(weakPtr2b);
+        EXPECT_EQ(test, weakPtr3a.get());
+        EXPECT_EQ(test, weakPtr3b.get());
+
+        // move
+        WeakPtr<DestroyableTest> weakPtr4a = std::move(weakPtr3a);
+        WeakPtr<DestroyableTest> weakPtr4b(std::move(weakPtr3b));
+        EXPECT_EQ(test, weakPtr4a.get());
+        EXPECT_EQ(test, weakPtr4b.get());
+
+        // other
+        WeakPtr<Destroyable> weakPtr5a = weakPtr4a;
+        WeakPtr<Destroyable> weakPtr5b(weakPtr4b);
+        EXPECT_EQ(test, weakPtr5a.get());
+        EXPECT_EQ(test, weakPtr5b.get());
+
+        test->destroy();
+    }
+
+    TEST(WeakPtrTest, TestAssignments)
+    {
+        DestroyableTest* test = new DestroyableTest();
+
+        // pointer
+        WeakPtr<DestroyableTest> weakPtr1;
+        weakPtr1 = test;
+        EXPECT_EQ(test, weakPtr1.get());
+
+        // copy
+        WeakPtr<DestroyableTest> weakPtr2;
+        weakPtr2 = weakPtr1;
+        EXPECT_EQ(test, weakPtr2.get());
+
+        // move
+        WeakPtr<DestroyableTest> weakPtr3;
+        weakPtr3 = std::move(weakPtr2);
+        EXPECT_EQ(test, weakPtr3.get());
+
+        // other
+        WeakPtr<Destroyable> weakPtr4;
+        weakPtr4 = weakPtr3;
+        EXPECT_EQ(test, weakPtr4.get());
+
+        test->destroy();
+    }
+
+    TEST(WeakPtrTest, TestWeakPtrInVector)
+    {
+        DestroyableTest* test = new DestroyableTest();
+
+        std::vector<WeakPtr<DestroyableTest>> vector;
+        vector.push_back(test);
+        vector.push_back(test);
+        vector.push_back(test);
+
+        ASSERT_EQ(3, vector.size());
+        EXPECT_EQ(test, vector[0].get());
+        EXPECT_EQ(test, vector[1].get());
+        EXPECT_EQ(test, vector[2].get());
+
+        test->destroy();
+
+        EXPECT_EQ(NULL, vector[0].get());
+        EXPECT_EQ(NULL, vector[1].get());
+        EXPECT_EQ(NULL, vector[2].get());
+    }
+
+    TEST(WeakPtrTest, TestReset)
+    {
+        DestroyableTest* test = new DestroyableTest();
+        WeakPtr<DestroyableTest> weakPtr(test);
+        EXPECT_EQ(test, weakPtr.get());
+        weakPtr.reset();
+        EXPECT_EQ(NULL, weakPtr.get());
+
+        test->destroy();
+    }
+
+    TEST(WeakPtrTest, TestSwap)
+    {
+        DestroyableTest* test1 = new DestroyableTest();
+        DestroyableTest* test2 = new DestroyableTest();
+
+        WeakPtr<DestroyableTest> weakPtr1(test1);
+        WeakPtr<DestroyableTest> weakPtr2(test2);
+        EXPECT_EQ(test1, weakPtr1.get());
+        EXPECT_EQ(test2, weakPtr2.get());
+
+        weakPtr1.swap(weakPtr2);
+
+        EXPECT_EQ(test2, weakPtr1.get());
+        EXPECT_EQ(test1, weakPtr2.get());
+
+        test1->destroy();
+        test2->destroy();
+    }
 }
Index: /code/branches/cpp11_v2/test/util/SharedPtrTest.cc
===================================================================
--- /code/branches/cpp11_v2/test/util/SharedPtrTest.cc	(revision 10743)
+++ /code/branches/cpp11_v2/test/util/SharedPtrTest.cc	(revision 10744)
@@ -1,2 +1,3 @@
+#include <utility>
 #include <gtest/gtest.h>
 #include <gmock/gmock.h>
@@ -27,9 +28,9 @@
         };
 
-        class TestClassMock : public TestClass
+        class TestChildClassMock : public TestChildClass
         {
             public:
-                TestClassMock() {}
-                ~TestClassMock() { objectDestroyed(); }
+                TestChildClassMock() {}
+                ~TestChildClassMock() { objectDestroyed(); }
 
                 MOCK_METHOD0(objectDestroyed, void());
@@ -49,4 +50,5 @@
         SharedPtr<TestClass> test = pointer;
         EXPECT_EQ(pointer, test.get());
+        EXPECT_EQ(pointer, &(*test));
     }
 
@@ -165,5 +167,5 @@
     TEST(SharedPtr, ObjectDestroyedOnePointer)
     {
-        TestClassMock* pointer = new TestClassMock();
+        TestChildClassMock* pointer = new TestChildClassMock();
         SharedPtr<TestClass> test = pointer;
 
@@ -173,5 +175,5 @@
     TEST(SharedPtr, ObjectDestroyedManyPointers)
     {
-        TestClassMock* pointer = new TestClassMock();
+        TestChildClassMock* pointer = new TestChildClassMock();
 
         SharedPtr<TestClass> test = pointer;
@@ -182,3 +184,86 @@
         EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
     }
+
+    TEST(SharedPtr, TestConstructors)
+    {
+        {
+        TestChildClassMock* pointer = new TestChildClassMock();
+
+        // default
+        SharedPtr<TestChildClass> sharedPtr1;
+        EXPECT_EQ(NULL, sharedPtr1.get());
+
+        // pointer
+        SharedPtr<TestChildClass> sharedPtr2(pointer);
+        EXPECT_EQ(pointer, sharedPtr2.get());
+
+        // copy
+        SharedPtr<TestChildClass> sharedPtr3(sharedPtr2);
+        EXPECT_EQ(pointer, sharedPtr3.get());
+
+        // move
+        SharedPtr<TestChildClass> sharedPtr4(std::move(sharedPtr3));
+        EXPECT_EQ(pointer, sharedPtr4.get());
+
+        // other
+        SharedPtr<TestClass> sharedPtr5(sharedPtr4);
+        EXPECT_EQ(pointer, sharedPtr5.get());
+
+        EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
+        }
+    }
+
+    TEST(SharedPtr, TestConstructors2)
+    {
+        {
+        TestChildClassMock* pointer = new TestChildClassMock();
+
+        // default
+        SharedPtr<TestChildClass> sharedPtr1;
+        EXPECT_EQ(NULL, sharedPtr1.get());
+
+        // pointer
+        SharedPtr<TestChildClass> sharedPtr2 = pointer;
+        EXPECT_EQ(pointer, sharedPtr2.get());
+
+        // copy
+        SharedPtr<TestChildClass> sharedPtr3 = sharedPtr2;
+        EXPECT_EQ(pointer, sharedPtr3.get());
+
+        // move
+        SharedPtr<TestChildClass> sharedPtr4 = std::move(sharedPtr3);
+        EXPECT_EQ(pointer, sharedPtr4.get());
+
+        // other
+        SharedPtr<TestClass> sharedPtr5 = sharedPtr4;
+        EXPECT_EQ(pointer, sharedPtr5.get());
+
+        EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
+        }
+    }
+
+    TEST(SharedPtr, TestAssignments)
+    {
+        TestChildClassMock* pointer = new TestChildClassMock();
+
+        SharedPtr<TestChildClass> sharedPtr1(pointer);
+        EXPECT_EQ(pointer, sharedPtr1.get());
+
+        // copy
+        SharedPtr<TestChildClass> sharedPtr2;
+        sharedPtr2 = sharedPtr1;
+        EXPECT_EQ(pointer, sharedPtr2.get());
+
+        // move
+        SharedPtr<TestChildClass> sharedPtr3;
+        sharedPtr3 = std::move(sharedPtr2);
+        EXPECT_EQ(pointer, sharedPtr3.get());
+
+        // other
+        SharedPtr<TestClass> sharedPtr4;
+        sharedPtr4 = sharedPtr3;
+        EXPECT_EQ(pointer, sharedPtr4.get());
+
+        EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
+    }
 }
