Changeset f761c4 for src/unittests
- Timestamp:
- Aug 5, 2010, 7:56:22 PM (14 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:
- a881f5
- Parents:
- ec149d (diff), 7baf4a (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. - Location:
- src/unittests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/FormulaUnittest.cpp
rec149d rf761c4 185 185 } 186 186 { 187 Formula formula("CH2(COOH)2"); 188 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)4); 189 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)4); 190 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)3); 191 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 192 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 193 } 194 { 195 Formula formula("K4[Fe(CN)6]"); 196 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)0); 197 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)0); 198 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)6); 199 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 200 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 201 CPPUNIT_ASSERT_EQUAL(formula["K"],(unsigned int)4); 202 CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)1); 203 CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)6); 204 } 205 { 206 Formula formula("[CrCl3(H2O)3]"); 207 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)6); 208 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)3); 209 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)0); 210 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 211 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 212 CPPUNIT_ASSERT_EQUAL(formula["Cr"],(unsigned int)1); 213 CPPUNIT_ASSERT_EQUAL(formula["Cl"],(unsigned int)3); 214 } 215 { 216 Formula formula("Mg3[Fe(CN)6]2"); 217 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)0); 218 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)0); 219 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)12); 220 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)0); 221 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 222 CPPUNIT_ASSERT_EQUAL(formula["Mg"],(unsigned int)3); 223 CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)2); 224 CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)12); 225 } 226 { 227 Formula formula("Na[Fe((HO2CCH2)2NCH2CH2N(CH2CO2H)2)]"); 228 CPPUNIT_ASSERT_EQUAL(formula["H"],(unsigned int)16); 229 CPPUNIT_ASSERT_EQUAL(formula["O"],(unsigned int)8); 230 CPPUNIT_ASSERT_EQUAL(formula["C"],(unsigned int)10); 231 CPPUNIT_ASSERT_EQUAL(formula["Na"],(unsigned int)1); 232 CPPUNIT_ASSERT_EQUAL(formula["He"],(unsigned int)0); 233 CPPUNIT_ASSERT_EQUAL(formula["Mg"],(unsigned int)0); 234 CPPUNIT_ASSERT_EQUAL(formula["Fe"],(unsigned int)1); 235 CPPUNIT_ASSERT_EQUAL(formula["N"],(unsigned int)2); 236 } 237 { 187 238 CPPUNIT_ASSERT_THROW(Formula formula("74107"),ParseError); 188 239 CPPUNIT_ASSERT_THROW(Formula formula(" "),ParseError); … … 192 243 CPPUNIT_ASSERT_THROW(Formula formula("1NaCl"),ParseError); 193 244 CPPUNIT_ASSERT_THROW(Formula formula("Mag"),ParseError); 245 CPPUNIT_ASSERT_THROW(Formula formula("AgCl)"),ParseError); 246 CPPUNIT_ASSERT_THROW(Formula formula("(Na"),ParseError); 247 CPPUNIT_ASSERT_THROW(Formula formula("(Mag)"),ParseError); 248 CPPUNIT_ASSERT_THROW(Formula formula("MgCl2)"),ParseError); 249 CPPUNIT_ASSERT_THROW(Formula formula("((MgCl2)"),ParseError); 250 CPPUNIT_ASSERT_THROW(Formula formula("(MgCl2))"),ParseError); 251 CPPUNIT_ASSERT_THROW(Formula formula("(MgCl2]"),ParseError); 252 CPPUNIT_ASSERT_THROW(Formula formula("[MgCl2)"),ParseError); 253 CPPUNIT_ASSERT_THROW(Formula formula("N(aCl"),ParseError); 254 CPPUNIT_ASSERT_THROW(Formula formula("Na()Cl"),ParseError); 194 255 } 195 256 -
src/unittests/Makefile.am
rec149d rf761c4 49 49 noinst_PROGRAMS = $(TESTS) TestRunner 50 50 51 GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}51 GSLLIBS = ../libgslwrapper.a ../libmolecuilderbase.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 52 52 ALLLIBS = ../libmolecuilder.a ${GSLLIBS} 53 53 PARSERLIBS = ../libparser.a ${ALLLIBS} 54 UILIBS = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ${ALLLIBS} ${BOOST_PROGRAM_OPTIONS_LIB} 54 55 55 56 TESTSOURCES = \ … … 129 130 130 131 ActionSequenceTest_SOURCES = UnitTestMain.cpp ActionSequenceTest.cpp ActionSequenceTest.hpp $(srcdir)/../version.c 131 ActionSequenceTest_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}132 ActionSequenceTest_LDADD = ${UILIBS} 132 133 133 134 ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp … … 195 196 196 197 manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp $(srcdir)/../version.c 197 manipulateAtomsTest_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}198 manipulateAtomsTest_LDADD = ${UILIBS} 198 199 199 200 MatrixUnittest_SOURCES = UnitTestMain.cpp MatrixUnittest.cpp MatrixUnittest.hpp … … 234 235 235 236 TestRunner_SOURCES = TestRunnerMain.cpp $(srcdir)/../version.c $(TESTSOURCES) $(TESTHEADERS) 236 TestRunner_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}237 TestRunner_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a ../libmolecuilderbase.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} 237 238 238 239 VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp
Note:
See TracChangeset
for help on using the changeset viewer.