Changeset 9646 for code/branches/core6/test/core
- Timestamp:
- Aug 13, 2013, 11:35:26 PM (11 years ago)
- Location:
- code/branches/core6/test/core/class
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc
r9640 r9646 20 20 { 21 21 class BaseInterface1 : public OrxonoxInterface 22 { public: BaseInterface1() { RegisterRootObject(BaseInterface1); } }; 22 { 23 public: 24 BaseInterface1() 25 { 26 RegisterRootObject(BaseInterface1); 27 } 28 29 virtual void test1() = 0; 30 }; 23 31 24 32 class BaseInterface2 : public OrxonoxInterface 25 { public: BaseInterface2() { RegisterRootObject(BaseInterface2); } }; 33 { 34 public: 35 BaseInterface2() 36 { 37 RegisterRootObject(BaseInterface2); 38 } 39 40 virtual void test2() = 0; 41 }; 26 42 27 43 class Interface1 : public BaseInterface1 28 { public: Interface1() { RegisterObject(Interface1); } }; 44 { 45 public: 46 Interface1() 47 { 48 RegisterObject(Interface1); 49 } 50 }; 29 51 30 52 class Interface2 : public BaseInterface2 31 { public: Interface2() { RegisterObject(Interface2); } }; 53 { 54 public: 55 Interface2() 56 { 57 RegisterObject(Interface2); 58 } 59 }; 32 60 33 61 class BaseClass : public OrxonoxClass 34 { public: BaseClass() { RegisterRootObject(BaseClass); } }; 62 { 63 public: 64 BaseClass() 65 { 66 RegisterRootObject(BaseClass); 67 } 68 }; 35 69 36 70 class Class0 : public BaseClass 37 { public: Class0() { RegisterObject(Class0); } }; 71 { 72 public: 73 Class0() 74 { 75 RegisterObject(Class0); 76 } 77 }; 38 78 39 79 class Class1 : public BaseClass, public Interface1 40 { public: Class1() { RegisterObject(Class1); } }; 80 { 81 public: 82 Class1() 83 { 84 RegisterObject(Class1); 85 } 86 87 virtual void test1() {} 88 }; 41 89 42 90 class Class2a : public BaseClass, public Interface1, Interface2 43 { public: Class2a() { RegisterObject(Class2a); } }; 91 { 92 public: 93 Class2a() 94 { 95 RegisterObject(Class2a); 96 } 97 98 virtual void test1() {} 99 virtual void test2() {} 100 }; 44 101 45 102 class Class2b : public BaseClass, public Interface2, Interface1 46 { public: Class2b() { RegisterObject(Class2b); } }; 103 { 104 public: 105 Class2b() 106 { 107 RegisterObject(Class2b); 108 } 109 110 virtual void test1() {} 111 virtual void test2() {} 112 }; 47 113 48 114 class Class3 : public BaseClass, public BaseInterface1, BaseInterface2 49 { public: Class3() { RegisterObject(Class3); } }; 115 { 116 public: 117 Class3() 118 { 119 RegisterObject(Class3); 120 } 121 122 virtual void test1() {} 123 virtual void test2() {} 124 }; 50 125 51 126 // Fixture … … 55 130 virtual void SetUp() 56 131 { 57 registerClass("BaseInterface1", new ClassFactoryNoArgs<BaseInterface1>()); 58 registerClass("BaseInterface2", new ClassFactoryNoArgs<BaseInterface2>()); 59 registerClass("Interface1", new ClassFactoryNoArgs<Interface1>()); 60 registerClass("Interface2", new ClassFactoryNoArgs<Interface2>()); 132 registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>()); 133 registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>()); 134 registerClass("BaseInterface1", static_cast<ClassFactory<BaseInterface1>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface)); 135 registerClass("BaseInterface2", static_cast<ClassFactory<BaseInterface2>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface)); 136 registerClass("Interface1", static_cast<ClassFactory<Interface1>*>(NULL), false).inheritsFrom(Class(BaseInterface1)); 137 registerClass("Interface2", static_cast<ClassFactory<Interface2>*>(NULL), false).inheritsFrom(Class(BaseInterface2)); 61 138 registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>()); 62 139 registerClass("Class0", new ClassFactoryNoArgs<Class0>()); … … 74 151 } 75 152 }; 153 154 bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier) 155 { 156 return identifiers.find(identifier) != identifiers.end(); 157 } 76 158 } 77 159 … … 135 217 136 218 EXPECT_EQ(2u, identifier->getDirectChildren().size()); 219 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Interface1))); 220 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3))); 221 137 222 EXPECT_EQ(5u, identifier->getChildren().size()); 138 EXPECT_EQ(0u, identifier->getDirectParents().size()); 139 EXPECT_EQ(0u, identifier->getParents().size()); 223 EXPECT_TRUE(contains(identifier->getChildren(), Class(Interface1))); 224 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3))); 225 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1))); 226 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a))); 227 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b))); 228 229 EXPECT_EQ(1u, identifier->getDirectParents().size()); 230 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface))); 231 232 EXPECT_EQ(2u, identifier->getParents().size()); 233 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 234 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 140 235 } 141 236 … … 145 240 146 241 EXPECT_EQ(2u, identifier->getDirectChildren().size()); 242 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Interface2))); 243 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3))); 244 147 245 EXPECT_EQ(4u, identifier->getChildren().size()); 148 EXPECT_EQ(0u, identifier->getDirectParents().size()); 149 EXPECT_EQ(0u, identifier->getParents().size()); 246 EXPECT_TRUE(contains(identifier->getChildren(), Class(Interface2))); 247 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3))); 248 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a))); 249 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b))); 250 251 EXPECT_EQ(1u, identifier->getDirectParents().size()); 252 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface))); 253 254 EXPECT_EQ(2u, identifier->getParents().size()); 255 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 256 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 150 257 } 151 258 … … 155 262 156 263 EXPECT_EQ(3u, identifier->getDirectChildren().size()); 264 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class1))); 265 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2a))); 266 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2b))); 267 157 268 EXPECT_EQ(3u, identifier->getChildren().size()); 158 EXPECT_EQ(1u, identifier->getDirectParents().size()); 159 EXPECT_EQ(1u, identifier->getParents().size()); 269 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1))); 270 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a))); 271 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b))); 272 273 EXPECT_EQ(1u, identifier->getDirectParents().size()); 274 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface1))); 275 276 EXPECT_EQ(3u, identifier->getParents().size()); 277 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 278 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 279 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1))); 160 280 } 161 281 … … 165 285 166 286 EXPECT_EQ(2u, identifier->getDirectChildren().size()); 287 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2a))); 288 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2b))); 289 167 290 EXPECT_EQ(2u, identifier->getChildren().size()); 168 EXPECT_EQ(1u, identifier->getDirectParents().size()); 169 EXPECT_EQ(1u, identifier->getParents().size()); 291 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a))); 292 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b))); 293 294 EXPECT_EQ(1u, identifier->getDirectParents().size()); 295 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface2))); 296 297 EXPECT_EQ(3u, identifier->getParents().size()); 298 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 299 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 300 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2))); 170 301 } 171 302 … … 175 306 176 307 EXPECT_EQ(5u, identifier->getDirectChildren().size()); 308 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class0))); 309 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class1))); 310 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2a))); 311 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2b))); 312 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3))); 313 177 314 EXPECT_EQ(5u, identifier->getChildren().size()); 178 EXPECT_EQ(0u, identifier->getDirectParents().size()); 179 EXPECT_EQ(0u, identifier->getParents().size()); 315 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class0))); 316 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1))); 317 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a))); 318 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b))); 319 EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3))); 320 321 EXPECT_EQ(1u, identifier->getDirectParents().size()); 322 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass))); 323 324 EXPECT_EQ(2u, identifier->getParents().size()); 325 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 326 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 180 327 } 181 328 … … 185 332 186 333 EXPECT_EQ(0u, identifier->getDirectChildren().size()); 334 187 335 EXPECT_EQ(0u, identifier->getChildren().size()); 188 EXPECT_EQ(1u, identifier->getDirectParents().size()); 189 EXPECT_EQ(1u, identifier->getParents().size()); 336 337 EXPECT_EQ(1u, identifier->getDirectParents().size()); 338 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass))); 339 340 EXPECT_EQ(3u, identifier->getParents().size()); 341 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 342 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 343 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass))); 190 344 } 191 345 … … 195 349 196 350 EXPECT_EQ(0u, identifier->getDirectChildren().size()); 351 197 352 EXPECT_EQ(0u, identifier->getChildren().size()); 353 198 354 EXPECT_EQ(2u, identifier->getDirectParents().size()); 199 EXPECT_EQ(3u, identifier->getParents().size()); 355 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass))); 356 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface1))); 357 358 EXPECT_EQ(6u, identifier->getParents().size()); 359 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 360 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 361 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass))); 362 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 363 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1))); 364 EXPECT_TRUE(contains(identifier->getParents(), Class(Interface1))); 200 365 } 201 366 … … 205 370 206 371 EXPECT_EQ(0u, identifier->getDirectChildren().size()); 372 207 373 EXPECT_EQ(0u, identifier->getChildren().size()); 374 208 375 EXPECT_EQ(3u, identifier->getDirectParents().size()); 209 EXPECT_EQ(5u, identifier->getParents().size()); 376 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass))); 377 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface1))); 378 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface2))); 379 380 EXPECT_EQ(8u, identifier->getParents().size()); 381 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 382 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 383 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass))); 384 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 385 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1))); 386 EXPECT_TRUE(contains(identifier->getParents(), Class(Interface1))); 387 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2))); 388 EXPECT_TRUE(contains(identifier->getParents(), Class(Interface2))); 210 389 } 211 390 … … 215 394 216 395 EXPECT_EQ(0u, identifier->getDirectChildren().size()); 396 217 397 EXPECT_EQ(0u, identifier->getChildren().size()); 398 218 399 EXPECT_EQ(3u, identifier->getDirectParents().size()); 219 EXPECT_EQ(5u, identifier->getParents().size()); 400 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass))); 401 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface1))); 402 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface2))); 403 404 EXPECT_EQ(8u, identifier->getParents().size()); 405 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 406 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 407 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass))); 408 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 409 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1))); 410 EXPECT_TRUE(contains(identifier->getParents(), Class(Interface1))); 411 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2))); 412 EXPECT_TRUE(contains(identifier->getParents(), Class(Interface2))); 220 413 } 221 414 … … 225 418 226 419 EXPECT_EQ(0u, identifier->getDirectChildren().size()); 420 227 421 EXPECT_EQ(0u, identifier->getChildren().size()); 422 228 423 EXPECT_EQ(3u, identifier->getDirectParents().size()); 229 EXPECT_EQ(3u, identifier->getParents().size()); 424 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass))); 425 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface1))); 426 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface2))); 427 428 EXPECT_EQ(6u, identifier->getParents().size()); 429 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 430 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 431 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass))); 432 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 433 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1))); 434 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2))); 230 435 } 231 436 } -
code/branches/core6/test/core/class/IdentifierExternalClassHierarchyTest.cc
r9640 r9646 8 8 { 9 9 class Interface : virtual public Identifiable 10 { public: Interface() { RegisterRootObject(Interface); } }; 10 { 11 public: 12 Interface() 13 { 14 RegisterRootObject(Interface); 15 } 16 17 virtual void test() = 0; 18 }; 11 19 12 20 class BaseClass : virtual public Identifiable 13 { public: BaseClass() { RegisterRootObject(BaseClass); } }; 21 { 22 public: 23 BaseClass() 24 { 25 RegisterRootObject(BaseClass); 26 } 27 }; 14 28 15 29 class RealClass : public BaseClass, public Interface 16 { public: RealClass() { RegisterObject(RealClass); } }; 30 { 31 public: 32 RealClass() 33 { 34 RegisterObject(RealClass); 35 } 36 37 virtual void test() {} 38 }; 17 39 18 40 // Fixture … … 22 44 virtual void SetUp() 23 45 { 24 registerClass("Interface", new ClassFactoryNoArgs<Interface>());46 registerClass("Interface", static_cast<ClassFactory<Interface>*>(NULL), false).inheritsFrom(Class(Identifiable)); 25 47 registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>()); 26 48 registerClass("RealClass", new ClassFactoryNoArgs<RealClass>()); … … 34 56 } 35 57 }; 58 59 bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier) 60 { 61 return identifiers.find(identifier) != identifiers.end(); 62 } 36 63 } 37 64 … … 59 86 Identifier* identifier = Class(Interface); 60 87 88 EXPECT_EQ(1u, identifier->getDirectChildren().size()); 89 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass))); 90 61 91 EXPECT_EQ(1u, identifier->getChildren().size()); 62 EXPECT_EQ(0u, identifier->getParents().size()); 92 EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass))); 93 94 EXPECT_EQ(1u, identifier->getDirectParents().size()); 95 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Identifiable))); 96 97 EXPECT_EQ(1u, identifier->getParents().size()); 98 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 63 99 } 64 100 … … 67 103 Identifier* identifier = Class(BaseClass); 68 104 105 EXPECT_EQ(1u, identifier->getDirectChildren().size()); 106 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass))); 107 69 108 EXPECT_EQ(1u, identifier->getChildren().size()); 70 EXPECT_EQ(0u, identifier->getParents().size()); 109 EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass))); 110 111 EXPECT_EQ(1u, identifier->getDirectParents().size()); 112 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Identifiable))); 113 114 EXPECT_EQ(1u, identifier->getParents().size()); 115 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 71 116 } 72 117 … … 75 120 Identifier* identifier = Class(RealClass); 76 121 122 EXPECT_EQ(0u, identifier->getDirectChildren().size()); 123 77 124 EXPECT_EQ(0u, identifier->getChildren().size()); 78 EXPECT_EQ(2u, identifier->getParents().size()); 125 126 EXPECT_EQ(2u, identifier->getDirectParents().size()); 127 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface))); 128 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass))); 129 130 EXPECT_EQ(3u, identifier->getParents().size()); 131 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 132 EXPECT_TRUE(contains(identifier->getParents(), Class(Interface))); 133 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass))); 79 134 } 80 135 } -
code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc
r9640 r9646 10 10 { 11 11 class Interface : public OrxonoxInterface 12 { public: Interface() { RegisterRootObject(Interface); } }; 12 { 13 public: 14 Interface() 15 { 16 RegisterRootObject(Interface); 17 } 18 19 virtual void test() = 0; 20 }; 13 21 14 22 class BaseClass : public OrxonoxClass 15 { public: BaseClass() { RegisterRootObject(BaseClass); } }; 23 { 24 public: 25 BaseClass() 26 { 27 RegisterRootObject(BaseClass); 28 } 29 }; 16 30 17 31 class RealClass : public BaseClass, public Interface 18 { public: RealClass() { RegisterObject(RealClass); } }; 32 { 33 public: 34 RealClass() 35 { 36 RegisterObject(RealClass); 37 } 38 39 virtual void test() {} 40 }; 19 41 20 42 // Fixture … … 24 46 virtual void SetUp() 25 47 { 26 registerClass("Interface", new ClassFactoryNoArgs<Interface>()); 48 registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>()); 49 registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>()); 50 registerClass("Interface", static_cast<ClassFactory<Interface>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface)); 27 51 registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>()); 28 52 registerClass("RealClass", new ClassFactoryNoArgs<RealClass>()); … … 36 60 } 37 61 }; 62 63 bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier) 64 { 65 return identifiers.find(identifier) != identifiers.end(); 66 } 38 67 } 39 68 … … 61 90 Identifier* identifier = Class(Interface); 62 91 92 EXPECT_EQ(1u, identifier->getDirectChildren().size()); 93 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass))); 94 63 95 EXPECT_EQ(1u, identifier->getChildren().size()); 64 EXPECT_EQ(0u, identifier->getParents().size()); 96 EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass))); 97 98 EXPECT_EQ(1u, identifier->getDirectParents().size()); 99 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface))); 100 101 EXPECT_EQ(2u, identifier->getParents().size()); 102 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 103 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 65 104 } 66 105 … … 69 108 Identifier* identifier = Class(BaseClass); 70 109 110 EXPECT_EQ(1u, identifier->getDirectChildren().size()); 111 EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass))); 112 71 113 EXPECT_EQ(1u, identifier->getChildren().size()); 72 EXPECT_EQ(0u, identifier->getParents().size()); 114 EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass))); 115 116 EXPECT_EQ(1u, identifier->getDirectParents().size()); 117 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass))); 118 119 EXPECT_EQ(2u, identifier->getParents().size()); 120 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 121 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 73 122 } 74 123 … … 77 126 Identifier* identifier = Class(RealClass); 78 127 128 EXPECT_EQ(0u, identifier->getDirectChildren().size()); 129 79 130 EXPECT_EQ(0u, identifier->getChildren().size()); 80 EXPECT_EQ(2u, identifier->getParents().size()); 131 132 EXPECT_EQ(2u, identifier->getDirectParents().size()); 133 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface))); 134 EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass))); 135 136 EXPECT_EQ(5u, identifier->getParents().size()); 137 EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable))); 138 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface))); 139 EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass))); 140 EXPECT_TRUE(contains(identifier->getParents(), Class(Interface))); 141 EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass))); 81 142 } 82 143 }
Note: See TracChangeset
for help on using the changeset viewer.