Index: code/trunk/test/core/CMakeLists.txt
===================================================================
--- code/trunk/test/core/CMakeLists.txt	(revision 10197)
+++ code/trunk/test/core/CMakeLists.txt	(revision 10624)
@@ -12,4 +12,5 @@
     class/IdentifierClassHierarchyTest.cc
     class/IdentifierSimpleClassHierarchyTest.cc
+    class/IdentifierNestedClassHierarchyTest.cc
     class/IdentifierExternalClassHierarchyTest.cc
     class/OrxonoxClassTest.cc
@@ -25,6 +26,7 @@
     object/ObjectListBaseTest.cc
     object/ObjectListIteratorTest.cc
-    object/SmartPtrTest.cc
+    object/StrongPtrTest.cc
     object/WeakPtrTest.cc
+    singleton/ScopeTest.cc
 )
 ADD_DEPENDENCIES(all_tests core_test)
Index: code/trunk/test/core/class/IdentifiableTest.cc
===================================================================
--- code/trunk/test/core/class/IdentifiableTest.cc	(revision 10197)
+++ code/trunk/test/core/class/IdentifiableTest.cc	(revision 10624)
@@ -2,4 +2,5 @@
 #include "core/CoreIncludes.h"
 #include "core/class/Identifiable.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -7,28 +8,47 @@
     namespace
     {
-        class IdentifiableTest : public Identifiable
+        class IdentifiableClass : public Identifiable
         {
             public:
-                IdentifiableTest() { RegisterObject(IdentifiableTest); }
+                IdentifiableClass() { RegisterObject(IdentifiableClass); }
+        };
+
+        RegisterClassNoArgs(IdentifiableClass);
+
+        // Fixture
+        class IdentifiableTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                }
+
+                virtual void TearDown()
+                {
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
+                }
         };
     }
 
-    TEST(IdentifiableTest, CanCreate)
+    TEST_F(IdentifiableTest, CanCreate)
     {
-        IdentifiableTest* test = new IdentifiableTest();
+        IdentifiableClass* test = new IdentifiableClass();
         ASSERT_TRUE(test != NULL);
         delete test;
     }
 
-    TEST(IdentifiableTest, HasIdentifierAssigned)
+    TEST_F(IdentifiableTest, HasIdentifierAssigned)
     {
-        IdentifiableTest test;
+        IdentifiableClass test;
         EXPECT_TRUE(test.getIdentifier());
     }
 
-    TEST(IdentifiableTest, CanBeIdentified)
+    TEST_F(IdentifiableTest, CanBeIdentified)
     {
-        IdentifiableTest test;
-        EXPECT_TRUE(test.isA(Class(IdentifiableTest)));
+        IdentifiableClass test;
+        EXPECT_TRUE(test.isA(Class(IdentifiableClass)));
     }
 }
Index: code/trunk/test/core/class/IdentifierClassHierarchyTest.cc
===================================================================
--- code/trunk/test/core/class/IdentifierClassHierarchyTest.cc	(revision 10197)
+++ code/trunk/test/core/class/IdentifierClassHierarchyTest.cc	(revision 10624)
@@ -4,4 +4,5 @@
 #include "core/class/OrxonoxClass.h"
 #include "core/class/OrxonoxInterface.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -19,5 +20,5 @@
     namespace
     {
-        class BaseInterface1 : public OrxonoxInterface
+        class BaseInterface1 : virtual public OrxonoxInterface
         {
             public:
@@ -30,5 +31,5 @@
         };
 
-        class BaseInterface2 : public OrxonoxInterface
+        class BaseInterface2 : virtual public OrxonoxInterface
         {
             public:
@@ -124,4 +125,15 @@
         };
 
+        RegisterAbstractClass(BaseInterface1).inheritsFrom<OrxonoxInterface>();
+        RegisterAbstractClass(BaseInterface2).inheritsFrom<OrxonoxInterface>();
+        RegisterAbstractClass(Interface1).inheritsFrom<BaseInterface1>();
+        RegisterAbstractClass(Interface2).inheritsFrom<BaseInterface2>();
+        RegisterClassNoArgs(BaseClass);
+        RegisterClassNoArgs(Class0);
+        RegisterClassNoArgs(Class1);
+        RegisterClassNoArgs(Class2a);
+        RegisterClassNoArgs(Class2b);
+        RegisterClassNoArgs(Class3);
+
         // Fixture
         class IdentifierClassHierarchyTest : public ::testing::Test
@@ -130,20 +142,8 @@
                 virtual void SetUp()
                 {
-                    registerClass("Context", new ClassFactoryWithContext<Context>());
-                    registerClass("Listable", new ClassFactoryWithContext<Listable>());
-                    registerClass("Configurable", new ClassFactoryNoArgs<Configurable>());
-                    registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>());
-                    registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
-                    registerClass("BaseInterface1", static_cast<ClassFactory<BaseInterface1>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface));
-                    registerClass("BaseInterface2", static_cast<ClassFactory<BaseInterface2>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface));
-                    registerClass("Interface1", static_cast<ClassFactory<Interface1>*>(NULL), false).inheritsFrom(Class(BaseInterface1));
-                    registerClass("Interface2", static_cast<ClassFactory<Interface2>*>(NULL), false).inheritsFrom(Class(BaseInterface2));
-                    registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>());
-                    registerClass("Class0", new ClassFactoryNoArgs<Class0>());
-                    registerClass("Class1", new ClassFactoryNoArgs<Class1>());
-                    registerClass("Class2a", new ClassFactoryNoArgs<Class2a>());
-                    registerClass("Class2b", new ClassFactoryNoArgs<Class2b>());
-                    registerClass("Class3", new ClassFactoryNoArgs<Class3>());
-
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    Context::setRootContext(new Context(NULL));
+                    Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -151,65 +151,19 @@
                 virtual void TearDown()
                 {
-                    IdentifierManager::getInstance().destroyAllIdentifiers();
-                }
-        };
+                    IdentifierManager::getInstance().destroyClassHierarchy();
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
+                }
+        };
+
+        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
+        }
 
         bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
         {
             return identifiers.find(identifier) != identifiers.end();
-        }
-    }
-
-    TEST(IdentifierClassHierarchyTest_NoFixture, NoInitialization)
-    {
-        {
-            Identifier* identifier = Class(BaseInterface1);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(BaseInterface2);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(Interface1);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(Interface2);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(BaseClass);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(Class0);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(Class1);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(Class2a);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(Class2b);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(Class3);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
         }
     }
