[Orxonox-commit 5745] r10405 - in code/branches/core7: src/libraries/core/class test/core/class test/core/command

landauf at orxonox.net landauf at orxonox.net
Sun Apr 26 20:49:32 CEST 2015


Author: landauf
Date: 2015-04-26 20:49:32 +0200 (Sun, 26 Apr 2015)
New Revision: 10405

Modified:
   code/branches/core7/src/libraries/core/class/Identifier.cc
   code/branches/core7/test/core/class/IdentifierClassHierarchyTest.cc
   code/branches/core7/test/core/class/IdentifierExternalClassHierarchyTest.cc
   code/branches/core7/test/core/class/IdentifierNestedClassHierarchyTest.cc
   code/branches/core7/test/core/class/IdentifierSimpleClassHierarchyTest.cc
   code/branches/core7/test/core/class/SubclassIdentifierTest.cc
   code/branches/core7/test/core/class/SuperTest.cc
   code/branches/core7/test/core/command/CommandTest.cc
Log:
fixed some TODOs in tests and code by using the new unload() function

Modified: code/branches/core7/src/libraries/core/class/Identifier.cc
===================================================================
--- code/branches/core7/src/libraries/core/class/Identifier.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/src/libraries/core/class/Identifier.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -224,8 +224,7 @@
      */
     void Identifier::reset()
     {
-        if (this->factory_ != NULL) // TODO: should reset ALL identifiers, but currently the calls to inheritsFrom<>() are not reproducible
-            this->directParents_.clear();
+        this->directParents_.clear();
         this->parents_.clear();
         this->directChildren_.clear();
         this->children_.clear();

Modified: code/branches/core7/test/core/class/IdentifierClassHierarchyTest.cc
===================================================================
--- code/branches/core7/test/core/class/IdentifierClassHierarchyTest.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/test/core/class/IdentifierClassHierarchyTest.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -142,7 +142,6 @@
                 virtual void SetUp()
                 {
                     ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
-                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
                     Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -150,6 +149,7 @@
                 virtual void TearDown()
                 {
                     IdentifierManager::getInstance().destroyClassHierarchy();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances();
                 }
         };
 

Modified: code/branches/core7/test/core/class/IdentifierExternalClassHierarchyTest.cc
===================================================================
--- code/branches/core7/test/core/class/IdentifierExternalClassHierarchyTest.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/test/core/class/IdentifierExternalClassHierarchyTest.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -49,7 +49,6 @@
                 virtual void SetUp()
                 {
                     ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
-                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
                     Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -57,6 +56,7 @@
                 virtual void TearDown()
                 {
                     IdentifierManager::getInstance().destroyClassHierarchy();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances();
                 }
         };
 

Modified: code/branches/core7/test/core/class/IdentifierNestedClassHierarchyTest.cc
===================================================================
--- code/branches/core7/test/core/class/IdentifierNestedClassHierarchyTest.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/test/core/class/IdentifierNestedClassHierarchyTest.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -109,7 +109,6 @@
                 virtual void SetUp()
                 {
                     ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
-                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
                     Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -117,6 +116,7 @@
                 virtual void TearDown()
                 {
                     IdentifierManager::getInstance().destroyClassHierarchy();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances();
                 }
         };
 

Modified: code/branches/core7/test/core/class/IdentifierSimpleClassHierarchyTest.cc
===================================================================
--- code/branches/core7/test/core/class/IdentifierSimpleClassHierarchyTest.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/test/core/class/IdentifierSimpleClassHierarchyTest.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -51,7 +51,6 @@
                 virtual void SetUp()
                 {
                     ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
-                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
                     Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -59,6 +58,7 @@
                 virtual void TearDown()
                 {
                     IdentifierManager::getInstance().destroyClassHierarchy();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances();
                 }
         };
 

Modified: code/branches/core7/test/core/class/SubclassIdentifierTest.cc
===================================================================
--- code/branches/core7/test/core/class/SubclassIdentifierTest.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/test/core/class/SubclassIdentifierTest.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -31,7 +31,6 @@
                 virtual void SetUp()
                 {
                     ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
-                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
                     Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
 
@@ -43,6 +42,7 @@
                     Context::setRootContext(NULL);
 
                     IdentifierManager::getInstance().destroyClassHierarchy();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances();
                 }
         };
     }

Modified: code/branches/core7/test/core/class/SuperTest.cc
===================================================================
--- code/branches/core7/test/core/class/SuperTest.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/test/core/class/SuperTest.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -72,7 +72,6 @@
                 virtual void SetUp()
                 {
                     ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
-                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
                     Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
 
@@ -84,6 +83,7 @@
                     Context::setRootContext(NULL);
 
                     IdentifierManager::getInstance().destroyClassHierarchy();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances();
                 }
         };
     }

Modified: code/branches/core7/test/core/command/CommandTest.cc
===================================================================
--- code/branches/core7/test/core/command/CommandTest.cc	2015-04-26 18:47:52 UTC (rev 10404)
+++ code/branches/core7/test/core/command/CommandTest.cc	2015-04-26 18:49:32 UTC (rev 10405)
@@ -140,7 +140,6 @@
                 virtual void SetUp()
                 {
                     ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
-                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
                     Identifier::initConfigValues_s = false; // TODO: hack!
                     IdentifierManager::getInstance().createClassHierarchy();
                 }
@@ -148,6 +147,7 @@
                 virtual void TearDown()
                 {
                     IdentifierManager::getInstance().destroyClassHierarchy();
+                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances();
                 }
         };
     }




More information about the Orxonox-commit mailing list