Changeset 2124aa for src/FunctionApproximation/unittests
- Timestamp:
- Nov 11, 2016, 2:25:30 PM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChronosMutex, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- c738f1
- Parents:
- 228340
- git-author:
- Frederik Heber <heber@…> (10/04/16 14:05:46)
- git-committer:
- Frederik Heber <heber@…> (11/11/16 14:25:30)
- Location:
- src/FunctionApproximation/unittests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FunctionApproximation/unittests/ExtractorsUnitTest.cpp
r228340 r2124aa 98 98 CPPUNIT_ASSERT( (args[i].distance >= 0) && (args[i].distance <= 4)); 99 99 } 100 101 /** UnitTest for gatherAllSymmetricDistances() with edges 102 */ 103 void ExtractorsTest::gatherAllSymmetricDistances_edgesTest() 104 { 105 // create positions 106 Fragment::positions_t positions; 107 Fragment::position_t pos(3, 0.); 108 for (double i = 0; i < 5; i+=1.) { 109 pos[0] = i; 110 positions.push_back(pos); 111 } 112 FragmentationEdges::edges_t edges; 113 for (size_t i=1;i<5;++i) 114 edges += FragmentationEdges::edge_t(i-1, i); 115 116 // create charges 117 Fragment::atomicnumbers_t atomicnumbers; 118 atomicnumbers += 6, 6, 1, 1, 1; 119 120 // create distances 121 FunctionModel::arguments_t args = 122 Extractors::gatherAllSymmetricDistances(positions, atomicnumbers, edges, 0); 123 CPPUNIT_ASSERT_EQUAL( (size_t)(5*4/2), args.size() ); 124 125 // check created args 126 for (size_t i=0; i< 5*4/2; ++i) { 127 CPPUNIT_ASSERT( (args[i].distance >= 0) && (args[i].distance <= 4)); 128 if ((args[i].indices.first+1) == args[i].indices.second) 129 CPPUNIT_ASSERT( args[i].bonded ); 130 } 131 } -
src/FunctionApproximation/unittests/ExtractorsUnitTest.hpp
r228340 r2124aa 23 23 CPPUNIT_TEST_SUITE( ExtractorsTest) ; 24 24 CPPUNIT_TEST ( gatherAllSymmetricDistancesTest ); 25 CPPUNIT_TEST ( gatherAllSymmetricDistances_edgesTest ); 25 26 CPPUNIT_TEST_SUITE_END(); 26 27 … … 29 30 void tearDown(); 30 31 void gatherAllSymmetricDistancesTest(); 32 void gatherAllSymmetricDistances_edgesTest(); 31 33 32 34 private: -
src/FunctionApproximation/unittests/Makefile.am
r228340 r2124aa 20 20 FUNCTIONAPPROXIMATIONLIBS = \ 21 21 libUnitTest.la \ 22 ../libMolecuilder.la \23 22 ../libMolecuilderFunctionApproximation.la \ 23 ../libMolecuilderFragmentation.la \ 24 ../libMolecuilderFragmentation_getFromKeysetStub.la \ 24 25 $(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \ 25 26 ${CodePatterns_LIBS} \
Note:
See TracChangeset
for help on using the changeset viewer.