Index: code/trunk/test/core/class/IdentifierExternalClassHierarchyTest.cc
===================================================================
--- code/trunk/test/core/class/IdentifierExternalClassHierarchyTest.cc	(revision 10197)
+++ code/trunk/test/core/class/IdentifierExternalClassHierarchyTest.cc	(revision 10624)
@@ -2,4 +2,5 @@
 #include "core/CoreIncludes.h"
 #include "core/class/Identifiable.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -38,4 +39,8 @@
         };
 
+        RegisterAbstractClass(Interface).inheritsFrom<Identifiable>();
+        RegisterClassNoArgs(BaseClass);
+        RegisterClassNoArgs(RealClass);
+
         // Fixture
         class IdentifierExternalClassHierarchyTest : public ::testing::Test
@@ -44,10 +49,8 @@
                 virtual void SetUp()
                 {
-                    registerClass("Context", new ClassFactoryWithContext<Context>());
-                    registerClass("Listable", new ClassFactoryWithContext<Listable>());
-                    registerClass("Interface", static_cast<ClassFactory<Interface>*>(NULL), false).inheritsFrom(Class(Identifiable));
-                    registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>());
-                    registerClass("RealClass", new ClassFactoryNoArgs<RealClass>());
-
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    Context::setRootContext(new Context(NULL));
+                    Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -55,30 +58,19 @@
                 virtual void TearDown()
                 {
-                    IdentifierManager::getInstance().destroyAllIdentifiers();
+                    IdentifierManager::getInstance().destroyClassHierarchy();
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
+
+        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
+        }
 
         bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
         {
             return identifiers.find(identifier) != identifiers.end();
-        }
-    }
-
-    TEST(IdentifierExternalClassHierarchyTest_NoFixture, NoInitialization)
-    {
-        {
-            Identifier* identifier = Class(Interface);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(BaseClass);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(RealClass);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
         }
     }
