Changeset 10624 for code/trunk/test/core/object
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 1 deleted
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/test/core/object/ClassFactoryTest.cc
r9649 r10624 3 3 #include "core/BaseObject.h" 4 4 #include "core/object/Context.h" 5 #include "core/module/ModuleInstance.h" 6 #include "core/CoreIncludes.h" 5 7 6 8 namespace orxonox … … 14 16 virtual void SetUp() 15 17 { 18 new IdentifierManager(); 19 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 16 20 Context::setRootContext(new Context(NULL)); 17 21 } … … 19 23 virtual void TearDown() 20 24 { 21 Context::setRootContext(NULL); 25 Context::destroyRootContext(); 26 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 27 delete &IdentifierManager::getInstance(); 22 28 } 23 29 }; -
code/trunk/test/core/object/ContextTest.cc
r9659 r10624 3 3 #include "core/class/OrxonoxClass.h" 4 4 #include "core/CoreIncludes.h" 5 #include "core/module/ModuleInstance.h" 5 6 6 7 namespace orxonox … … 14 15 }; 15 16 17 RegisterClassNoArgs(SubclassContext); 18 16 19 // Fixture 17 20 class ContextTest : public ::testing::Test … … 20 23 virtual void SetUp() 21 24 { 25 new IdentifierManager(); 26 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 22 27 Context::setRootContext(new Context(NULL)); 23 28 } … … 25 30 virtual void TearDown() 26 31 { 27 Context::setRootContext(NULL); 32 Context::destroyRootContext(); 33 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 34 delete &IdentifierManager::getInstance(); 28 35 } 29 36 }; -
code/trunk/test/core/object/IteratorTest.cc
r9659 r10624 6 6 #include "core/class/OrxonoxInterface.h" 7 7 #include "core/CoreIncludes.h" 8 #include "core/module/ModuleInstance.h" 8 9 9 10 namespace orxonox … … 24 25 }; 25 26 27 RegisterClassNoArgs(TestInterface); 28 RegisterClassNoArgs(TestClass); 29 26 30 // Fixture 27 31 class IteratorTest : public ::testing::Test … … 30 34 virtual void SetUp() 31 35 { 36 new IdentifierManager(); 37 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 32 38 Context::setRootContext(new Context(NULL)); 33 39 } … … 35 41 virtual void TearDown() 36 42 { 37 Context::setRootContext(NULL); 43 Context::destroyRootContext(); 44 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 45 delete &IdentifierManager::getInstance(); 38 46 } 39 47 }; -
code/trunk/test/core/object/ListableTest.cc
r9659 r10624 2 2 #include "core/object/Listable.h" 3 3 #include "core/CoreIncludes.h" 4 #include "core/module/ModuleInstance.h" 4 5 5 6 namespace orxonox … … 10 11 { 11 12 public: 12 ListableClassTest() { RegisterObject(ListableClassTest); }13 ListableClassTest() { RegisterObject(ListableClassTest); } 13 14 }; 14 15 … … 18 19 ListableSubclassTest() { RegisterObject(ListableSubclassTest); } 19 20 }; 21 22 RegisterClassNoArgs(ListableClassTest); 23 RegisterClassNoArgs(ListableSubclassTest); 20 24 21 25 template <class T> … … 35 39 virtual void SetUp() 36 40 { 41 new IdentifierManager(); 42 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 37 43 Context::setRootContext(new Context(NULL)); 38 44 } … … 40 46 virtual void TearDown() 41 47 { 42 Context::setRootContext(NULL); 48 Context::destroyRootContext(); 49 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 50 delete &IdentifierManager::getInstance(); 43 51 } 44 52 }; -
code/trunk/test/core/object/ObjectListIteratorTest.cc
r9659 r10624 5 5 #include "core/object/Listable.h" 6 6 #include "core/CoreIncludes.h" 7 #include "core/module/ModuleInstance.h" 7 8 8 9 namespace orxonox … … 17 18 }; 18 19 20 RegisterClassNoArgs(ListableTest); 21 19 22 // Fixture 20 23 class ObjectListIteratorTest : public ::testing::Test … … 23 26 virtual void SetUp() 24 27 { 28 new IdentifierManager(); 29 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 25 30 Context::setRootContext(new Context(NULL)); 26 31 } … … 28 33 virtual void TearDown() 29 34 { 30 Context::setRootContext(NULL); 35 Context::destroyRootContext(); 36 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 37 delete &IdentifierManager::getInstance(); 31 38 } 32 39 }; -
code/trunk/test/core/object/WeakPtrTest.cc
r9603 r10624 45 45 test->destroy(); 46 46 } 47 48 void isNull(const WeakPtr<DestroyableTest> weakPtr) 49 { 50 EXPECT_TRUE(weakPtr == NULL); 51 EXPECT_TRUE(weakPtr == 0); 52 EXPECT_TRUE(!weakPtr); 53 EXPECT_FALSE(weakPtr != NULL); 54 EXPECT_FALSE(weakPtr != 0); 55 EXPECT_FALSE(weakPtr); 56 } 57 58 TEST(WeakPtrTest, IsNull) 59 { 60 { 61 WeakPtr<DestroyableTest> weakPtr; 62 isNull(weakPtr); 63 } 64 { 65 WeakPtr<DestroyableTest> weakPtr = NULL; 66 isNull(weakPtr); 67 } 68 { 69 WeakPtr<DestroyableTest> weakPtr; 70 weakPtr = NULL; 71 isNull(weakPtr); 72 } 73 { 74 WeakPtr<DestroyableTest> weakPtr = 0; 75 isNull(weakPtr); 76 } 77 { 78 WeakPtr<DestroyableTest> weakPtr; 79 weakPtr = 0; 80 isNull(weakPtr); 81 } 82 } 83 84 TEST(WeakPtrTest, IsNotNull) 85 { 86 DestroyableTest* test = new DestroyableTest(); 87 WeakPtr<DestroyableTest> weakPtr = test; 88 EXPECT_FALSE(weakPtr == NULL); 89 EXPECT_FALSE(weakPtr == 0); 90 EXPECT_FALSE(!weakPtr); 91 EXPECT_TRUE(weakPtr != NULL); 92 EXPECT_TRUE(weakPtr != 0); 93 EXPECT_TRUE(weakPtr); 94 test->destroy(); 95 } 47 96 }
Note: See TracChangeset
for help on using the changeset viewer.