- Timestamp:
- Dec 3, 2012, 9:49:06 AM (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:
- bf42a0
- Parents:
- 2a0eb0
- git-author:
- Frederik Heber <heber@…> (09/19/12 10:11:12)
- git-committer:
- Frederik Heber <heber@…> (12/03/12 09:49:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Graph/unittests/CheckAgainstAdjacencyFileUnitTest.cpp
r2a0eb0 r3501d2 101 101 void CheckAgainstAdjacencyFileTest::setUp() 102 102 { 103 // failing asserts should be thrown 104 ASSERT_DO(Assert::Throw); 105 103 106 const element *hydrogen = World::getInstance().getPeriode()->FindElement(1); 104 107 CPPUNIT_ASSERT(hydrogen != NULL); 105 106 // failing asserts should be thrown107 ASSERT_DO(Assert::Throw);108 108 109 109 TestMolecule = World::getInstance().createMolecule(); … … 148 148 void CheckAgainstAdjacencyFileTest::CreateInternalMapTest() 149 149 { 150 std::stringstream input; 151 CheckAgainstAdjacencyFile fileChecker(input); 150 152 World::getInstance().selectAllAtoms(AllAtoms()); 151 CheckAgainstAdjacencyFile fileChecker(World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection()); 153 const World &world = World::getInstance(); 154 fileChecker.CreateInternalMap(world.beginAtomSelection(), world.endAtomSelection()); 152 155 153 156 // check size (it's 8*2 + 2*1 = 18 keys) … … 178 181 std::stringstream input(adjacencyfile); 179 182 World::getInstance().selectAllAtoms(NoAtoms()); 180 CheckAgainstAdjacencyFile fileChecker( World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection());181 fileChecker. ParseInExternalMap(input);183 CheckAgainstAdjacencyFile fileChecker(input); 184 fileChecker.CreateInternalMap(World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection()); 182 185 183 186 // check size (it's 8*2 + 2*1 = 18 keys) … … 204 207 void CheckAgainstAdjacencyFileTest::CompareInternalExternalMapTest() 205 208 { 206 World::getInstance().selectAllAtoms(AllAtoms());207 CheckAgainstAdjacencyFile fileChecker( World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection());209 std::stringstream input(adjacencyfile); 210 CheckAgainstAdjacencyFile fileChecker(input); 208 211 209 212 // assert non-equality before parsing … … 213 216 214 217 // parse 215 std::stringstream input(adjacencyfile);216 fileChecker. ParseInExternalMap(input);218 World::getInstance().selectAllAtoms(AllAtoms()); 219 fileChecker.CreateInternalMap(World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection()); 217 220 218 221 // assert equality after parsing … … 228 231 { 229 232 World::getInstance().selectAllAtoms(AllAtoms()); 230 CheckAgainstAdjacencyFile fileChecker(World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection());231 233 { 232 234 // parse right 233 235 std::stringstream input(adjacencyfile); 234 CPPUNIT_ASSERT( fileChecker(input) ); 236 CheckAgainstAdjacencyFile fileChecker(input); 237 CPPUNIT_ASSERT( fileChecker(World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection()) ); 235 238 } 236 239 { 237 240 // parse wrong1 238 241 std::stringstream input(wrongadjacencyfile1); 239 CPPUNIT_ASSERT( !fileChecker(input) ); 242 CheckAgainstAdjacencyFile fileChecker(input); 243 CPPUNIT_ASSERT( !fileChecker(World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection()) ); 240 244 } 241 245 { … … 244 248 #ifndef NDEBUG 245 249 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 246 CPPUNIT_ASSERT_THROW( fileChecker(input), Assert::AssertionFailure );250 CPPUNIT_ASSERT_THROW( CheckAgainstAdjacencyFile fileChecker(input), Assert::AssertionFailure ); 247 251 #else 248 CPPUNIT_ASSERT( !fileChecker(input) ); 252 CheckAgainstAdjacencyFile fileChecker(input); 253 CPPUNIT_ASSERT( !fileChecker(World::getInstance().beginAtomSelection(), World::getInstance().endAtomSelection()) ); 249 254 #endif 250 255 }
Note:
See TracChangeset
for help on using the changeset viewer.