Index: code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc
===================================================================
--- code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc	(revision 10624)
+++ code/trunk/test/core/class/IdentifierNestedClassHierarchyTest.cc	(revision 10624)
@@ -0,0 +1,355 @@
+#include <gtest/gtest.h>
+#include "core/CoreIncludes.h"
+#include "core/class/Identifiable.h"
+#include "core/class/OrxonoxClass.h"
+#include "core/class/OrxonoxInterface.h"
+#include "core/module/ModuleInstance.h"
+
+namespace orxonox
+{
+    // Tests the class hierarchy with classes that contain other classes as members.
+    //
+    //                    +------ Nested1         +------ Class1_notNested
+    //                    +------ Nested2         +------ Class2_oneNested
+    // OrxonoxClass <-----+------ BaseClass <-----+------ Class3_twoNested <----------- Class3_Child
+    //                                            +------ Class4_class1Nested
+    //                                            +------ Class5_class2Nested
+    //                                            +------ Class6_class3Nested <-------- Class6_Child
+
+    namespace
+    {
+        class Nested1 : public OrxonoxClass
+        {
+            public:
+                Nested1() { RegisterObject(Nested1); }
+        };
+
+        class Nested2 : public OrxonoxClass
+        {
+            public:
+                Nested2() { RegisterObject(Nested2); }
+        };
+
+        class BaseClass : public OrxonoxClass
+        {
+            public:
+                BaseClass() { RegisterObject(BaseClass); }
+        };
+
+        class Class1_notNested : public BaseClass
+        {
+            public:
+                Class1_notNested() { RegisterObject(Class1_notNested); }
+        };
+
+        class Class2_oneNested : public BaseClass
+        {
+            public:
+                Class2_oneNested() { RegisterObject(Class2_oneNested); }
+                Nested1 nested1_;
+        };
+
+        class Class3_twoNested : public BaseClass
+        {
+            public:
+                Class3_twoNested() { RegisterObject(Class3_twoNested); }
+                Nested1 nested1_;
+                Nested2 nested2_;
+        };
+
+        class Class4_class1Nested : public BaseClass
+        {
+            public:
+                Class4_class1Nested() { RegisterObject(Class4_class1Nested); }
+                Class1_notNested nested_;
+        };
+
+        class Class5_class2Nested : public BaseClass
+        {
+            public:
+                Class5_class2Nested() { RegisterObject(Class5_class2Nested); }
+                Class2_oneNested nested_;
+        };
+
+        class Class6_class3Nested : public BaseClass
+        {
+            public:
+                Class6_class3Nested() { RegisterObject(Class6_class3Nested); }
+                Class3_twoNested nested_;
+        };
+
+        class Class3_Child : public Class3_twoNested
+        {
+            public:
+                Class3_Child() { RegisterObject(Class3_Child); }
+        };
+
+        class Class6_Child : public Class6_class3Nested
+        {
+            public:
+                Class6_Child() { RegisterObject(Class6_Child); }
+        };
+
+        RegisterClassNoArgs(Nested1);
+        RegisterClassNoArgs(Nested2);
+        RegisterClassNoArgs(BaseClass);
+        RegisterClassNoArgs(Class1_notNested);
+        RegisterClassNoArgs(Class2_oneNested);
+        RegisterClassNoArgs(Class3_twoNested);
+        RegisterClassNoArgs(Class4_class1Nested);
+        RegisterClassNoArgs(Class5_class2Nested);
+        RegisterClassNoArgs(Class6_class3Nested);
+        RegisterClassNoArgs(Class3_Child);
+        RegisterClassNoArgs(Class6_Child);
+
+        // Fixture
+        class IdentifierNestedClassHierarchyTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    Context::setRootContext(new Context(NULL));
+                    Identifier::initConfigValues_s = false; // TODO: hack!
+                    IdentifierManager::getInstance().createClassHierarchy();
+                }
+
+                virtual void TearDown()
+                {
+                    IdentifierManager::getInstance().destroyClassHierarchy();
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
+                }
+        };
+
+        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
+        }
+
+        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return identifiers.find(identifier) != identifiers.end();
+        }
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestNested1)
+    {
+        Identifier* identifier = Class(Nested1);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+        EXPECT_EQ(4u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestNested2)
+    {
+        Identifier* identifier = Class(Nested2);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+        EXPECT_EQ(4u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestBaseClass)
+    {
+        Identifier* identifier = Class(BaseClass);
+
+        EXPECT_EQ(6u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class1_notNested)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2_oneNested)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3_twoNested)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class4_class1Nested)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class5_class2Nested)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class6_class3Nested)));
+
+        EXPECT_EQ(8u, identifier->getChildren().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1_notNested)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2_oneNested)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_twoNested)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class4_class1Nested)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class5_class2Nested)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_class3Nested)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_Child)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_Child)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+        EXPECT_EQ(4u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass1_notNested)
+    {
+        Identifier* identifier = Class(Class1_notNested);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass2_oneNested)
+    {
+        Identifier* identifier = Class(Class2_oneNested);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass3_twoNested)
+    {
+        Identifier* identifier = Class(Class3_twoNested);
+
+        EXPECT_EQ(1u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3_Child)));
+
+        EXPECT_EQ(1u, identifier->getChildren().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3_Child)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass4_class1Nested)
+    {
+        Identifier* identifier = Class(Class4_class1Nested);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass5_class2Nested)
+    {
+        Identifier* identifier = Class(Class5_class2Nested);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass6_class3Nested)
+    {
+        Identifier* identifier = Class(Class6_class3Nested);
+
+        EXPECT_EQ(1u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class6_Child)));
+
+        EXPECT_EQ(1u, identifier->getChildren().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class6_Child)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass3_Child)
+    {
+        Identifier* identifier = Class(Class3_Child);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Class3_twoNested)));
+
+        EXPECT_EQ(6u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Class3_twoNested)));
+    }
+
+    TEST_F(IdentifierNestedClassHierarchyTest, TestClass6_Child)
+    {
+        Identifier* identifier = Class(Class6_Child);
+
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+        EXPECT_EQ(0u, identifier->getChildren().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Class6_class3Nested)));
+
+        EXPECT_EQ(6u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Configurable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Class6_class3Nested)));
+    }
+}
Index: code/trunk/test/core/class/IdentifierSimpleClassHierarchyTest.cc
===================================================================
--- code/trunk/test/core/class/IdentifierSimpleClassHierarchyTest.cc	(revision 10197)
+++ code/trunk/test/core/class/IdentifierSimpleClassHierarchyTest.cc	(revision 10624)
@@ -4,4 +4,5 @@
 #include "core/class/OrxonoxClass.h"
 #include "core/class/OrxonoxInterface.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -9,5 +10,5 @@
     namespace
     {
-        class Interface : public OrxonoxInterface
+        class Interface : virtual public OrxonoxInterface
         {
             public:
@@ -40,4 +41,8 @@
         };
 
+        RegisterAbstractClass(Interface).inheritsFrom<OrxonoxInterface>();
+        RegisterClassNoArgs(BaseClass);
+        RegisterClassNoArgs(RealClass);
+
         // Fixture
         class IdentifierSimpleClassHierarchyTest : public ::testing::Test
@@ -46,13 +51,8 @@
                 virtual void SetUp()
                 {
-                    registerClass("Context", new ClassFactoryWithContext<Context>());
-                    registerClass("Listable", new ClassFactoryWithContext<Listable>());
-                    registerClass("Configurable", new ClassFactoryNoArgs<Configurable>());
-                    registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>());
-                    registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
-                    registerClass("Interface", static_cast<ClassFactory<Interface>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface));
-                    registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>());
-                    registerClass("RealClass", new ClassFactoryNoArgs<RealClass>());
-
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    Context::setRootContext(new Context(NULL));
+                    Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -60,30 +60,19 @@
                 virtual void TearDown()
                 {
-                    IdentifierManager::getInstance().destroyAllIdentifiers();
+                    IdentifierManager::getInstance().destroyClassHierarchy();
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
+
+        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
+        }
 
         bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
         {
             return identifiers.find(identifier) != identifiers.end();
-        }
-    }
-
-    TEST(IdentifierSimpleClassHierarchyTest_NoFixture, NoInitialization)
-    {
-        {
-            Identifier* identifier = Class(Interface);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(BaseClass);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
-        }
-        {
-            Identifier* identifier = Class(RealClass);
-            EXPECT_EQ(0u, identifier->getChildren().size());
-            EXPECT_EQ(0u, identifier->getParents().size());
         }
     }
