Index: code/trunk/test/util/SharedPtrTest.cc
===================================================================
--- code/trunk/test/util/SharedPtrTest.cc	(revision 9550)
+++ code/trunk/test/util/SharedPtrTest.cc	(revision 11071)
@@ -1,5 +1,6 @@
+#include <memory>
+#include <utility>
 #include <gtest/gtest.h>
 #include <gmock/gmock.h>
-#include "util/SharedPtr.h"
 
 namespace orxonox
@@ -27,9 +28,9 @@
         };
 
-        class TestClassMock : public TestClass
+        class TestChildClassMock : public TestChildClass
         {
             public:
-                TestClassMock() {}
-                ~TestClassMock() { objectDestroyed(); }
+                TestChildClassMock() {}
+                ~TestChildClassMock() { objectDestroyed(); }
 
                 MOCK_METHOD0(objectDestroyed, void());
@@ -39,6 +40,6 @@
     TEST(SharedPtr, ConstructorDefault)
     {
-        SharedPtr<TestClass> test;
-        EXPECT_EQ(0, test.get());
+        std::shared_ptr<TestClass> test;
+        EXPECT_EQ(nullptr, test.get());
     }
 
@@ -47,6 +48,7 @@
         TestClass* pointer = new TestClass();
 
-        SharedPtr<TestClass> test = pointer;
-        EXPECT_EQ(pointer, test.get());
+        std::shared_ptr<TestClass> test(pointer);
+        EXPECT_EQ(pointer, test.get());
+        EXPECT_EQ(pointer, &(*test));
     }
 
@@ -55,5 +57,5 @@
         TestChildClass* pointer = new TestChildClass();
 
-        SharedPtr<TestClass> test = pointer;
+        std::shared_ptr<TestClass> test(pointer);
         EXPECT_EQ(pointer, test.get());
     }
@@ -63,8 +65,8 @@
         TestClass* pointer = new TestClass();
 
-        SharedPtr<TestClass> other = pointer;
-        EXPECT_EQ(pointer, other.get());
-
-        SharedPtr<TestClass> test = other;
+        std::shared_ptr<TestClass> other(pointer);
+        EXPECT_EQ(pointer, other.get());
+
+        std::shared_ptr<TestClass> test = other;
         EXPECT_EQ(pointer, test.get());
     }
@@ -74,8 +76,8 @@
         TestChildClass* pointer = new TestChildClass();
 
-        SharedPtr<TestChildClass> other = pointer;
-        EXPECT_EQ(pointer, other.get());
-
-        SharedPtr<TestClass> test = other;
+        std::shared_ptr<TestChildClass> other(pointer);
+        EXPECT_EQ(pointer, other.get());
+
+        std::shared_ptr<TestClass> test = other;
         EXPECT_EQ(pointer, test.get());
     }
@@ -85,9 +87,9 @@
         TestClass* pointer = new TestClass();
 
-        SharedPtr<TestClass> other = pointer;
-        EXPECT_EQ(pointer, other.get());
-
-        SharedPtr<TestClass> test;
-        EXPECT_EQ(0, test.get());
+        std::shared_ptr<TestClass> other(pointer);
+        EXPECT_EQ(pointer, other.get());
+
+        std::shared_ptr<TestClass> test;
+        EXPECT_EQ(nullptr, test.get());
 
         test = other;
@@ -99,9 +101,9 @@
         TestChildClass* pointer = new TestChildClass();
 
-        SharedPtr<TestChildClass> other = pointer;
-        EXPECT_EQ(pointer, other.get());
-
-        SharedPtr<TestClass> test;
-        EXPECT_EQ(0, test.get());
+        std::shared_ptr<TestChildClass> other(pointer);
+        EXPECT_EQ(pointer, other.get());
+
+        std::shared_ptr<TestClass> test;
+        EXPECT_EQ(nullptr, test.get());
 
         test = other;
@@ -113,8 +115,8 @@
         TestChildClass* pointer = new TestChildClass();
 
-        SharedPtr<TestChildClass> other = pointer;
-        EXPECT_EQ(pointer, other.get());
-
-        SharedPtr<TestClass> test = other.cast<TestClass>();
+        std::shared_ptr<TestChildClass> other(pointer);
+        EXPECT_EQ(pointer, other.get());
+
+        std::shared_ptr<TestClass> test = std::static_pointer_cast<TestClass>(other);
         EXPECT_EQ(pointer, test.get());
     }
@@ -124,5 +126,5 @@
         TestClass* pointer = new TestClass();
 
-        SharedPtr<TestClass> test = pointer;
+        std::shared_ptr<TestClass> test(pointer);
         EXPECT_EQ(pointer, test.get());
 
