Changeset 7d82a5 for src/unittests
- Timestamp:
- Feb 13, 2013, 3:47:38 PM (12 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:
- b4b364
- Parents:
- c8302f3
- git-author:
- Frederik Heber <heber@…> (11/02/12 13:38:08)
- git-committer:
- Frederik Heber <heber@…> (02/13/13 15:47:38)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/ListOfBondsUnitTest.cpp
rc8302f3 r7d82a5 44 44 #include "World.hpp" 45 45 #include "Atom/atom.hpp" 46 #include "Atom/AtomObserver.hpp" 47 46 48 #include "Bond/bond.hpp" 47 49 #include "Element/element.hpp" … … 109 111 // are all cleaned when the world is destroyed 110 112 World::purgeInstance(); 113 AtomObserver::purgeInstance(); 111 114 logger::purgeInstance(); 115 errorLogger::purgeInstance(); 116 WorldTime::purgeInstance(); 117 112 118 }; 113 119 … … 126 132 void ListOfBondsTest::AddingBondTest() 127 133 { 128 bond::ptr Binder = NULL;134 bond::ptr Binder; 129 135 molecule::iterator iter = TestMolecule->begin(); 130 136 atom *atom1 = *iter; … … 160 166 void ListOfBondsTest::DeleteBondTest() 161 167 { 162 bond::ptr Binder = NULL;168 bond::ptr Binder; 163 169 molecule::iterator iter = TestMolecule->begin(); 164 170 atom *atom1 = *iter; … … 173 179 174 180 // remove bond 175 delete Binder;176 // atom1->removeBond(Binder);177 //atom2->removeBond(Binder);181 atom1->removeBond(Binder); 182 // removed for atom2 automatically but check where nothing breaks 183 atom2->removeBond(Binder); 178 184 179 185 // check if removed from atoms … … 198 204 atom *atom1 = NULL; 199 205 atom *atom2 = NULL; 200 bond::ptr Binder = NULL;206 bond::ptr Binder; 201 207 { 202 208 molecule::iterator iter = TestMolecule->begin(); … … 207 213 CPPUNIT_ASSERT( atom1 != NULL ); 208 214 CPPUNIT_ASSERT( atom2 != NULL ); 215 CPPUNIT_ASSERT_EQUAL( (size_t) 0, atom1->getListOfBonds().size() ); 216 CPPUNIT_ASSERT_EQUAL( (size_t) 0, atom2->getListOfBonds().size() ); 209 217 210 218 // add bond … … 213 221 214 222 // access test via CurrentTime 215 { 216 const BondList& ListOfBonds = atom1->getListOfBonds(); 217 CPPUNIT_ASSERT_EQUAL( (size_t) 1, ListOfBonds.size() ); 218 } 219 { 220 const BondList& ListOfBonds = atom2->getListOfBonds(); 221 CPPUNIT_ASSERT_EQUAL( (size_t) 1, ListOfBonds.size() ); 222 } 223 CPPUNIT_ASSERT_EQUAL( (size_t) 1, atom1->getListOfBonds().size() ); 224 CPPUNIT_ASSERT_EQUAL( (size_t) 1, atom2->getListOfBonds().size() ); 223 225 224 226 CPPUNIT_ASSERT_EQUAL( true, TestMolecule->hasBondStructure() ); … … 244 246 atom *atom1 = NULL; 245 247 atom *atom2 = NULL; 246 bond::ptr Binder = NULL;248 bond::ptr Binder; 247 249 { 248 250 molecule::iterator iter = TestMolecule->begin();
Note:
See TracChangeset
for help on using the changeset viewer.