Index: code/trunk/test/core/class/IdentifierTest.cc
===================================================================
--- code/trunk/test/core/class/IdentifierTest.cc	(revision 10197)
+++ code/trunk/test/core/class/IdentifierTest.cc	(revision 10624)
@@ -2,4 +2,5 @@
 #include "core/CoreIncludes.h"
 #include "core/class/Identifiable.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -18,7 +19,27 @@
                 TestSubclass() { RegisterObject(TestSubclass); }
         };
+
+        RegisterClassNoArgs(TestClass);
+        RegisterClassNoArgs(TestSubclass);
+
+        // Fixture
+        class IdentifierTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                }
+
+                virtual void TearDown()
+                {
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
+                }
+        };
     }
 
-    TEST(IdentifierTest, IdentifierExistsOfClass)
+    TEST_F(IdentifierTest, IdentifierExistsOfClass)
     {
         TestClass test;
@@ -28,5 +49,5 @@
     }
 
-    TEST(IdentifierTest, IdentifierExistsOfSubclass)
+    TEST_F(IdentifierTest, IdentifierExistsOfSubclass)
     {
         TestSubclass test;
@@ -36,5 +57,5 @@
     }
 
-    TEST(IdentifierTest, HasNameOfClass)
+    TEST_F(IdentifierTest, HasNameOfClass)
     {
         TestClass test;
@@ -44,5 +65,5 @@
     }
 
-    TEST(IdentifierTest, HasNameOfSubClass)
+    TEST_F(IdentifierTest, HasNameOfSubClass)
     {
         TestSubclass test;
Index: code/trunk/test/core/class/OrxonoxClassTest.cc
===================================================================
--- code/trunk/test/core/class/OrxonoxClassTest.cc	(revision 10197)
+++ code/trunk/test/core/class/OrxonoxClassTest.cc	(revision 10624)
@@ -1,4 +1,5 @@
 #include <gtest/gtest.h>
 #include "core/class/OrxonoxClass.h"
+#include "core/class/IdentifierManager.h"
 #include "core/object/Context.h"
 
@@ -17,4 +18,5 @@
                 virtual void SetUp()
                 {
+                    new IdentifierManager();
                     Context::setRootContext(new Context(NULL));
                 }
@@ -22,5 +24,6 @@
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
+                    Context::destroyRootContext();
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/class/OrxonoxInterfaceTest.cc
===================================================================
--- code/trunk/test/core/class/OrxonoxInterfaceTest.cc	(revision 10197)
+++ code/trunk/test/core/class/OrxonoxInterfaceTest.cc	(revision 10624)
@@ -2,4 +2,5 @@
 #include "core/class/OrxonoxInterface.h"
 #include "core/class/OrxonoxClass.h"
+#include "core/class/IdentifierManager.h"
 #include "core/object/Context.h"
 
@@ -32,4 +33,5 @@
                 virtual void SetUp()
                 {
+                    new IdentifierManager();
                     Context::setRootContext(new Context(NULL));
                 }
@@ -37,5 +39,6 @@
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
+                    Context::destroyRootContext();
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/class/SubclassIdentifierTest.cc
===================================================================
--- code/trunk/test/core/class/SubclassIdentifierTest.cc	(revision 10197)
+++ code/trunk/test/core/class/SubclassIdentifierTest.cc	(revision 10624)
@@ -4,4 +4,5 @@
 #include "core/class/SubclassIdentifier.h"
 #include "core/class/OrxonoxClass.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -21,4 +22,7 @@
         };
 
+        RegisterClass(TestClass);
+        RegisterClass(TestSubclass);
+
         // Fixture
         class SubclassIdentifierTest : public ::testing::Test
