Index: code/trunk/test/core/object/ClassFactoryTest.cc
===================================================================
--- code/trunk/test/core/object/ClassFactoryTest.cc	(revision 9667)
+++ code/trunk/test/core/object/ClassFactoryTest.cc	(revision 10624)
@@ -3,4 +3,6 @@
 #include "core/BaseObject.h"
 #include "core/object/Context.h"
+#include "core/module/ModuleInstance.h"
+#include "core/CoreIncludes.h"
 
 namespace orxonox
@@ -14,4 +16,6 @@
                 virtual void SetUp()
                 {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
                     Context::setRootContext(new Context(NULL));
                 }
@@ -19,5 +23,7 @@
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/object/ContextTest.cc
===================================================================
--- code/trunk/test/core/object/ContextTest.cc	(revision 9667)
+++ code/trunk/test/core/object/ContextTest.cc	(revision 10624)
@@ -3,4 +3,5 @@
 #include "core/class/OrxonoxClass.h"
 #include "core/CoreIncludes.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -14,4 +15,6 @@
         };
 
+        RegisterClassNoArgs(SubclassContext);
+
         // Fixture
         class ContextTest : public ::testing::Test
@@ -20,4 +23,6 @@
                 virtual void SetUp()
                 {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
                     Context::setRootContext(new Context(NULL));
                 }
@@ -25,5 +30,7 @@
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/object/IteratorTest.cc
===================================================================
--- code/trunk/test/core/object/IteratorTest.cc	(revision 9667)
+++ code/trunk/test/core/object/IteratorTest.cc	(revision 10624)
@@ -6,4 +6,5 @@
 #include "core/class/OrxonoxInterface.h"
 #include "core/CoreIncludes.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -24,4 +25,7 @@
         };
 
+        RegisterClassNoArgs(TestInterface);
+        RegisterClassNoArgs(TestClass);
+
         // Fixture
         class IteratorTest : public ::testing::Test
@@ -30,4 +34,6 @@
                 virtual void SetUp()
                 {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
                     Context::setRootContext(new Context(NULL));
                 }
@@ -35,5 +41,7 @@
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/object/ListableTest.cc
===================================================================
--- code/trunk/test/core/object/ListableTest.cc	(revision 9667)
+++ code/trunk/test/core/object/ListableTest.cc	(revision 10624)
@@ -2,4 +2,5 @@
 #include "core/object/Listable.h"
 #include "core/CoreIncludes.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -10,5 +11,5 @@
         {
             public:
-            ListableClassTest() { RegisterObject(ListableClassTest); }
+                ListableClassTest() { RegisterObject(ListableClassTest); }
         };
 
@@ -18,4 +19,7 @@
                 ListableSubclassTest() { RegisterObject(ListableSubclassTest); }
         };
+
+        RegisterClassNoArgs(ListableClassTest);
+        RegisterClassNoArgs(ListableSubclassTest);
 
         template <class T>
@@ -35,4 +39,6 @@
                 virtual void SetUp()
                 {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
                     Context::setRootContext(new Context(NULL));
                 }
@@ -40,5 +46,7 @@
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/object/ObjectListIteratorTest.cc
===================================================================
--- code/trunk/test/core/object/ObjectListIteratorTest.cc	(revision 9667)
+++ code/trunk/test/core/object/ObjectListIteratorTest.cc	(revision 10624)
@@ -5,4 +5,5 @@
 #include "core/object/Listable.h"
 #include "core/CoreIncludes.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -17,4 +18,6 @@
         };
 
+        RegisterClassNoArgs(ListableTest);
+
         // Fixture
         class ObjectListIteratorTest : public ::testing::Test
@@ -23,4 +26,6 @@
                 virtual void SetUp()
                 {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
                     Context::setRootContext(new Context(NULL));
                 }
