Changeset cd032d for src/unittests/AtomDescriptorTest.cpp
- Timestamp:
- Mar 11, 2010, 2:46:41 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:
- 68d781
- Parents:
- a77c96 (diff), ed58ad (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. - File:
-
- 1 edited
-
src/unittests/AtomDescriptorTest.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AtomDescriptorTest.cpp
ra77c96 rcd032d 29 29 // set up and tear down 30 30 void AtomDescriptorTest::setUp(){ 31 World::get ();31 World::getInstance(); 32 32 for(int i=0;i<ATOM_COUNT;++i){ 33 atoms[i]= World::get ()->createAtom();33 atoms[i]= World::getInstance().createAtom(); 34 34 atomIds[i]= atoms[i]->getId(); 35 35 } … … 37 37 38 38 void AtomDescriptorTest::tearDown(){ 39 World:: destroy();39 World::purgeInstance(); 40 40 } 41 41 … … 73 73 74 74 void AtomDescriptorTest::AtomBaseSetsTest(){ 75 std::vector<atom*> allAtoms = World::get ()->getAllAtoms(AllAtoms());75 std::vector<atom*> allAtoms = World::getInstance().getAllAtoms(AllAtoms()); 76 76 CPPUNIT_ASSERT_EQUAL( true , hasAllAtoms(allAtoms,atomIds)); 77 77 CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicateAtoms(allAtoms)); 78 78 79 std::vector<atom*> noAtoms = World::get ()->getAllAtoms(NoAtoms());79 std::vector<atom*> noAtoms = World::getInstance().getAllAtoms(NoAtoms()); 80 80 CPPUNIT_ASSERT_EQUAL( true , noAtoms.empty()); 81 81 } … … 83 83 // test Atoms from boundaries and middle of the set 84 84 atom* testAtom; 85 testAtom = World::get ()->getAtom(AtomById(atomIds[0]));85 testAtom = World::getInstance().getAtom(AtomById(atomIds[0])); 86 86 CPPUNIT_ASSERT(testAtom); 87 87 CPPUNIT_ASSERT_EQUAL( atomIds[0], testAtom->getId()); 88 testAtom = World::get ()->getAtom(AtomById(atomIds[ATOM_COUNT/2]));88 testAtom = World::getInstance().getAtom(AtomById(atomIds[ATOM_COUNT/2])); 89 89 CPPUNIT_ASSERT(testAtom); 90 90 CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT/2], testAtom->getId()); 91 testAtom = World::get ()->getAtom(AtomById(atomIds[ATOM_COUNT-1]));91 testAtom = World::getInstance().getAtom(AtomById(atomIds[ATOM_COUNT-1])); 92 92 CPPUNIT_ASSERT(testAtom); 93 93 CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT-1], testAtom->getId()); … … 103 103 } 104 104 // test from outside of set 105 testAtom = World::get ()->getAtom(AtomById(outsideId));105 testAtom = World::getInstance().getAtom(AtomById(outsideId)); 106 106 CPPUNIT_ASSERT(!testAtom); 107 107 } … … 109 109 // test some elementary set operations 110 110 { 111 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(AllAtoms()||NoAtoms());111 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(AllAtoms()||NoAtoms()); 112 112 CPPUNIT_ASSERT_EQUAL( true , hasAllAtoms(testAtoms,atomIds)); 113 113 CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicateAtoms(testAtoms)); … … 115 115 116 116 { 117 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(NoAtoms()||AllAtoms());117 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(NoAtoms()||AllAtoms()); 118 118 CPPUNIT_ASSERT_EQUAL( true , hasAllAtoms(testAtoms,atomIds)); 119 119 CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicateAtoms(testAtoms)); … … 121 121 122 122 { 123 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(NoAtoms()&&AllAtoms());123 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(NoAtoms()&&AllAtoms()); 124 124 CPPUNIT_ASSERT_EQUAL( true , testAtoms.empty()); 125 125 } 126 126 127 127 { 128 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(AllAtoms()&&NoAtoms());128 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(AllAtoms()&&NoAtoms()); 129 129 CPPUNIT_ASSERT_EQUAL( true , testAtoms.empty()); 130 130 } 131 131 132 132 { 133 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(!AllAtoms());133 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(!AllAtoms()); 134 134 CPPUNIT_ASSERT_EQUAL( true , testAtoms.empty()); 135 135 } 136 136 137 137 { 138 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(!NoAtoms());138 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(!NoAtoms()); 139 139 CPPUNIT_ASSERT_EQUAL( true , hasAllAtoms(testAtoms,atomIds)); 140 140 CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicateAtoms(testAtoms)); … … 143 143 // exclude and include some atoms 144 144 { 145 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(AllAtoms()&&(!AtomById(atomIds[ATOM_COUNT/2])));145 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(AllAtoms()&&(!AtomById(atomIds[ATOM_COUNT/2]))); 146 146 std::set<atomId_t> excluded; 147 147 excluded.insert(atomIds[ATOM_COUNT/2]); … … 152 152 153 153 { 154 std::vector<atom*> testAtoms = World::get ()->getAllAtoms(NoAtoms()||(AtomById(atomIds[ATOM_COUNT/2])));154 std::vector<atom*> testAtoms = World::getInstance().getAllAtoms(NoAtoms()||(AtomById(atomIds[ATOM_COUNT/2]))); 155 155 CPPUNIT_ASSERT_EQUAL( (size_t)1, testAtoms.size()); 156 156 CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT/2], testAtoms[0]->getId());
Note:
See TracChangeset
for help on using the changeset viewer.