@@ -27,18 +31,17 @@
                 virtual void SetUp()
                 {
-                    registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
-                    registerClass("TestClass", new ClassFactoryWithContext<TestClass>());
-                    registerClass("TestSubclass", new ClassFactoryWithContext<TestSubclass>());
-
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    Context::setRootContext(new Context(NULL));
+                    Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
-
-                    Context::setRootContext(new Context(NULL));
                 }
 
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
-
-                    IdentifierManager::getInstance().destroyAllIdentifiers();
+                    IdentifierManager::getInstance().destroyClassHierarchy();
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
Index: code/trunk/test/core/class/SuperTest.cc
===================================================================
--- code/trunk/test/core/class/SuperTest.cc	(revision 10197)
+++ code/trunk/test/core/class/SuperTest.cc	(revision 10624)
@@ -5,4 +5,5 @@
 #include "core/BaseObject.h"
 #include "core/class/Super.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -62,5 +63,8 @@
         };
 
-       // Fixture
+        RegisterClass(TestClass);
+        RegisterClass(TestSubclass);
+
+        // Fixture
         class SuperTest : public ::testing::Test
         {
@@ -68,21 +72,17 @@
                 virtual void SetUp()
                 {
-                    IdentifierManager::getInstance().destroyAllIdentifiers();
-
-                    registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
-                    registerClass("BaseObject", new ClassFactoryWithContext<BaseObject>());
-                    registerClass("TestClass", new ClassFactoryWithContext<TestClass>());
-                    registerClass("TestSubclass", new ClassFactoryWithContext<TestSubclass>());
-
+                    new IdentifierManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    Context::setRootContext(new Context(NULL));
+                    Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
-
-                    Context::setRootContext(new Context(NULL));
                 }
 
                 virtual void TearDown()
                 {
-                    Context::setRootContext(NULL);
-
-                    IdentifierManager::getInstance().destroyAllIdentifiers();
+                    IdentifierManager::getInstance().destroyClassHierarchy();
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &IdentifierManager::getInstance();
                 }
         };
@@ -97,5 +97,5 @@
 
             EXPECT_EQ(1u, identifier->getDirectParents().size());
-            EXPECT_TRUE(identifier->getDirectParents().find(Class(TestClass)) != identifier->getDirectParents().end());
+            EXPECT_TRUE(std::find(identifier->getDirectParents().begin(), identifier->getDirectParents().end(), Class(TestClass)) != identifier->getDirectParents().end());
         }
         {
@@ -106,5 +106,5 @@
 
             EXPECT_EQ(1u, identifier->getDirectParents().size());
-            EXPECT_TRUE(identifier->getDirectParents().find(Class(BaseObject)) != identifier->getDirectParents().end());
+            EXPECT_TRUE(std::find(identifier->getDirectParents().begin(), identifier->getDirectParents().end(), Class(BaseObject)) != identifier->getDirectParents().end());
         }
     }
Index: code/trunk/test/core/command/CommandTest.cc
===================================================================
--- code/trunk/test/core/command/CommandTest.cc	(revision 10197)
+++ code/trunk/test/core/command/CommandTest.cc	(revision 10624)
@@ -1,6 +1,9 @@
 #include <gtest/gtest.h>
-#include "core/command/ConsoleCommand.h"
+#include "core/class/Identifier.h"
+#include "core/class/IdentifierManager.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "core/command/CommandExecutor.h"
 #include "core/object/Destroyable.h"
+#include "core/module/ModuleInstance.h"
 
 namespace orxonox
@@ -130,4 +133,28 @@
                 ModifyConsoleCommand("test").popFunction();
         }
+
+        // Fixture
+        class CommandTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    new IdentifierManager();
+                    new ConsoleCommandManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::CONSOLE_COMMAND);
+                    Context::setRootContext(new Context(NULL));
+                    Identifier::initConfigValues_s = false; // TODO: hack!
+                    IdentifierManager::getInstance().createClassHierarchy();
+                }
+
+                virtual void TearDown()
+                {
+                    IdentifierManager::getInstance().destroyClassHierarchy();
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::CONSOLE_COMMAND);
+                    delete &ConsoleCommandManager::getInstance();
+                    delete &IdentifierManager::getInstance();
+                }
+        };
     }
 
@@ -139,5 +166,5 @@
     }
 
-    TEST(CommandTest, ModuleTest)
+    TEST_F(CommandTest, ModuleTest)
     {
         test(0, 0, 0);
Index: code/trunk/test/core/object/ClassFactoryTest.cc
===================================================================
--- code/trunk/test/core/object/ClassFactoryTest.cc	(revision 10197)
+++ 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 10197)
+++ 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 10197)
+++ 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 10197)
+++ 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 10197)
+++ 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 10197)
+++ 	(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 10197)
+++ 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();
+    }
 }
