Changeset 567640 for src/Patterns/unittests
- Timestamp:
- Jan 6, 2011, 12:22:12 PM (15 years ago)
- Children:
- 9f39db
- Parents:
- d76c105
- Location:
- src/Patterns/unittests
- Files:
-
- 3 edited
-
PrototypeFactoryUnitTest.cpp (modified) (1 diff)
-
PrototypeFactoryUnitTest.hpp (modified) (2 diffs)
-
stubs/CloneStub.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Patterns/unittests/PrototypeFactoryUnitTest.cpp
rd76c105 r567640 183 183 CPPUNIT_ASSERT( rndA->getcount() == rndA_3->getcount() ); 184 184 } 185 186 void PrototypeFactoryTest::installPrototypetest() 187 { 188 Prototype< teststubs::Aclass> *newprototype = new Prototype< teststubs::Aclass> (); 189 newprototype->setcount(1); 190 PrototypeFactoryStub::getInstance().installPrototype(newprototype, std::string("Aclass")); 191 newprototype = NULL; 192 193 IPrototype *rndA_1 = PrototypeFactoryStub::getInstance().getProduct(std::string("Aclass")); 194 CPPUNIT_ASSERT( 1 == rndA_1->getcount() ); 195 196 rndA_1->count(); 197 CPPUNIT_ASSERT( 2 == rndA_1->getcount() ); 198 199 IPrototype *rndA_2 = PrototypeFactoryStub::getInstance().getProduct(std::string("Aclass")); 200 CPPUNIT_ASSERT( 1 == rndA_2->getcount() ); 201 CPPUNIT_ASSERT( rndA_1->getcount() != rndA_2->getcount() ); 202 } -
src/Patterns/unittests/PrototypeFactoryUnitTest.hpp
rd76c105 r567640 27 27 CPPUNIT_TEST ( Individualitytest ); 28 28 CPPUNIT_TEST ( PrototypeManipulatortest ); 29 CPPUNIT_TEST ( installPrototypetest ); 29 30 CPPUNIT_TEST_SUITE_END(); 30 31 … … 39 40 void Individualitytest(); 40 41 void PrototypeManipulatortest(); 42 void installPrototypetest(); 41 43 42 44 private: -
src/Patterns/unittests/stubs/CloneStub.hpp
rd76c105 r567640 39 39 40 40 /** 41 * Test isfriend such that it can access protected cstor.41 * Tests are friend such that it can access protected cstor. 42 42 */ 43 43 friend class CloneTest; 44 friend class PrototypeFactoryTest; 44 45 45 46 protected:
Note:
See TracChangeset
for help on using the changeset viewer.
