Changeset 9ef76a for molecuilder/src/unittests
- Timestamp:
- Feb 19, 2010, 11:49:54 AM (16 years ago)
- Children:
- 01d28a
- Parents:
- 5d4edf
- Location:
- molecuilder/src/unittests
- Files:
-
- 2 edited
-
manipulateAtomsTest.cpp (modified) (2 diffs)
-
manipulateAtomsTest.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/unittests/manipulateAtomsTest.cpp
r5d4edf r9ef76a 49 49 }; 50 50 51 class countObserver : public Observer{ 52 public: 53 countObserver() : 54 count(0) 55 {} 56 virtual ~countObserver(){} 57 58 void update(Observable *){ 59 count++; 60 } 61 62 void subjectKilled(Observable *) 63 {} 64 65 int count; 66 }; 51 67 52 68 // set up and tear down … … 131 147 } 132 148 149 void manipulateAtomsTest::testObserver(){ 150 countObserver *obs = new countObserver(); 151 World::get()->signOn(obs); 152 ManipulateAtomsProcess *proc = World::get()->manipulateAtoms(boost::bind(operation,_1),"FOO",AllAtoms() && !AtomById(ATOM_COUNT/2)); 153 proc->call(); 154 155 CPPUNIT_ASSERT_EQUAL(1,obs->count); 156 World::get()->signOff(obs); 157 delete obs; 158 } 159 133 160 /********************************************** Main routine **************************************/ 134 161 -
molecuilder/src/unittests/manipulateAtomsTest.hpp
r5d4edf r9ef76a 20 20 CPPUNIT_TEST ( testManipulateSimple ); 21 21 CPPUNIT_TEST ( testManipulateExcluded ); 22 CPPUNIT_TEST ( testObserver ); 22 23 CPPUNIT_TEST_SUITE_END(); 23 24 … … 28 29 void testManipulateSimple(); 29 30 void testManipulateExcluded(); 31 void testObserver(); 30 32 31 33 private:
Note:
See TracChangeset
for help on using the changeset viewer.