Index: code/trunk/test/core/singleton/ScopeTest.cc
===================================================================
--- code/trunk/test/core/singleton/ScopeTest.cc	(revision 10624)
+++ code/trunk/test/core/singleton/ScopeTest.cc	(revision 10624)
@@ -0,0 +1,109 @@
+#include <gtest/gtest.h>
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "core/module/ModuleInstance.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    namespace
+    {
+        class TestSingletonRoot : public Singleton<TestSingletonRoot>
+        {
+            friend class Singleton<TestSingletonRoot>;
+            static TestSingletonRoot* singletonPtr_s;
+        };
+        class TestSingletonGraphics : public Singleton<TestSingletonGraphics>
+        {
+            friend class Singleton<TestSingletonGraphics>;
+            static TestSingletonGraphics* singletonPtr_s;
+        };
+
+        ManageScopedSingleton(TestSingletonRoot, ScopeID::ROOT, false);
+        ManageScopedSingleton(TestSingletonGraphics, ScopeID::GRAPHICS, false);
+
+        // Fixture
+        class ScopeTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    new IdentifierManager();
+                    new ScopeManager();
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::SCOPED_SINGLETON_WRAPPER);
+                    Context::setRootContext(new Context(NULL));
+                }
+
+                virtual void TearDown()
+                {
+                    Context::destroyRootContext();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::SCOPED_SINGLETON_WRAPPER);
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER);
+                    delete &ScopeManager::getInstance();
+                    delete &IdentifierManager::getInstance();
+                }
+        };
+    }
+
+    TEST_F(ScopeTest, ScopesDoNotExist)
+    {
+        EXPECT_FALSE(Scope<ScopeID::ROOT>::isActive());
+        EXPECT_FALSE(Scope<ScopeID::GRAPHICS>::isActive());
+    }
+
+    TEST_F(ScopeTest, SingletonsDoNotExist)
+    {
+        EXPECT_FALSE(TestSingletonRoot::exists());
+        EXPECT_FALSE(TestSingletonGraphics::exists());
+    }
+
+    TEST_F(ScopeTest, RootScope)
+    {
+        EXPECT_FALSE(Scope<ScopeID::ROOT>::isActive());
+        {   // create root scope
+            Scope<ScopeID::ROOT> scope;
+            EXPECT_TRUE(Scope<ScopeID::ROOT>::isActive());
+        }   // destroy root scope
+        EXPECT_FALSE(Scope<ScopeID::ROOT>::isActive());
+    }
+
+    TEST_F(ScopeTest, DISABLED_RootAndGraphicsScope)
+    {
+        EXPECT_FALSE(Scope<ScopeID::GRAPHICS>::isActive());
+        {   // create root scope
+            Scope<ScopeID::ROOT> scope;
+            EXPECT_FALSE(Scope<ScopeID::GRAPHICS>::isActive());
+            {   // create graphics scope
+                Scope<ScopeID::GRAPHICS> scope;
+                EXPECT_TRUE(Scope<ScopeID::GRAPHICS>::isActive());
+            }   // destroy graphics scope
+            EXPECT_FALSE(Scope<ScopeID::GRAPHICS>::isActive());
+        }   // destroy root scope
+        EXPECT_FALSE(Scope<ScopeID::GRAPHICS>::isActive());
+    }
+
+    TEST_F(ScopeTest, RootSingleton)
+    {
+        EXPECT_FALSE(TestSingletonRoot::exists());
+        {   // create root scope
+            Scope<ScopeID::ROOT> scope;
+            EXPECT_TRUE(TestSingletonRoot::exists());
+        }   // destroy root scope
+        EXPECT_FALSE(TestSingletonRoot::exists());
+    }
+
+    TEST_F(ScopeTest, DISABLED_RootAndGraphicsSingleton)
+    {
+        EXPECT_FALSE(TestSingletonGraphics::exists());
+        {   // create root scope
+            Scope<ScopeID::ROOT> scope;
+            EXPECT_FALSE(TestSingletonGraphics::exists());
+            {   // create graphics scope
+                Scope<ScopeID::GRAPHICS> scope;
+                EXPECT_TRUE(TestSingletonGraphics::exists());
+            }   // destroy graphics scope
+            EXPECT_FALSE(TestSingletonGraphics::exists());
+        }   // destroy root scope
+        EXPECT_FALSE(TestSingletonGraphics::exists());
+    }
+}
Index: code/trunk/test/util/CMakeLists.txt
===================================================================
--- code/trunk/test/util/CMakeLists.txt	(revision 10197)
+++ code/trunk/test/util/CMakeLists.txt	(revision 10624)
@@ -13,5 +13,4 @@
     MultiTypeTest.cc
     OutputTest.cc
-    ScopeTest.cc
     SharedPtrTest.cc
     SingletonTest.cc
