Changeset 10765 for code/branches/cpp11_v2/test/core
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/test/core
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/test/core/class/IdentifiableTest.cc
r10624 r10765 37 37 { 38 38 IdentifiableClass* test = new IdentifiableClass(); 39 ASSERT_TRUE(test != NULL);39 ASSERT_TRUE(test != nullptr); 40 40 delete test; 41 41 } -
code/branches/cpp11_v2/test/core/class/IdentifierClassHierarchyTest.cc
r10624 r10765 144 144 new IdentifierManager(); 145 145 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 146 Context::setRootContext(new Context( NULL));146 Context::setRootContext(new Context(nullptr)); 147 147 Identifier::initConfigValues_s = false; // TODO: hack! 148 148 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierExternalClassHierarchyTest.cc
r10624 r10765 51 51 new IdentifierManager(); 52 52 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 53 Context::setRootContext(new Context( NULL));53 Context::setRootContext(new Context(nullptr)); 54 54 Identifier::initConfigValues_s = false; // TODO: hack! 55 55 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierNestedClassHierarchyTest.cc
r10624 r10765 111 111 new IdentifierManager(); 112 112 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 113 Context::setRootContext(new Context( NULL));113 Context::setRootContext(new Context(nullptr)); 114 114 Identifier::initConfigValues_s = false; // TODO: hack! 115 115 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierSimpleClassHierarchyTest.cc
r10624 r10765 53 53 new IdentifierManager(); 54 54 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 55 Context::setRootContext(new Context( NULL));55 Context::setRootContext(new Context(nullptr)); 56 56 Identifier::initConfigValues_s = false; // TODO: hack! 57 57 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/class/IdentifierTest.cc
r10624 r10765 46 46 47 47 Identifier* identifier = Class(TestClass); 48 EXPECT_TRUE(identifier != NULL);48 EXPECT_TRUE(identifier != nullptr); 49 49 } 50 50 … … 54 54 55 55 Identifier* identifier = Class(TestSubclass); 56 EXPECT_TRUE(identifier != NULL);56 EXPECT_TRUE(identifier != nullptr); 57 57 } 58 58 -
code/branches/cpp11_v2/test/core/class/OrxonoxClassTest.cc
r10624 r10765 19 19 { 20 20 new IdentifierManager(); 21 Context::setRootContext(new Context( NULL));21 Context::setRootContext(new Context(nullptr)); 22 22 } 23 23 … … 33 33 { 34 34 TestClass* test = new TestClass(); 35 ASSERT_TRUE(test != NULL);35 ASSERT_TRUE(test != nullptr); 36 36 delete test; 37 37 } -
code/branches/cpp11_v2/test/core/class/OrxonoxInterfaceTest.cc
r10624 r10765 34 34 { 35 35 new IdentifierManager(); 36 Context::setRootContext(new Context( NULL));36 Context::setRootContext(new Context(nullptr)); 37 37 } 38 38 … … 48 48 { 49 49 TestClass1* test = new TestClass1(); 50 ASSERT_TRUE(test != NULL);50 ASSERT_TRUE(test != nullptr); 51 51 delete test; 52 52 } … … 55 55 { 56 56 TestClass2* test = new TestClass2(); 57 ASSERT_TRUE(test != NULL);57 ASSERT_TRUE(test != nullptr); 58 58 delete test; 59 59 } -
code/branches/cpp11_v2/test/core/class/SubclassIdentifierTest.cc
r10624 r10765 13 13 { 14 14 public: 15 TestClass(Context* context = NULL) { RegisterObject(TestClass); }15 TestClass(Context* context = nullptr) { RegisterObject(TestClass); } 16 16 }; 17 17 … … 19 19 { 20 20 public: 21 TestSubclass(Context* context = NULL) { RegisterObject(TestSubclass); }21 TestSubclass(Context* context = nullptr) { RegisterObject(TestSubclass); } 22 22 }; 23 23 … … 33 33 new IdentifierManager(); 34 34 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 35 Context::setRootContext(new Context( NULL));35 Context::setRootContext(new Context(nullptr)); 36 36 Identifier::initConfigValues_s = false; // TODO: hack! 37 37 IdentifierManager::getInstance().createClassHierarchy(); … … 77 77 subclassIdentifier = Class(TestSubclass); 78 78 79 TestClass* instance = subclassIdentifier.fabricate( NULL);80 ASSERT_TRUE(instance != NULL);79 TestClass* instance = subclassIdentifier.fabricate(nullptr); 80 ASSERT_TRUE(instance != nullptr); 81 81 EXPECT_EQ(Class(TestSubclass), instance->getIdentifier()); 82 82 delete instance; -
code/branches/cpp11_v2/test/core/class/SuperTest.cc
r10624 r10765 14 14 { 15 15 public: 16 TestClass(Context* context = NULL) : BaseObject(context), changedNameBase_(false), xmlPortBase_(false), modeBase_(XMLPort::NOP)16 TestClass(Context* context = nullptr) : BaseObject(context), changedNameBase_(false), xmlPortBase_(false), modeBase_(XMLPort::NOP) 17 17 { 18 18 RegisterObject(TestClass); … … 38 38 { 39 39 public: 40 TestSubclass(Context* context = NULL) : TestClass(context), changedNameSubclass_(false), xmlPortSubclass_(false), modeSubclass_(XMLPort::NOP)40 TestSubclass(Context* context = nullptr) : TestClass(context), changedNameSubclass_(false), xmlPortSubclass_(false), modeSubclass_(XMLPort::NOP) 41 41 { 42 42 RegisterObject(TestSubclass); … … 74 74 new IdentifierManager(); 75 75 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 76 Context::setRootContext(new Context( NULL));76 Context::setRootContext(new Context(nullptr)); 77 77 Identifier::initConfigValues_s = false; // TODO: hack! 78 78 IdentifierManager::getInstance().createClassHierarchy(); … … 132 132 EXPECT_EQ(XMLPort::NOP, test.modeSubclass_); 133 133 134 Element* element = NULL;134 Element* element = nullptr; 135 135 test.XMLPort(*element, XMLPort::SaveObject); 136 136 -
code/branches/cpp11_v2/test/core/command/CommandTest.cc
r10624 r10765 143 143 new ConsoleCommandManager(); 144 144 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::CONSOLE_COMMAND); 145 Context::setRootContext(new Context( NULL));145 Context::setRootContext(new Context(nullptr)); 146 146 Identifier::initConfigValues_s = false; // TODO: hack! 147 147 IdentifierManager::getInstance().createClassHierarchy(); -
code/branches/cpp11_v2/test/core/object/ClassFactoryTest.cc
r10624 r10765 18 18 new IdentifierManager(); 19 19 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 20 Context::setRootContext(new Context( NULL));20 Context::setRootContext(new Context(nullptr)); 21 21 } 22 22 … … 33 33 { 34 34 Factory* factory = new ClassFactoryWithContext<BaseObject>(); 35 Identifiable* object = factory->fabricate( NULL);36 ASSERT_TRUE(object != NULL);35 Identifiable* object = factory->fabricate(nullptr); 36 ASSERT_TRUE(object != nullptr); 37 37 BaseObject* baseObject = dynamic_cast<BaseObject*>(object); 38 EXPECT_TRUE(baseObject != NULL);38 EXPECT_TRUE(baseObject != nullptr); 39 39 delete object; 40 40 // don't delete factory - it remains in the identifier -
code/branches/cpp11_v2/test/core/object/ContextTest.cc
r10624 r10765 12 12 { 13 13 public: 14 SubclassContext() : Context( NULL) { RegisterObject(SubclassContext); }14 SubclassContext() : Context(nullptr) { RegisterObject(SubclassContext); } 15 15 }; 16 16 … … 25 25 new IdentifierManager(); 26 26 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 27 Context::setRootContext(new Context( NULL));27 Context::setRootContext(new Context(nullptr)); 28 28 } 29 29 … … 39 39 TEST_F(ContextTest, CanCreateContext) 40 40 { 41 Context context( NULL);41 Context context(nullptr); 42 42 } 43 43 … … 49 49 TEST_F(ContextTest, ContextIsItsOwnContext) 50 50 { 51 Context context( NULL);51 Context context(nullptr); 52 52 EXPECT_EQ(&context, context.getContext()); 53 53 } … … 68 68 TEST_F(ContextTest, ContextIsAddedToItsOwnObjectList) 69 69 { 70 Context context( NULL);70 Context context(nullptr); 71 71 ASSERT_EQ(1u, context.getObjectList<Context>()->size()); 72 72 EXPECT_TRUE(context.getObjectList<Context>()->begin()->objectBase_ == static_cast<Listable*>(&context)); … … 75 75 TEST_F(ContextTest, ContextIsAddedToObjectListOfBaseContext) 76 76 { 77 Context baseContext( NULL);77 Context baseContext(nullptr); 78 78 Context subContext(&baseContext); 79 79 -
code/branches/cpp11_v2/test/core/object/DestroyableTest.cc
r9603 r10765 32 32 DestroyableTest* test = new DestroyableTest(destroyed); 33 33 EXPECT_FALSE(destroyed); 34 EXPECT_TRUE(test != NULL);34 EXPECT_TRUE(test != nullptr); 35 35 test->destroy(); 36 36 EXPECT_TRUE(destroyed); -
code/branches/cpp11_v2/test/core/object/IteratorTest.cc
r10736 r10765 36 36 new IdentifierManager(); 37 37 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 38 Context::setRootContext(new Context( NULL));38 Context::setRootContext(new Context(nullptr)); 39 39 } 40 40 … … 120 120 ++i; 121 121 if (i == 1u) EXPECT_EQ(&testClass, *it); 122 if (i == 2u) EXPECT_EQ( NULL, *it);122 if (i == 2u) EXPECT_EQ(nullptr, *it); 123 123 } 124 124 EXPECT_EQ(2u, i); -
code/branches/cpp11_v2/test/core/object/ListableTest.cc
r10624 r10765 41 41 new IdentifierManager(); 42 42 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 43 Context::setRootContext(new Context( NULL));43 Context::setRootContext(new Context(nullptr)); 44 44 } 45 45 … … 56 56 { 57 57 ListableClassTest* test = new ListableClassTest(); 58 ASSERT_TRUE(test != NULL);58 ASSERT_TRUE(test != nullptr); 59 59 delete test; 60 60 } … … 104 104 TEST_F(ListableTest, CanAddObjectToContext) 105 105 { 106 Context context( NULL);106 Context context(nullptr); 107 107 ListableSubclassTest test; 108 108 … … 118 118 TEST_F(ListableTest, CanAddObjectToSubContext) 119 119 { 120 Context baseContext( NULL);120 Context baseContext(nullptr); 121 121 Context subContext(&baseContext); 122 122 ListableSubclassTest test; … … 139 139 { 140 140 Context* rootContext = Context::getRootContext(); 141 Context newContext( NULL);141 Context newContext(nullptr); 142 142 ListableSubclassTest test; 143 143 -
code/branches/cpp11_v2/test/core/object/ObjectListBaseTest.cc
r9661 r10765 24 24 { 25 25 ObjectListBase list; 26 ObjectListBaseElement* element = new ObjectListElement<Listable>( NULL);26 ObjectListBaseElement* element = new ObjectListElement<Listable>(nullptr); 27 27 list.addElement(element); 28 28 EXPECT_EQ(1u, list.size()); … … 32 32 { 33 33 ObjectListBase list; 34 ObjectListBaseElement* element = new ObjectListElement<Listable>( NULL);34 ObjectListBaseElement* element = new ObjectListElement<Listable>(nullptr); 35 35 list.addElement(element); 36 36 EXPECT_EQ(1u, list.size()); … … 43 43 { 44 44 ObjectListBase list; 45 list.addElement(new ObjectListElement<Listable>( NULL));45 list.addElement(new ObjectListElement<Listable>(nullptr)); 46 46 EXPECT_EQ(1u, list.size()); 47 47 } … … 52 52 EXPECT_EQ(0u, list.size()); 53 53 { 54 ObjectListElement<Listable> element1( NULL);54 ObjectListElement<Listable> element1(nullptr); 55 55 list.addElement(&element1); 56 56 EXPECT_EQ(1u, list.size()); 57 57 { 58 ObjectListElement<Listable> element1( NULL);58 ObjectListElement<Listable> element1(nullptr); 59 59 list.addElement(&element1); 60 60 EXPECT_EQ(2u, list.size()); 61 61 { 62 ObjectListElement<Listable> element1( NULL);62 ObjectListElement<Listable> element1(nullptr); 63 63 list.addElement(&element1); 64 64 EXPECT_EQ(3u, list.size()); … … 76 76 ObjectListElementRemovalListenerMock listener; 77 77 list.registerRemovalListener(&listener); 78 ObjectListBaseElement* element = new ObjectListElement<Listable>( NULL);78 ObjectListBaseElement* element = new ObjectListElement<Listable>(nullptr); 79 79 list.addElement(element); 80 80 EXPECT_CALL(listener, removedElement(element)); -
code/branches/cpp11_v2/test/core/object/ObjectListIteratorTest.cc
r10736 r10765 36 36 new IdentifierManager(); 37 37 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 38 Context::setRootContext(new Context( NULL));38 Context::setRootContext(new Context(nullptr)); 39 39 } 40 40 -
code/branches/cpp11_v2/test/core/object/ObjectListTest.cc
r10736 r10765 28 28 new IdentifierManager(); 29 29 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 30 Context::setRootContext(new Context( NULL));30 Context::setRootContext(new Context(nullptr)); 31 31 } 32 32 -
code/branches/cpp11_v2/test/core/object/StrongPtrTest.cc
r10744 r10765 111 111 void isNull(const StrongPtr<DestroyableTest> strongPtr) 112 112 { 113 EXPECT_TRUE(strongPtr == NULL);113 EXPECT_TRUE(strongPtr == nullptr); 114 114 EXPECT_TRUE(strongPtr == 0); 115 115 EXPECT_TRUE(!strongPtr); 116 EXPECT_FALSE(strongPtr != NULL);116 EXPECT_FALSE(strongPtr != nullptr); 117 117 EXPECT_FALSE(strongPtr != 0); 118 118 EXPECT_FALSE(strongPtr); … … 126 126 } 127 127 { 128 StrongPtr<DestroyableTest> strongPtr = NULL;128 StrongPtr<DestroyableTest> strongPtr = nullptr; 129 129 isNull(strongPtr); 130 130 } 131 131 { 132 132 StrongPtr<DestroyableTest> strongPtr; 133 strongPtr = NULL;133 strongPtr = nullptr; 134 134 isNull(strongPtr); 135 135 } … … 150 150 DestroyableTest* test = new DestroyableTest(destroyed); 151 151 StrongPtr<DestroyableTest> strongPtr = test; 152 EXPECT_FALSE(strongPtr == NULL);152 EXPECT_FALSE(strongPtr == nullptr); 153 153 EXPECT_FALSE(strongPtr == 0); 154 154 EXPECT_FALSE(!strongPtr); 155 EXPECT_TRUE(strongPtr != NULL);155 EXPECT_TRUE(strongPtr != nullptr); 156 156 EXPECT_TRUE(strongPtr != 0); 157 157 EXPECT_TRUE(strongPtr); … … 166 166 // default 167 167 StrongPtr<DestroyableTest> strongPtr1; 168 EXPECT_EQ( NULL, strongPtr1.get());168 EXPECT_EQ(nullptr, strongPtr1.get()); 169 169 170 170 // pointer … … 277 277 EXPECT_EQ(1u, test->getReferenceCount()); 278 278 strongPtr.reset(); 279 EXPECT_EQ( NULL, strongPtr.get());279 EXPECT_EQ(nullptr, strongPtr.get()); 280 280 EXPECT_EQ(0u, test->getReferenceCount()); 281 281 -
code/branches/cpp11_v2/test/core/object/WeakPtrTest.cc
r10744 r10765 36 36 EXPECT_EQ(test, weakPtr.get()); 37 37 test->destroy(); 38 EXPECT_EQ( NULL, weakPtr.get());38 EXPECT_EQ(nullptr, weakPtr.get()); 39 39 } 40 40 … … 49 49 EXPECT_EQ(test, weakPtr3.get()); 50 50 test->destroy(); 51 EXPECT_EQ( NULL, weakPtr1.get());52 EXPECT_EQ( NULL, weakPtr2.get());53 EXPECT_EQ( NULL, weakPtr3.get());51 EXPECT_EQ(nullptr, weakPtr1.get()); 52 EXPECT_EQ(nullptr, weakPtr2.get()); 53 EXPECT_EQ(nullptr, weakPtr3.get()); 54 54 } 55 55 … … 66 66 void isNull(const WeakPtr<DestroyableTest> weakPtr) 67 67 { 68 EXPECT_TRUE(weakPtr == NULL);68 EXPECT_TRUE(weakPtr == nullptr); 69 69 EXPECT_TRUE(weakPtr == 0); 70 70 EXPECT_TRUE(!weakPtr); 71 EXPECT_FALSE(weakPtr != NULL);71 EXPECT_FALSE(weakPtr != nullptr); 72 72 EXPECT_FALSE(weakPtr != 0); 73 73 EXPECT_FALSE(weakPtr); … … 81 81 } 82 82 { 83 WeakPtr<DestroyableTest> weakPtr = NULL;83 WeakPtr<DestroyableTest> weakPtr = nullptr; 84 84 isNull(weakPtr); 85 85 } 86 86 { 87 87 WeakPtr<DestroyableTest> weakPtr; 88 weakPtr = NULL;88 weakPtr = nullptr; 89 89 isNull(weakPtr); 90 90 } … … 104 104 DestroyableTest* test = new DestroyableTest(); 105 105 WeakPtr<DestroyableTest> weakPtr = test; 106 EXPECT_FALSE(weakPtr == NULL);106 EXPECT_FALSE(weakPtr == nullptr); 107 107 EXPECT_FALSE(weakPtr == 0); 108 108 EXPECT_FALSE(!weakPtr); 109 EXPECT_TRUE(weakPtr != NULL);109 EXPECT_TRUE(weakPtr != nullptr); 110 110 EXPECT_TRUE(weakPtr != 0); 111 111 EXPECT_TRUE(weakPtr); … … 119 119 // default 120 120 WeakPtr<DestroyableTest> weakPtr1; 121 EXPECT_EQ( NULL, weakPtr1.get());121 EXPECT_EQ(nullptr, weakPtr1.get()); 122 122 123 123 // pointer … … 191 191 test->destroy(); 192 192 193 EXPECT_EQ( NULL, vector[0].get());194 EXPECT_EQ( NULL, vector[1].get());195 EXPECT_EQ( NULL, vector[2].get());193 EXPECT_EQ(nullptr, vector[0].get()); 194 EXPECT_EQ(nullptr, vector[1].get()); 195 EXPECT_EQ(nullptr, vector[2].get()); 196 196 } 197 197 … … 202 202 EXPECT_EQ(test, weakPtr.get()); 203 203 weakPtr.reset(); 204 EXPECT_EQ( NULL, weakPtr.get());204 EXPECT_EQ(nullptr, weakPtr.get()); 205 205 206 206 test->destroy(); -
code/branches/cpp11_v2/test/core/singleton/ScopeTest.cc
r10544 r10765 32 32 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::IDENTIFIER); 33 33 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::SCOPED_SINGLETON_WRAPPER); 34 Context::setRootContext(new Context( NULL));34 Context::setRootContext(new Context(nullptr)); 35 35 } 36 36
Note: See TracChangeset
for help on using the changeset viewer.