Changeset f761c4 for src/unittests


Ignore:
Timestamp:
Aug 5, 2010, 7:56:22 PM (14 years ago)
Author:
Frederik Heber <heber@…>
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.
Message:

Merge branch 'StructureRefactoring' of jupiter:molecuilder into StructureRefactoring

Location:
src/unittests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/FormulaUnittest.cpp

    rec149d rf761c4  
    185185  }
    186186  {
     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  {
    187238    CPPUNIT_ASSERT_THROW(Formula formula("74107"),ParseError);
    188239    CPPUNIT_ASSERT_THROW(Formula formula("  "),ParseError);
     
    192243    CPPUNIT_ASSERT_THROW(Formula formula("1NaCl"),ParseError);
    193244    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);
    194255  }
    195256
  • src/unittests/Makefile.am

    rec149d rf761c4  
    4949noinst_PROGRAMS = $(TESTS) TestRunner
    5050
    51 GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
     51GSLLIBS = ../libgslwrapper.a ../libmolecuilderbase.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
    5252ALLLIBS = ../libmolecuilder.a ${GSLLIBS}
    5353PARSERLIBS = ../libparser.a ${ALLLIBS}
     54UILIBS = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ${ALLLIBS} ${BOOST_PROGRAM_OPTIONS_LIB}
    5455
    5556TESTSOURCES = \
     
    129130
    130131ActionSequenceTest_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}
     132ActionSequenceTest_LDADD = ${UILIBS}
    132133
    133134ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
     
    195196
    196197manipulateAtomsTest_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}
     198manipulateAtomsTest_LDADD = ${UILIBS}
    198199
    199200MatrixUnittest_SOURCES = UnitTestMain.cpp MatrixUnittest.cpp MatrixUnittest.hpp
     
    234235
    235236TestRunner_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}
     237TestRunner_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a ../libmolecuilderbase.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
    237238
    238239VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp
Note: See TracChangeset for help on using the changeset viewer.