Index: code/trunk/test/util/ScopeTest.cc
===================================================================
--- code/trunk/test/util/ScopeTest.cc	(revision 10197)
+++ 	(revision )
@@ -1,84 +1,0 @@
-#include <gtest/gtest.h>
-#include "util/ScopedSingletonManager.h"
-
-namespace orxonox
-{
-    namespace
-    {
-        class TestSingletonRoot : public Singleton<TestSingletonRoot>
-        {
-            friend class Singleton<TestSingletonRoot>;
-            static TestSingletonRoot* singletonPtr_s;
-        };
-        class TestSingletonGraphics : public Singleton<TestSingletonGraphics>
-        {
-            friend class Singleton<TestSingletonGraphics>;
-            static TestSingletonGraphics* singletonPtr_s;
-        };
-
-        ManageScopedSingleton(TestSingletonRoot, ScopeID::Root, false);
-        ManageScopedSingleton(TestSingletonGraphics, ScopeID::Graphics, false);
-    }
-
-    TEST(Scope, ScopesDoNotExist)
-    {
-        EXPECT_FALSE(Scope<ScopeID::Root>::isActive());
-        EXPECT_FALSE(Scope<ScopeID::Graphics>::isActive());
-    }
-
-    TEST(Scope, SingletonsDoNotExist)
-    {
-        EXPECT_FALSE(TestSingletonRoot::exists());
-        EXPECT_FALSE(TestSingletonGraphics::exists());
-    }
-
-    TEST(Scope, RootScope)
-    {
-        EXPECT_FALSE(Scope<ScopeID::Root>::isActive());
-        {   // create root scope
-            Scope<ScopeID::Root> scope;
-            EXPECT_TRUE(Scope<ScopeID::Root>::isActive());
-        }   // destroy root scope
-        EXPECT_FALSE(Scope<ScopeID::Root>::isActive());
-    }
-
-    TEST(Scope, RootAndGraphicsScope)
-    {
-        EXPECT_FALSE(Scope<ScopeID::Graphics>::isActive());
-        {   // create root scope
-            Scope<ScopeID::Root> scope;
-            EXPECT_FALSE(Scope<ScopeID::Graphics>::isActive());
-            {   // create graphics scope
-                Scope<ScopeID::Graphics> scope;
-                EXPECT_TRUE(Scope<ScopeID::Graphics>::isActive());
-            }   // destroy graphics scope
-            EXPECT_FALSE(Scope<ScopeID::Graphics>::isActive());
-        }   // destroy root scope
-        EXPECT_FALSE(Scope<ScopeID::Graphics>::isActive());
-    }
-
-    TEST(Scope, RootSingleton)
-    {
-        EXPECT_FALSE(TestSingletonRoot::exists());
-        {   // create root scope
-            Scope<ScopeID::Root> scope;
-            EXPECT_TRUE(TestSingletonRoot::exists());
-        }   // destroy root scope
-        EXPECT_FALSE(TestSingletonRoot::exists());
-    }
-
-    TEST(Scope, RootAndGraphicsSingleton)
-    {
-        EXPECT_FALSE(TestSingletonGraphics::exists());
-        {   // create root scope
-            Scope<ScopeID::Root> scope;
-            EXPECT_FALSE(TestSingletonGraphics::exists());
-            {   // create graphics scope
-                Scope<ScopeID::Graphics> scope;
-                EXPECT_TRUE(TestSingletonGraphics::exists());
-            }   // destroy graphics scope
-            EXPECT_FALSE(TestSingletonGraphics::exists());
-        }   // destroy root scope
-        EXPECT_FALSE(TestSingletonGraphics::exists());
-    }
-}
Index: code/trunk/test/util/output/ConsoleWriterTest.cc
===================================================================
--- code/trunk/test/util/output/ConsoleWriterTest.cc	(revision 10197)
+++ code/trunk/test/util/output/ConsoleWriterTest.cc	(revision 10624)
@@ -7,9 +7,24 @@
 namespace orxonox
 {
-    TEST(ConsoleWriterTest, Disable)
+    namespace
     {
-        // reset output manager
-        OutputManager::Testing::getInstancePointer() = new OutputManager();
+        // Fixture
+        class ConsoleWriterTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    // reset output manager
+                    OutputManager::Testing::getInstancePointer() = new OutputManager();
+                }
 
+                virtual void TearDown()
+                {
+                }
+        };
+    }
+
+    TEST_F(ConsoleWriterTest, Disable)
+    {
         std::ostream stream(NULL);
         EXPECT_EQ(0U, OutputManager::getInstance().getListeners().size());
@@ -20,9 +35,6 @@
     }
 
-    TEST(ConsoleWriterTest, Enable)
+    TEST_F(ConsoleWriterTest, Enable)
     {
-        // reset output manager
-        OutputManager::Testing::getInstancePointer() = new OutputManager();
-
         std::ostream stream(NULL);
         ConsoleWriter writer(stream);
@@ -33,5 +45,5 @@
     }
 
-    TEST(ConsoleWriterTest, WritesNoOutputToOutputStream)
+    TEST_F(ConsoleWriterTest, WritesNoOutputToOutputStream)
     {
         std::stringbuf buffer;
@@ -44,5 +56,5 @@
     }
 
-    TEST(ConsoleWriterTest, WritesOutputToOutputStream)
+    TEST_F(ConsoleWriterTest, WritesOutputToOutputStream)
     {
         std::stringbuf buffer;
@@ -63,5 +75,5 @@
     }
 
-    TEST(ConsoleWriterTest, DefaultConsoleWriterUsesCout)
+    TEST_F(ConsoleWriterTest, DefaultConsoleWriterUsesCout)
     {
         OutputManager::getInstanceAndCreateListeners();
Index: code/trunk/test/util/output/LogWriterTest.cc
===================================================================
--- code/trunk/test/util/output/LogWriterTest.cc	(revision 10197)
+++ code/trunk/test/util/output/LogWriterTest.cc	(revision 10624)
@@ -3,4 +3,6 @@
 #include "util/output/LogWriter.h"
 #include "util/Convert.h"
+#include "util/output/OutputManager.h"
+#include "util/SharedPtr.h"
 
 namespace orxonox
@@ -14,8 +16,23 @@
                     { this->LogWriter::printLine(line, level); }
         };
+
+        // Fixture
+        class LogWriterTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    // reset output manager
+                    OutputManager::Testing::getInstancePointer() = new OutputManager();
+                }
+
+                virtual void TearDown()
+                {
+                }
+        };
     }
 
     // test constructor opens file
-    TEST(LogWriterTest, ConstructorOpensFile)
+    TEST_F(LogWriterTest, ConstructorOpensFile)
     {
         LogWriter logWriter;
@@ -64,5 +81,5 @@
     }
 