@@ -28,5 +33,7 @@
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/object/SmartPtrTest.cc
===================================================================
--- code/trunk/test/core/object/SmartPtrTest.cc	(revision 9667)
+++ 	(revision )
@@ -1,93 +1,0 @@
-#include <gtest/gtest.h>
-#include "core/object/SmartPtr.h"
-
-namespace orxonox
-{
-    namespace
-    {
-        class DestroyableTest : public Destroyable
-        {
-            public:
-                DestroyableTest(bool& destroyed) : destroyed_(destroyed) { destroyed_ = false; }
-                virtual ~DestroyableTest() { destroyed_ = true; }
-
-            private:
-                bool& destroyed_;
-        };
-    }
-
-    TEST(SmartPtrTest, CanReferenceObject)
-    {
-        bool bla;
-        DestroyableTest* test = new DestroyableTest(bla);
-        SmartPtr<DestroyableTest> smartPtr = test;
-        EXPECT_EQ(test, smartPtr.get());
-        test->destroy();
-    }
-
-    TEST(SmartPtrTest, IncreasesReferenceCount)
-    {
-        bool bla;
-        DestroyableTest* test = new DestroyableTest(bla);
-        EXPECT_EQ(0u, test->getReferenceCount());
-        {
-            SmartPtr<DestroyableTest> smartPtr = test;
-            EXPECT_EQ(1u, test->getReferenceCount());
-        }
-        EXPECT_EQ(0u, test->getReferenceCount());
-        test->destroy();
-    }
-
-    TEST(SmartPtrTest, DestroyDeletesInstance)
-    {
-        bool destroyed = false;
-        DestroyableTest* test = new DestroyableTest(destroyed);
-        EXPECT_FALSE(destroyed);
-        test->destroy();
-        EXPECT_TRUE(destroyed);
-    }
-
-    TEST(SmartPtrTest, PreventsDestruction)
-    {
-        bool destroyed = false;
-        DestroyableTest* test = new DestroyableTest(destroyed);
-        EXPECT_FALSE(destroyed);
-        SmartPtr<DestroyableTest> smartPtr = test;
-        test->destroy();
-        EXPECT_FALSE(destroyed);
-    }
-
-    TEST(SmartPtrTest, DestroysIfSmartPtrRemoved)
-    {
-        bool destroyed = false;
-        DestroyableTest* test = new DestroyableTest(destroyed);
-        EXPECT_FALSE(destroyed);
-        {
-            SmartPtr<DestroyableTest> smartPtr = test;
-            test->destroy();
-            EXPECT_FALSE(destroyed);
-        }
-        EXPECT_TRUE(destroyed);
-    }
-
-    TEST(SmartPtrTest, DestroysIfAllSmartPtrsRemoved)
-    {
-        bool destroyed = false;
-        DestroyableTest* test = new DestroyableTest(destroyed);
-        EXPECT_FALSE(destroyed);
-        {
-            SmartPtr<DestroyableTest> smartPtr1 = test;
-            {
-                SmartPtr<DestroyableTest> smartPtr2 = test;
-                {
-                    SmartPtr<DestroyableTest> smartPtr3 = test;
-                    test->destroy();
-                    EXPECT_FALSE(destroyed);
-                }
-                EXPECT_FALSE(destroyed);
-            }
-            EXPECT_FALSE(destroyed);
-        }
-        EXPECT_TRUE(destroyed);
-    }
-}
Index: code/trunk/test/core/object/StrongPtrTest.cc
===================================================================
--- code/trunk/test/core/object/StrongPtrTest.cc	(revision 10624)
+++ code/trunk/test/core/object/StrongPtrTest.cc	(revision 10624)
@@ -0,0 +1,143 @@
+#include <gtest/gtest.h>
+#include "core/object/StrongPtr.h"
+
+namespace orxonox
+{
+    namespace
+    {
+        class DestroyableTest : public Destroyable
+        {
+            public:
+                DestroyableTest(bool& destroyed) : destroyed_(destroyed) { destroyed_ = false; }
+                virtual ~DestroyableTest() { destroyed_ = true; }
+
+            private:
+                bool& destroyed_;
+        };
+    }
+
+    TEST(StrongPtrTest, CanReferenceObject)
+    {
+        bool bla;
+        DestroyableTest* test = new DestroyableTest(bla);
+        StrongPtr<DestroyableTest> strongPtr = test;
+        EXPECT_EQ(test, strongPtr.get());
+        test->destroy();
+    }
+
+    TEST(StrongPtrTest, IncreasesReferenceCount)
+    {
+        bool bla;
+        DestroyableTest* test = new DestroyableTest(bla);
+        EXPECT_EQ(0u, test->getReferenceCount());
+        {
+            StrongPtr<DestroyableTest> strongPtr = test;
+            EXPECT_EQ(1u, test->getReferenceCount());
+        }
+        EXPECT_EQ(0u, test->getReferenceCount());
+        test->destroy();
+    }
+
+    TEST(StrongPtrTest, DestroyDeletesInstance)
+    {
+        bool destroyed = false;
+        DestroyableTest* test = new DestroyableTest(destroyed);
+        EXPECT_FALSE(destroyed);
+        test->destroy();
+        EXPECT_TRUE(destroyed);
+    }
+
+    TEST(StrongPtrTest, PreventsDestruction)
+    {
+        bool destroyed = false;
+        DestroyableTest* test = new DestroyableTest(destroyed);
+        EXPECT_FALSE(destroyed);
+        StrongPtr<DestroyableTest> strongPtr = test;
+        test->destroy();
+        EXPECT_FALSE(destroyed);
+    }
+
+    TEST(StrongPtrTest, DestroysIfStrongPtrRemoved)
+    {
+        bool destroyed = false;
+        DestroyableTest* test = new DestroyableTest(destroyed);
+        EXPECT_FALSE(destroyed);
+        {
+            StrongPtr<DestroyableTest> strongPtr = test;
+            test->destroy();
+            EXPECT_FALSE(destroyed);
+        }
+        EXPECT_TRUE(destroyed);
+    }
+
+    TEST(StrongPtrTest, DestroysIfAllStrongPtrsRemoved)
+    {
+        bool destroyed = false;
+        DestroyableTest* test = new DestroyableTest(destroyed);
+        EXPECT_FALSE(destroyed);
+        {
+            StrongPtr<DestroyableTest> strongPtr1 = test;
+            {
+                StrongPtr<DestroyableTest> strongPtr2 = test;
+                {
+                    StrongPtr<DestroyableTest> strongPtr3 = test;
+                    test->destroy();
+                    EXPECT_FALSE(destroyed);
+                }
+                EXPECT_FALSE(destroyed);
+            }
+            EXPECT_FALSE(destroyed);
+        }
+        EXPECT_TRUE(destroyed);
+    }
+
+    void isNull(const StrongPtr<DestroyableTest> strongPtr)
+    {
+        EXPECT_TRUE(strongPtr == NULL);
+        EXPECT_TRUE(strongPtr == 0);
+        EXPECT_TRUE(!strongPtr);
+        EXPECT_FALSE(strongPtr != NULL);
+        EXPECT_FALSE(strongPtr != 0);
+        EXPECT_FALSE(strongPtr);
+    }
+
+    TEST(StrongPtrTest, IsNull)
+    {
+        {
+            StrongPtr<DestroyableTest> strongPtr;
+            isNull(strongPtr);
+        }
+        {
+            StrongPtr<DestroyableTest> strongPtr = NULL;
+            isNull(strongPtr);
+        }
+        {
+            StrongPtr<DestroyableTest> strongPtr;
+            strongPtr = NULL;
+            isNull(strongPtr);
+        }
+        {
+            StrongPtr<DestroyableTest> strongPtr = 0;
+            isNull(strongPtr);
+        }
+        {
+            StrongPtr<DestroyableTest> strongPtr;
+            strongPtr = 0;
+            isNull(strongPtr);
+        }
+    }
+
+    TEST(StrongPtrTest, IsNotNull)
+    {
+        bool destroyed = false;
+        DestroyableTest* test = new DestroyableTest(destroyed);
+        StrongPtr<DestroyableTest> strongPtr = test;
+        EXPECT_FALSE(strongPtr == NULL);
+        EXPECT_FALSE(strongPtr == 0);
+        EXPECT_FALSE(!strongPtr);
+        EXPECT_TRUE(strongPtr != NULL);
+        EXPECT_TRUE(strongPtr != 0);
+        EXPECT_TRUE(strongPtr);
+        test->destroy();
+    }
+}
Index: code/trunk/test/core/object/WeakPtrTest.cc
===================================================================
--- code/trunk/test/core/object/WeakPtrTest.cc	(revision 9667)
+++ code/trunk/test/core/object/WeakPtrTest.cc	(revision 10624)
@@ -45,3 +45,52 @@
         test->destroy();
     }
