Changeset 1024cb for src/unittests/LinkedCellUnitTest.cpp
- Timestamp:
- May 31, 2010, 5:32:27 PM (16 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, Candidate_v1.7.0, 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:
- e08c46
- Parents:
- 42af9e (diff), a7b761b (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. - git-author:
- Frederik Heber <heber@…> (05/31/10 17:29:30)
- git-committer:
- Frederik Heber <heber@…> (05/31/10 17:32:27)
- File:
-
- 1 edited
-
src/unittests/LinkedCellUnitTest.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/LinkedCellUnitTest.cpp
r42af9e r1024cb 60 60 61 61 // check that TestMolecule was correctly constructed 62 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 3*3*3 ); 63 Walker = TestMolecule->start->next; 64 CPPUNIT_ASSERT( TestMolecule->end != Walker ); 62 CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 3*3*3 ); 65 63 }; 66 64 … … 187 185 { 188 186 // check all atoms 189 atom *Walker = TestMolecule->start; 190 while (Walker->next != TestMolecule->end) { 191 Walker = Walker->next; 192 CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToNode(Walker) ); 187 for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end();++iter){ 188 CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToNode(*iter) ); 193 189 } 194 190 195 191 // check internal vectors, returns false, because this atom is not in LC-list! 196 Walker= World::getInstance().createAtom();197 Walker->setName("test");198 Walker->x= Vector(1,1,1);199 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode( Walker) );200 World::getInstance().destroyAtom( Walker);192 atom *newAtom = World::getInstance().createAtom(); 193 newAtom->setName("test"); 194 newAtom->x= Vector(1,1,1); 195 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(newAtom) ); 196 World::getInstance().destroyAtom(newAtom); 201 197 202 198 // check out of bounds vectors 203 Walker= World::getInstance().createAtom();204 Walker->setName("test");205 Walker->x = Vector(0,-1,0);206 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode( Walker) );207 World::getInstance().destroyAtom( Walker);199 newAtom = World::getInstance().createAtom(); 200 newAtom->setName("test"); 201 newAtom->x = Vector(0,-1,0); 202 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(newAtom) ); 203 World::getInstance().destroyAtom(newAtom); 208 204 }; 209 205 … … 277 273 size = ListOfPoints->size(); 278 274 CPPUNIT_ASSERT_EQUAL( (size_t)27, size ); 279 Walker = TestMolecule->start; 280 Walker = TestMolecule->start; 281 while (Walker->next != TestMolecule->end) { 282 Walker = Walker->next; 283 ListOfPoints->remove(Walker); 275 276 for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end(); ++iter){ 277 ListOfPoints->remove((*iter)); 284 278 size--; 285 279 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() ); … … 296 290 size=ListOfPoints->size(); 297 291 CPPUNIT_ASSERT_EQUAL( (size_t)8, size ); 298 Walker = TestMolecule->start; 299 while (Walker->next != TestMolecule->end) { 300 Walker = Walker->next; 301 if ((Walker->x[0] <2) && (Walker->x[1] <2) && (Walker->x[2] <2)) { 302 ListOfPoints->remove(Walker); 292 for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end(); ++iter){ 293 if (((*iter)->x[0] <2) && ((*iter)->x[1] <2) && ((*iter)->x[2] <2)) { 294 ListOfPoints->remove(*iter); 303 295 size--; 304 296 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() ); … … 316 308 size=ListOfPoints->size(); 317 309 CPPUNIT_ASSERT_EQUAL( (size_t)27, size ); 318 Walker = TestMolecule->start; 319 while (Walker->next != TestMolecule->end) { 320 Walker = Walker->next; 321 ListOfPoints->remove(Walker); 310 for(molecule::iterator iter = TestMolecule->begin(); iter!=TestMolecule->end();++iter){ 311 ListOfPoints->remove(*iter); 322 312 size--; 323 313 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() ); … … 345 335 size = ListOfPoints->size(); 346 336 CPPUNIT_ASSERT_EQUAL( (size_t)7, size ); 347 Walker = TestMolecule->start; 348 while (Walker->next != TestMolecule->end) { 349 Walker = Walker->next; 350 if ((Walker->x.DistanceSquared(tester) - 1.) < MYEPSILON ) { 351 ListOfPoints->remove(Walker); 337 for(molecule::iterator iter = TestMolecule->begin(); iter!=TestMolecule->end();++iter){ 338 if (((*iter)->x.DistanceSquared(tester) - 1.) < MYEPSILON ) { 339 ListOfPoints->remove(*iter); 352 340 size--; 353 341 CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
Note:
See TracChangeset
for help on using the changeset viewer.