@@ -135,13 +137,13 @@
     TEST(SharedPtr, Boolean)
     {
-        SharedPtr<TestClass> test;
-        EXPECT_EQ(0, test.get());
+        std::shared_ptr<TestClass> test;
+        EXPECT_EQ(nullptr, test.get());
         EXPECT_FALSE(test);
 
         TestClass* pointer = new TestClass();
 
-        test = pointer;
-        EXPECT_EQ(pointer, test.get());
-        EXPECT_TRUE(test);
+        test.reset(pointer);
+        EXPECT_EQ(pointer, test.get());
+        EXPECT_TRUE(static_cast<bool>(test));
     }
 
@@ -151,6 +153,6 @@
         TestClass* pointer2 = new TestClass();
 
-        SharedPtr<TestClass> test1 = pointer1;
-        SharedPtr<TestClass> test2 = pointer2;
+        std::shared_ptr<TestClass> test1(pointer1);
+        std::shared_ptr<TestClass> test2(pointer2);
 
         EXPECT_EQ(pointer1, test1.get());
@@ -165,6 +167,6 @@
     TEST(SharedPtr, ObjectDestroyedOnePointer)
     {
-        TestClassMock* pointer = new TestClassMock();
-        SharedPtr<TestClass> test = pointer;
+        TestChildClassMock* pointer = new TestChildClassMock();
+        std::shared_ptr<TestClass> test(pointer);
 
         EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
@@ -173,10 +175,93 @@
     TEST(SharedPtr, ObjectDestroyedManyPointers)
     {
-        TestClassMock* pointer = new TestClassMock();
-
-        SharedPtr<TestClass> test = pointer;
-        std::vector<SharedPtr<TestClass> > tests;
+        TestChildClassMock* pointer = new TestChildClassMock();
+
+        std::shared_ptr<TestClass> test(pointer);
+        std::vector<std::shared_ptr<TestClass>> tests;
         for (size_t i = 0; i < 100; ++i)
-            tests.push_back(SharedPtr<TestClass>(test));
+            tests.push_back(std::shared_ptr<TestClass>(test));
+
+        EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
+    }
+
+    TEST(SharedPtr, TestConstructors)
+    {
+        {
+        TestChildClassMock* pointer = new TestChildClassMock();
+
+        // default
+        std::shared_ptr<TestChildClass> sharedPtr1;
+        EXPECT_EQ(nullptr, sharedPtr1.get());
+
+        // pointer
+        std::shared_ptr<TestChildClass> sharedPtr2(pointer);
+        EXPECT_EQ(pointer, sharedPtr2.get());
+
+        // copy
+        std::shared_ptr<TestChildClass> sharedPtr3(sharedPtr2);
+        EXPECT_EQ(pointer, sharedPtr3.get());
+
+        // move
+        std::shared_ptr<TestChildClass> sharedPtr4(std::move(sharedPtr3));
+        EXPECT_EQ(pointer, sharedPtr4.get());
+
+        // other
+        std::shared_ptr<TestClass> sharedPtr5(sharedPtr4);
+        EXPECT_EQ(pointer, sharedPtr5.get());
+
+        EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
+        }
+    }
+
+    TEST(SharedPtr, TestConstructors2)
+    {
+        {
+        TestChildClassMock* pointer = new TestChildClassMock();
+
+        // default
+        std::shared_ptr<TestChildClass> sharedPtr1;
+        EXPECT_EQ(nullptr, sharedPtr1.get());
+
+        // pointer
+        std::shared_ptr<TestChildClass> sharedPtr2(pointer);
+        EXPECT_EQ(pointer, sharedPtr2.get());
+
+        // copy
+        std::shared_ptr<TestChildClass> sharedPtr3 = sharedPtr2;
+        EXPECT_EQ(pointer, sharedPtr3.get());
+
+        // move
+        std::shared_ptr<TestChildClass> sharedPtr4 = std::move(sharedPtr3);
+        EXPECT_EQ(pointer, sharedPtr4.get());
+
+        // other
+        std::shared_ptr<TestClass> sharedPtr5 = sharedPtr4;
+        EXPECT_EQ(pointer, sharedPtr5.get());
+
+        EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
+        }
+    }
+
+    TEST(SharedPtr, TestAssignments)
+    {
+        TestChildClassMock* pointer = new TestChildClassMock();
+
+        std::shared_ptr<TestChildClass> sharedPtr1(pointer);
+        EXPECT_EQ(pointer, sharedPtr1.get());
+
+        // copy
+        std::shared_ptr<TestChildClass> sharedPtr2;
+        sharedPtr2 = sharedPtr1;
+        EXPECT_EQ(pointer, sharedPtr2.get());
+
+        // move
+        std::shared_ptr<TestChildClass> sharedPtr3;
+        sharedPtr3 = std::move(sharedPtr2);
+        EXPECT_EQ(pointer, sharedPtr3.get());
+
+        // other
+        std::shared_ptr<TestClass> sharedPtr4;
+        sharedPtr4 = sharedPtr3;
+        EXPECT_EQ(pointer, sharedPtr4.get());
 
         EXPECT_CALL(*pointer, objectDestroyed()).Times(1);