+
+    void isNull(const WeakPtr<DestroyableTest> weakPtr)
+    {
+        EXPECT_TRUE(weakPtr == NULL);
+        EXPECT_TRUE(weakPtr == 0);
+        EXPECT_TRUE(!weakPtr);
+        EXPECT_FALSE(weakPtr != NULL);
+        EXPECT_FALSE(weakPtr != 0);
+        EXPECT_FALSE(weakPtr);
+    }
+
+    TEST(WeakPtrTest, IsNull)
+    {
+        {
+            WeakPtr<DestroyableTest> weakPtr;
+            isNull(weakPtr);
+        }
+        {
+            WeakPtr<DestroyableTest> weakPtr = NULL;
+            isNull(weakPtr);
+        }
+        {
+            WeakPtr<DestroyableTest> weakPtr;
+            weakPtr = NULL;
+            isNull(weakPtr);
+        }
+        {
+            WeakPtr<DestroyableTest> weakPtr = 0;
+            isNull(weakPtr);
+        }
+        {
+            WeakPtr<DestroyableTest> weakPtr;
+            weakPtr = 0;
+            isNull(weakPtr);
+        }
+    }
+
+    TEST(WeakPtrTest, IsNotNull)
+    {
+        DestroyableTest* test = new DestroyableTest();
+        WeakPtr<DestroyableTest> weakPtr = test;
+        EXPECT_FALSE(weakPtr == NULL);
+        EXPECT_FALSE(weakPtr == 0);
+        EXPECT_FALSE(!weakPtr);
+        EXPECT_TRUE(weakPtr != NULL);
+        EXPECT_TRUE(weakPtr != 0);
+        EXPECT_TRUE(weakPtr);
+        test->destroy();
+    }
 }
