Changeset 11071 for code/trunk/test/core_plugin
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/test/core_plugin/PluginTest.cc
r11013 r11071 23 23 PluginTest() 24 24 { 25 this->plugin_ = NULL;25 this->plugin_ = nullptr; 26 26 } 27 27 … … 44 44 { 45 45 delete this->plugin_; 46 this->plugin_ = NULL;47 } 48 49 virtual void TearDown() 46 this->plugin_ = nullptr; 47 } 48 49 virtual void TearDown() override 50 50 { 51 51 // make sure the plugin is unloaded … … 77 77 TEST_F(PluginTest, LoadsIdentifier) 78 78 { 79 EXPECT_TRUE(getIdentifier() == NULL);80 this->loadPlugin(); 81 EXPECT_TRUE(getIdentifier() != NULL);79 EXPECT_TRUE(getIdentifier() == nullptr); 80 this->loadPlugin(); 81 EXPECT_TRUE(getIdentifier() != nullptr); 82 82 this->unloadPlugin(); 83 83 } … … 86 86 { 87 87 this->loadPlugin(); 88 EXPECT_TRUE(getIdentifier() != NULL);89 this->unloadPlugin(); 90 EXPECT_TRUE(getIdentifier() == NULL);88 EXPECT_TRUE(getIdentifier() != nullptr); 89 this->unloadPlugin(); 90 EXPECT_TRUE(getIdentifier() == nullptr); 91 91 } 92 92 … … 94 94 { 95 95 this->loadPlugin(); 96 EXPECT_TRUE(getIdentifier() != NULL);97 this->unloadPlugin(); 98 EXPECT_TRUE(getIdentifier() == NULL);99 this->loadPlugin(); 100 EXPECT_TRUE(getIdentifier() != NULL);96 EXPECT_TRUE(getIdentifier() != nullptr); 97 this->unloadPlugin(); 98 EXPECT_TRUE(getIdentifier() == nullptr); 99 this->loadPlugin(); 100 EXPECT_TRUE(getIdentifier() != nullptr); 101 101 this->unloadPlugin(); 102 102 } … … 107 107 108 108 Identifier* identifier = getIdentifier(); 109 ASSERT_TRUE(identifier != NULL);110 111 Identifiable* object = identifier->fabricate( NULL);112 ASSERT_TRUE(object != NULL);109 ASSERT_TRUE(identifier != nullptr); 110 111 Identifiable* object = identifier->fabricate(nullptr); 112 ASSERT_TRUE(object != nullptr); 113 113 114 114 Testclass* testclass = orxonox_cast<Testclass*>(object); 115 ASSERT_TRUE(testclass != NULL);115 ASSERT_TRUE(testclass != nullptr); 116 116 117 117 EXPECT_EQ(666, testclass->getValue()); … … 131 131 std::vector<Testsingleton*> singletons; 132 132 133 for ( ObjectList<Listable>::iterator it = ObjectList<Listable>::begin(); it; ++it)134 { 135 Testsingleton* singleton = dynamic_cast<Testsingleton*>( *it);133 for (Listable* listable : ObjectList<Listable>()) 134 { 135 Testsingleton* singleton = dynamic_cast<Testsingleton*>(listable); 136 136 if (singleton) 137 137 singletons.push_back(singleton); … … 141 141 { 142 142 case 0: 143 return NULL;143 return nullptr; 144 144 case 1: 145 145 return singletons[0]; … … 151 151 TEST_F(PluginTest, LoadsSingleton) 152 152 { 153 EXPECT_TRUE(getSingleton() == NULL);154 this->loadPlugin(); 155 EXPECT_TRUE(getSingleton() != NULL);153 EXPECT_TRUE(getSingleton() == nullptr); 154 this->loadPlugin(); 155 EXPECT_TRUE(getSingleton() != nullptr); 156 156 this->unloadPlugin(); 157 157 } … … 160 160 { 161 161 this->loadPlugin(); 162 EXPECT_TRUE(getSingleton() != NULL);163 this->unloadPlugin(); 164 EXPECT_TRUE(getSingleton() == NULL);162 EXPECT_TRUE(getSingleton() != nullptr); 163 this->unloadPlugin(); 164 EXPECT_TRUE(getSingleton() == nullptr); 165 165 } 166 166 … … 168 168 { 169 169 this->loadPlugin(); 170 EXPECT_TRUE(getSingleton() != NULL);171 this->unloadPlugin(); 172 EXPECT_TRUE(getSingleton() == NULL);173 this->loadPlugin(); 174 EXPECT_TRUE(getSingleton() != NULL);170 EXPECT_TRUE(getSingleton() != nullptr); 171 this->unloadPlugin(); 172 EXPECT_TRUE(getSingleton() == nullptr); 173 this->loadPlugin(); 174 EXPECT_TRUE(getSingleton() != nullptr); 175 175 this->unloadPlugin(); 176 176 } … … 181 181 182 182 Testsingleton* singleton = getSingleton(); 183 ASSERT_TRUE(singleton != NULL);183 ASSERT_TRUE(singleton != nullptr); 184 184 185 185 EXPECT_EQ(999, singleton->getValue()); … … 255 255 TEST_F(PluginTest, LoadsConsoleCommand) 256 256 { 257 EXPECT_TRUE(getConsoleCommand() == NULL);258 this->loadPlugin(); 259 EXPECT_TRUE(getConsoleCommand() != NULL);257 EXPECT_TRUE(getConsoleCommand() == nullptr); 258 this->loadPlugin(); 259 EXPECT_TRUE(getConsoleCommand() != nullptr); 260 260 this->unloadPlugin(); 261 261 } … … 264 264 { 265 265 this->loadPlugin(); 266 EXPECT_TRUE(getConsoleCommand() != NULL);267 this->unloadPlugin(); 268 EXPECT_TRUE(getConsoleCommand() == NULL);266 EXPECT_TRUE(getConsoleCommand() != nullptr); 267 this->unloadPlugin(); 268 EXPECT_TRUE(getConsoleCommand() == nullptr); 269 269 } 270 270 … … 272 272 { 273 273 this->loadPlugin(); 274 EXPECT_TRUE(getConsoleCommand() != NULL);275 this->unloadPlugin(); 276 EXPECT_TRUE(getConsoleCommand() == NULL);277 this->loadPlugin(); 278 EXPECT_TRUE(getConsoleCommand() != NULL);274 EXPECT_TRUE(getConsoleCommand() != nullptr); 275 this->unloadPlugin(); 276 EXPECT_TRUE(getConsoleCommand() == nullptr); 277 this->loadPlugin(); 278 EXPECT_TRUE(getConsoleCommand() != nullptr); 279 279 this->unloadPlugin(); 280 280 } … … 285 285 286 286 ConsoleCommand* command = getConsoleCommand(); 287 ASSERT_TRUE(command != NULL);287 ASSERT_TRUE(command != nullptr); 288 288 289 289 EXPECT_EQ(999, (*command->getExecutor())(333, 666).get<int>());
Note: See TracChangeset
for help on using the changeset viewer.