Changeset a7b761b for src/unittests
- Timestamp:
- May 27, 2010, 10:46:54 AM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 1024cb
- Parents:
- 8f215d (diff), 05a97c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/unittests
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisCorrelationToPointUnitTest.cpp
r8f215d ra7b761b 25 25 #include "periodentafel.hpp" 26 26 #include "tesselation.hpp" 27 #include "World.hpp"28 27 29 28 #ifdef HAVE_TESTRUNNER … … 80 79 81 80 // check that TestMolecule was correctly constructed 82 CPPUNIT_ASSERT_EQUAL( TestMolecule-> AtomCount, 4 );81 CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 ); 83 82 84 83 TestList = World::getInstance().getMolecules(); -
src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
r8f215d ra7b761b 26 26 #include "tesselation.hpp" 27 27 #include "World.hpp" 28 #include "Helpers/Assert.hpp" 28 29 29 30 #include "Helpers/Assert.hpp" … … 40 41 void AnalysisCorrelationToSurfaceUnitTest::setUp() 41 42 { 42 //ASSERT_DO(Assert::Throw);43 ASSERT_DO(Assert::Throw); 43 44 44 45 atom *Walker = NULL; … … 71 72 // construct molecule (tetraeder of hydrogens) base 72 73 TestSurfaceMolecule = World::getInstance().createMolecule(); 74 73 75 Walker = World::getInstance().createAtom(); 74 76 Walker->type = hydrogen; 75 77 *Walker->node = Vector(1., 0., 1. ); 76 77 TestSurfaceMolecule->AddAtom(Walker); 78 TestSurfaceMolecule->AddAtom(Walker); 79 78 80 Walker = World::getInstance().createAtom(); 79 81 Walker->type = hydrogen; 80 82 *Walker->node = Vector(0., 1., 1. ); 81 83 TestSurfaceMolecule->AddAtom(Walker); 84 82 85 Walker = World::getInstance().createAtom(); 83 86 Walker->type = hydrogen; 84 87 *Walker->node = Vector(1., 1., 0. ); 85 88 TestSurfaceMolecule->AddAtom(Walker); 89 86 90 Walker = World::getInstance().createAtom(); 87 91 Walker->type = hydrogen; … … 90 94 91 95 // check that TestMolecule was correctly constructed 92 CPPUNIT_ASSERT_EQUAL( TestSurfaceMolecule-> AtomCount, 4 );96 CPPUNIT_ASSERT_EQUAL( TestSurfaceMolecule->getAtomCount(), 4 ); 93 97 94 98 TestList = World::getInstance().getMolecules(); … … 107 111 *Walker->node = Vector(4., 0., 4. ); 108 112 TestSurfaceMolecule->AddAtom(Walker); 113 109 114 Walker = World::getInstance().createAtom(); 110 115 Walker->type = carbon; 111 116 *Walker->node = Vector(0., 4., 4. ); 112 117 TestSurfaceMolecule->AddAtom(Walker); 118 113 119 Walker = World::getInstance().createAtom(); 114 120 Walker->type = carbon; 115 121 *Walker->node = Vector(4., 4., 0. ); 116 122 TestSurfaceMolecule->AddAtom(Walker); 123 117 124 // add inner atoms 118 125 Walker = World::getInstance().createAtom(); … … 120 127 *Walker->node = Vector(0.5, 0.5, 0.5 ); 121 128 TestSurfaceMolecule->AddAtom(Walker); 129 122 130 TestSurfaceMolecule->ActiveFlag = true; 123 131 TestList->insert(TestSurfaceMolecule); … … 150 158 void AnalysisCorrelationToSurfaceUnitTest::SurfaceTest() 151 159 { 152 CPPUNIT_ASSERT_EQUAL( 4, TestSurfaceMolecule-> AtomCount);160 CPPUNIT_ASSERT_EQUAL( 4, TestSurfaceMolecule->getAtomCount() ); 153 161 CPPUNIT_ASSERT_EQUAL( (size_t)2, TestList->ListOfMolecules.size() ); 154 162 CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->PointsOnBoundary.size() ); -
src/unittests/AnalysisPairCorrelationUnitTest.cpp
r8f215d ra7b761b 79 79 80 80 // check that TestMolecule was correctly constructed 81 CPPUNIT_ASSERT_EQUAL( TestMolecule-> AtomCount, 4 );81 CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 ); 82 82 83 83 TestList = World::getInstance().getMolecules(); -
src/unittests/CountBondsUnitTest.cpp
r8f215d ra7b761b 102 102 103 103 // check that TestMolecule was correctly constructed 104 CPPUNIT_ASSERT_EQUAL( TestMolecule1->AtomCount, 3 ); 105 Walker = TestMolecule1->start->next; 106 CPPUNIT_ASSERT( TestMolecule1->end != Walker ); 107 CPPUNIT_ASSERT_EQUAL( TestMolecule2->AtomCount, 3 ); 108 Walker = TestMolecule2->start->next; 109 CPPUNIT_ASSERT( TestMolecule2->end != Walker ); 104 CPPUNIT_ASSERT_EQUAL( TestMolecule1->getAtomCount(), 3 ); 105 CPPUNIT_ASSERT_EQUAL( TestMolecule2->getAtomCount(), 3 ); 110 106 111 107 // create a small file with table -
src/unittests/LinkedCellUnitTest.cpp
r8f215d ra7b761b 69 69 70 70 // check that TestMolecule was correctly constructed 71 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 3*3*3 ); 72 Walker = TestMolecule->start->next; 73 CPPUNIT_ASSERT( TestMolecule->end != Walker ); 71 CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 3*3*3 ); 74 72 }; 75 73 … … 197 195 { 198 196 // check all atoms 199 atom *Walker = TestMolecule->start; 200 while (Walker->next != TestMolecule->end) { 201 Walker = Walker->next; 202 CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToNode(Walker) ); 197 for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end();++iter){ 198 CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToNode(*iter) ); 203 199 } 204 200 205 201 // check internal vectors, returns false, because this atom is not in LC-list! 206 Walker= World::getInstance().createAtom();207 Walker->setName("test");208 Walker->x= Vector(1,1,1);209 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode( Walker) );210 World::getInstance().destroyAtom( Walker);202 atom *newAtom = World::getInstance().createAtom(); 203 newAtom->setName("test"); 204 newAtom->x= Vector(1,1,1); 205 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(newAtom) ); 206 World::getInstance().destroyAtom(newAtom); 211 207 212 208 // check out of bounds vectors 213 Walker= World::getInstance().createAtom();214 Walker->setName("test");215 Walker->x = Vector(0,-1,0);216 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode( Walker) );217 World::getInstance().destroyAtom( Walker);209 newAtom = World::getInstance().createAtom(); 210 newAtom->setName("test"); 211 newAtom->x = Vector(0,-1,0); 212 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(newAtom) ); 213 World::getInstance().destroyAtom(newAtom); 218 214 }; 219 215 … … 287 283 size = ListOfPoints->size(); 288 284 CPPUNIT_ASSERT_EQUAL( (size_t)27, size ); 289 Walker = TestMolecule->start; 290 Walker = TestMolecule->start; 291 while (Walker->next != TestMolecule->end) { 292 Walker = Walker->next; 293 ListOfPoints->remove(Walker); 285 286 for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end(); ++iter){ 287 ListOfPoints->remove((*iter)); 294 288 size--; 295 289 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() ); … … 306 300 size=ListOfPoints->size(); 307 301 CPPUNIT_ASSERT_EQUAL( (size_t)8, size ); 308 Walker = TestMolecule->start; 309 while (Walker->next != TestMolecule->end) { 310 Walker = Walker->next; 311 if ((Walker->x[0] <2) && (Walker->x[1] <2) && (Walker->x[2] <2)) { 312 ListOfPoints->remove(Walker); 302 for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end(); ++iter){ 303 if (((*iter)->x[0] <2) && ((*iter)->x[1] <2) && ((*iter)->x[2] <2)) { 304 ListOfPoints->remove(*iter); 313 305 size--; 314 306 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() ); … … 326 318 size=ListOfPoints->size(); 327 319 CPPUNIT_ASSERT_EQUAL( (size_t)27, size ); 328 Walker = TestMolecule->start; 329 while (Walker->next != TestMolecule->end) { 330 Walker = Walker->next; 331 ListOfPoints->remove(Walker); 320 for(molecule::iterator iter = TestMolecule->begin(); iter!=TestMolecule->end();++iter){ 321 ListOfPoints->remove(*iter); 332 322 size--; 333 323 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() ); … … 355 345 size = ListOfPoints->size(); 356 346 CPPUNIT_ASSERT_EQUAL( (size_t)7, size ); 357 Walker = TestMolecule->start; 358 while (Walker->next != TestMolecule->end) { 359 Walker = Walker->next; 360 if ((Walker->x.DistanceSquared(tester) - 1.) < MYEPSILON ) { 361 ListOfPoints->remove(Walker); 347 for(molecule::iterator iter = TestMolecule->begin(); iter!=TestMolecule->end();++iter){ 348 if (((*iter)->x.DistanceSquared(tester) - 1.) < MYEPSILON ) { 349 ListOfPoints->remove(*iter); 362 350 size--; 363 351 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() ); -
src/unittests/ObserverTest.cpp
r8f215d ra7b761b 11 11 #include <cppunit/extensions/TestFactoryRegistry.h> 12 12 #include <cppunit/ui/text/TestRunner.h> 13 #include <set> 13 14 14 15 #include "Patterns/Observer.hpp" 16 #include "Patterns/ObservedIterator.hpp" 15 17 #include "Helpers/Assert.hpp" 16 18 … … 162 164 bool wasNotified; 163 165 }; 166 167 class ObservableCollection : public Observable { 168 public: 169 typedef std::set<SimpleObservable*> set; 170 typedef ObservedIterator<set> iterator; 171 typedef set::const_iterator const_iterator; 172 173 ObservableCollection(int _num) : 174 num(_num) 175 { 176 for(int i=0; i<num; ++i){ 177 SimpleObservable *content = new SimpleObservable(); 178 content->signOn(this); 179 theSet.insert(content); 180 } 181 } 182 183 ~ObservableCollection(){ 184 set::iterator iter; 185 for(iter=theSet.begin(); iter!=theSet.end(); ++iter ){ 186 delete (*iter); 187 } 188 } 189 190 iterator begin(){ 191 return iterator(theSet.begin(),this); 192 } 193 194 iterator end(){ 195 return iterator(theSet.end(),this); 196 } 197 198 const int num; 199 200 private: 201 set theSet; 202 }; 203 164 204 165 205 /******************* actuall tests ***************/ … … 173 213 blockObservable = new BlockObservable(); 174 214 notificationObservable = new NotificationObservable(); 215 collection = new ObservableCollection(5); 175 216 176 217 observer1 = new UpdateCountObserver(); … … 181 222 notificationObserver1 = new NotificationObserver(notificationObservable->notification1); 182 223 notificationObserver2 = new NotificationObserver(notificationObservable->notification2); 183 184 224 } 185 225 … … 191 231 delete blockObservable; 192 232 delete notificationObservable; 233 delete collection; 193 234 194 235 delete observer1; … … 277 318 blockObservable->changeMethod2(); 278 319 blockObservable->noChangeMethod(); 320 } 321 322 void ObserverTest::iteratorTest(){ 323 int i = 0; 324 // test the general iterator methods 325 for(ObservableCollection::iterator iter=collection->begin(); iter!=collection->end();++iter){ 326 CPPUNIT_ASSERT(i< collection->num); 327 i++; 328 } 329 330 i=0; 331 for(ObservableCollection::const_iterator iter=collection->begin(); iter!=collection->end();++iter){ 332 CPPUNIT_ASSERT(i<collection->num); 333 i++; 334 } 335 336 collection->signOn(observer1); 337 { 338 // we construct this out of the loop, so the iterator dies at the end of 339 // the scope and not the end of the loop (allows more testing) 340 ObservableCollection::iterator iter; 341 for(iter=collection->begin(); iter!=collection->end(); ++iter){ 342 (*iter)->changeMethod(); 343 } 344 // At this point no change should have been propagated 345 CPPUNIT_ASSERT_EQUAL( 0, observer1->updates); 346 } 347 // After the Iterator has died the propagation should take place 348 CPPUNIT_ASSERT_EQUAL( 1, observer1->updates); 349 350 // when using a const_iterator no changes should be propagated 351 for(ObservableCollection::const_iterator iter = collection->begin(); iter!=collection->end();++iter); 352 CPPUNIT_ASSERT_EQUAL( 1, observer1->updates); 353 collection->signOff(observer1); 279 354 } 280 355 -
src/unittests/ObserverTest.hpp
r8f215d ra7b761b 17 17 class CallObservable; 18 18 class SuperObservable; 19 class ObservableCollection; 19 20 class BlockObservable; 20 21 class NotificationObservable; 21 22 22 23 23 class ObserverTest : public CppUnit::TestFixture … … 29 29 CPPUNIT_TEST ( doesNotifyTest ); 30 30 CPPUNIT_TEST ( doesReportTest ); 31 CPPUNIT_TEST ( iteratorTest ); 31 32 CPPUNIT_TEST ( CircleDetectionTest ); 32 33 CPPUNIT_TEST_SUITE_END(); … … 41 42 void doesNotifyTest(); 42 43 void doesReportTest(); 44 void iteratorTest(); 43 45 void CircleDetectionTest(); 44 46 … … 58 60 SuperObservable *superObservable; 59 61 NotificationObservable *notificationObservable; 62 ObservableCollection *collection; 63 60 64 }; 61 65 -
src/unittests/analysisbondsunittest.cpp
r8f215d ra7b761b 25 25 #include "molecule.hpp" 26 26 #include "periodentafel.hpp" 27 #include "World.hpp" 27 28 28 29 #ifdef HAVE_TESTRUNNER … … 89 90 90 91 // check that TestMolecule was correctly constructed 91 CPPUNIT_ASSERT_EQUAL( TestMolecule-> AtomCount, 5 );92 CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 5 ); 92 93 93 94 // create a small file with table -
src/unittests/bondgraphunittest.cpp
r8f215d ra7b761b 89 89 90 90 // check that TestMolecule was correctly constructed 91 CPPUNIT_ASSERT_EQUAL( TestMolecule-> AtomCount, 4 );91 CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 ); 92 92 93 93 // create a small file with table … … 120 120 }; 121 121 122 /** Tests whether setup worked. 123 */ 124 void BondGraphTest::SetupTest() 125 { 126 CPPUNIT_ASSERT_EQUAL (false, TestMolecule->empty()); 127 CPPUNIT_ASSERT_EQUAL ((size_t)4, TestMolecule->size()); 128 }; 129 122 130 /** UnitTest for BondGraphTest::LoadBondLengthTable(). 123 131 */ … … 134 142 void BondGraphTest::ConstructGraphFromTableTest() 135 143 { 136 atom *Walker = TestMolecule->start->next;137 atom *Runner = TestMolecule->end->previous;138 CPPUNIT_ASSERT( TestMolecule->end != Walker );144 molecule::iterator Walker = TestMolecule->begin(); 145 molecule::iterator Runner = TestMolecule->begin(); 146 Runner++; 139 147 CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) ); 140 148 CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) ); 141 CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );149 CPPUNIT_ASSERT_EQUAL( true , (*Walker)->IsBondedTo((*Runner)) ); 142 150 }; 143 151 … … 146 154 void BondGraphTest::ConstructGraphFromCovalentRadiiTest() 147 155 { 148 atom *Walker = TestMolecule->start->next; 149 atom *Runner = TestMolecule->end->previous; 150 CPPUNIT_ASSERT( TestMolecule->end != Walker ); 156 157 //atom *Walker = TestMolecule->start->next; 158 //atom *Runner = TestMolecule->end->previous; 159 //CPPUNIT_ASSERT( TestMolecule->end != Walker ); 151 160 CPPUNIT_ASSERT_EQUAL( false , BG->LoadBondLengthTable(*dummyname) ); 152 161 CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) ); 153 CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) ); 162 163 // this cannot be assured using dynamic IDs 164 //CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) ); 154 165 }; 155 166 -
src/unittests/bondgraphunittest.hpp
r8f215d ra7b761b 22 22 { 23 23 CPPUNIT_TEST_SUITE( BondGraphTest) ; 24 CPPUNIT_TEST ( SetupTest ); 24 25 CPPUNIT_TEST ( LoadTableTest ); 25 26 CPPUNIT_TEST ( ConstructGraphFromTableTest ); … … 30 31 void setUp(); 31 32 void tearDown(); 33 void SetupTest(); 32 34 void LoadTableTest(); 33 35 void ConstructGraphFromTableTest(); -
src/unittests/listofbondsunittest.cpp
r8f215d ra7b761b 74 74 75 75 // check that TestMolecule was correctly constructed 76 CPPUNIT_ASSERT_EQUAL( TestMolecule-> AtomCount, 4 );76 CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 ); 77 77 78 78 }; … … 90 90 }; 91 91 92 /** Tests whether setup worked correctly. 93 * 94 */ 95 void ListOfBondsTest::SetupTest() 96 { 97 CPPUNIT_ASSERT_EQUAL( false, TestMolecule->empty() ); 98 CPPUNIT_ASSERT_EQUAL( (size_t)4, TestMolecule->size() ); 99 }; 100 92 101 /** Unit Test of molecule::AddBond() 93 102 * … … 96 105 { 97 106 bond *Binder = NULL; 98 atom *atom1 = TestMolecule->start->next; 99 atom *atom2 = atom1->next; 107 molecule::iterator iter = TestMolecule->begin(); 108 atom *atom1 = *iter; 109 iter++; 110 atom *atom2 = *iter; 100 111 CPPUNIT_ASSERT( atom1 != NULL ); 101 112 CPPUNIT_ASSERT( atom2 != NULL ); … … 124 135 { 125 136 bond *Binder = NULL; 126 atom *atom1 = TestMolecule->start->next; 127 atom *atom2 = atom1->next; 137 molecule::iterator iter = TestMolecule->begin(); 138 atom *atom1 = *iter; 139 iter++; 140 atom *atom2 = *iter; 128 141 CPPUNIT_ASSERT( atom1 != NULL ); 129 142 CPPUNIT_ASSERT( atom2 != NULL ); … … 150 163 { 151 164 bond *Binder = NULL; 152 atom *atom1 = TestMolecule->start->next; 153 atom *atom2 = atom1->next; 154 atom *atom3 = atom2->next; 165 molecule::iterator iter = TestMolecule->begin(); 166 atom *atom1 = *iter; 167 iter++; 168 atom *atom2 = *iter; 169 iter++; 170 atom *atom3 = *iter; 155 171 CPPUNIT_ASSERT( atom1 != NULL ); 156 172 CPPUNIT_ASSERT( atom2 != NULL ); … … 189 205 { 190 206 bond *Binder = NULL; 191 atom *atom1 = TestMolecule->start->next; 192 atom *atom2 = atom1->next; 207 molecule::iterator iter = TestMolecule->begin(); 208 atom *atom1 = *iter; 209 iter++; 210 atom *atom2 = *iter; 193 211 CPPUNIT_ASSERT( atom1 != NULL ); 194 212 CPPUNIT_ASSERT( atom2 != NULL ); … … 215 233 { 216 234 bond *Binder = NULL; 217 atom *atom1 = TestMolecule->start->next; 218 atom *atom2 = atom1->next; 235 molecule::iterator iter = TestMolecule->begin(); 236 atom *atom1 = *iter; 237 iter++; 238 atom *atom2 = *iter; 219 239 CPPUNIT_ASSERT( atom1 != NULL ); 220 240 CPPUNIT_ASSERT( atom2 != NULL ); … … 240 260 { 241 261 bond *Binder = NULL; 242 atom *atom1 = TestMolecule->start->next; 243 atom *atom2 = atom1->next; 262 molecule::iterator iter = TestMolecule->begin(); 263 atom *atom1 = *iter; 264 iter++; 265 atom *atom2 = *iter; 244 266 CPPUNIT_ASSERT( atom1 != NULL ); 245 267 CPPUNIT_ASSERT( atom2 != NULL ); -
src/unittests/listofbondsunittest.hpp
r8f215d ra7b761b 20 20 { 21 21 CPPUNIT_TEST_SUITE( ListOfBondsTest) ; 22 CPPUNIT_TEST ( SetupTest ); 22 23 CPPUNIT_TEST ( AddingBondTest ); 23 24 CPPUNIT_TEST ( RemovingBondTest ); … … 31 32 void setUp(); 32 33 void tearDown(); 34 void SetupTest(); 33 35 void AddingBondTest(); 34 36 void RemovingBondTest();
Note:
See TracChangeset
for help on using the changeset viewer.