-    TEST(LogWriterTest, SetLogDirectoryOpensNewFile)
+    TEST_F(LogWriterTest, SetLogDirectoryOpensNewFile)
     {
         std::string path = "./orxonox.log";
@@ -83,5 +100,5 @@
 
     // prints output to logfile
-    TEST(LogWriterTest, PrintsOutputToLogfile)
+    TEST_F(LogWriterTest, PrintsOutputToLogfile)
     {
         std::string path;
@@ -103,5 +120,5 @@
 
     // prints time to logfile
-    TEST(LogWriterTest, PrintsTimestampToLogfile)
+    TEST_F(LogWriterTest, PrintsTimestampToLogfile)
     {
         std::string path;
@@ -152,5 +169,5 @@
     }
 
-    TEST(LogWriterTest, ArchivesOldLogFile)
+    TEST_F(LogWriterTest, ArchivesOldLogFile)
     {
         deleteAllLogFiles();
@@ -196,5 +213,5 @@
     }
 
-    TEST(LogWriterTest, ArchivesNineLogFiles)
+    TEST_F(LogWriterTest, ArchivesNineLogFiles)
     {
         deleteAllLogFiles();
Index: code/trunk/test/util/output/MemoryWriterTest.cc
===================================================================
--- code/trunk/test/util/output/MemoryWriterTest.cc	(revision 10197)
+++ code/trunk/test/util/output/MemoryWriterTest.cc	(revision 10624)
@@ -4,4 +4,5 @@
 #include "util/output/MemoryWriter.h"
 #include "util/output/OutputManager.h"
+#include "util/SharedPtr.h"
 
 namespace orxonox
@@ -14,7 +15,22 @@
                 MOCK_METHOD3(output, void(OutputLevel, const OutputContextContainer&, const std::vector<std::string>&));
         };
+
+        // Fixture
+        class MemoryWriterTest : public ::testing::Test
+        {
+            public:
+                virtual void SetUp()
+                {
+                    // reset output manager
+                    OutputManager::Testing::getInstancePointer() = new OutputManager();
+                }
+
+                virtual void TearDown()
+                {
+                }
+        };
     }
 
-    TEST(MemoryWriterTest, Disable)
+    TEST_F(MemoryWriterTest, Disable)
     {
         EXPECT_EQ(0U, OutputManager::getInstance().getListeners().size());
@@ -25,5 +41,5 @@
     }
 
-    TEST(MemoryWriterTest, ResendOutput)
+    TEST_F(MemoryWriterTest, ResendOutput)
     {
         MemoryWriter writer;
Index: code/trunk/test/util/output/OutputManagerTest.cc
===================================================================
--- code/trunk/test/util/output/OutputManagerTest.cc	(revision 10197)
+++ code/trunk/test/util/output/OutputManagerTest.cc	(revision 10624)
@@ -98,4 +98,6 @@
 
         EXPECT_FALSE(manager.getListeners().empty());
+
+        manager.unregisterListener(&listener);
     }
 
@@ -123,4 +125,6 @@
 
         EXPECT_FALSE(listener.getListeners().empty());
+
+        manager.unregisterListener(&listener);
     }
 
@@ -156,4 +160,6 @@
         EXPECT_EQ(level::verbose_more, manager.getCombinedAdditionalContextsLevelMask());
         EXPECT_EQ(context::unittest2().mask, manager.getCombinedAdditionalContextsMask());
+
+        manager.unregisterListener(&listener);
     }
 
@@ -193,4 +199,6 @@
 
         EXPECT_EQ(level::internal_warning, manager.getCombinedLevelMask());
+
+        manager.unregisterListener(&listener);
     }
 
@@ -208,4 +216,6 @@
 
         EXPECT_EQ(level::internal_warning, manager.getCombinedAdditionalContextsLevelMask());
+
+        manager.unregisterListener(&listener);
     }
 
@@ -223,4 +233,6 @@
 
         EXPECT_EQ(context::unittest2().mask, manager.getCombinedAdditionalContextsMask());
+
+        manager.unregisterListener(&listener);
     }
 
@@ -254,4 +266,8 @@
         EXPECT_EQ(level::verbose | level::verbose_more | level::verbose_ultra, manager.getCombinedAdditionalContextsLevelMask());
         EXPECT_EQ(context::unittest1().mask | context::unittest2().mask | context::unittest3().mask, manager.getCombinedAdditionalContextsMask());
+
+        manager.unregisterListener(&listener1);
+        manager.unregisterListener(&listener2);
+        manager.unregisterListener(&listener3);
     }
 
@@ -287,4 +303,6 @@
         EXPECT_TRUE(manager.acceptsOutput(level::verbose_more, context::unittest2()));
         EXPECT_FALSE(manager.acceptsOutput(level::verbose_ultra, context::unittest2()));
+
+        manager.unregisterListener(&listener);
     }
 
@@ -302,4 +320,6 @@
 
         manager.pushMessage(level::user_status, context::unittest1(), "some output");
+
+        manager.unregisterListener(&listener);
     }
 
@@ -319,4 +339,6 @@
 
         manager.pushMessage(level::user_status, context::unittest1(), "some output\nand some more output\n!!!");
+
+        manager.unregisterListener(&listener);
     }
 
