Changeset 112f90 for src/unittests


Ignore:
Timestamp:
Jul 29, 2010, 12:23:21 PM (14 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
c508ef5
Parents:
047878
Message:

Fixed ActionSequenceTest and ManipulateAtomsTest

Location:
src/unittests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/ActionSequenceTest.cpp

    r047878 r112f90  
    1616#include "Actions/ActionHistory.hpp"
    1717#include "Actions/ActionRegistry.hpp"
     18
     19#include "DummyUI.hpp"
    1820
    1921#ifdef HAVE_TESTRUNNER
     
    121123
    122124void ActionSequenceTest::setUp(){
     125  static bool hasDescriptor = false;
    123126  ActionHistory::init();
     127  // TODO: find a way to really reset the factory to a clean state in tear-down
     128  if(!hasDescriptor){
     129    UIFactory::registerFactory(new DummyUIFactory::description());
     130    hasDescriptor = true;
     131  }
     132  UIFactory::makeUserInterface("Dummy");
    124133  // create some necessary stubs used in this test
    125134  positive1 = new canUndoActionStub();
     
    148157  ActionHistory::purgeInstance();
    149158  ActionRegistry::purgeInstance();
     159  UIFactory::purgeInstance();
    150160}
    151161
  • src/unittests/Makefile.am

    r047878 r112f90  
    77AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
    88
    9 MENUTESTS = \
    10   ActionSequenceTest
    11 
    129TESTS = \
     10  ActionSequenceTest \
    1311  ActOnAllUnitTest \
    1412  AnalysisBondsUnitTests \
     
    4442  Tesselation_BoundaryTriangleUnitTest \
    4543  Tesselation_InOutsideUnitTest \
    46   VectorUnitTest \
    47   ${MENUTESTS}
     44  VectorUnitTest
    4845 
    4946 
     
    5249
    5350GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
    54 ALLLIBS = ../libmolecuilder.a ../UIElements/libMolecuilderUI.a ${GSLLIBS}
     51ALLLIBS = ../libmolecuilder.a ${GSLLIBS}
    5552PARSERLIBS = ../libparser.a ${ALLLIBS}
    5653
     
    128125 
    129126
    130 ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
    131 ActionSequenceTest_LDADD = ${ALLLIBS}
     127ActionSequenceTest_SOURCES = UnitTestMain.cpp ActionSequenceTest.cpp ActionSequenceTest.hpp $(srcdir)/../version.c
     128ActionSequenceTest_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
    132129
    133130ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
     
    191188LogUnitTest_LDADD = ${ALLLIBS}
    192189
    193 manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
    194 manipulateAtomsTest_LDADD = ${ALLLIBS}
     190manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp $(srcdir)/../version.c
     191manipulateAtomsTest_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
    195192
    196193MatrixUnittest_SOURCES = UnitTestMain.cpp MatrixUnittest.cpp MatrixUnittest.hpp
     
    230227Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS}
    231228
    232 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
    233 TestRunner_LDADD = ${ALLLIBS}
     229TestRunner_SOURCES = TestRunnerMain.cpp $(srcdir)/../version.c $(TESTSOURCES) $(TESTHEADERS)
     230TestRunner_LDADD = ../UIElements/libMolecuilderUI.a ../Actions/libMolecuilderActions.a ../libmolecuilder.a ../libparser.a ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
    234231
    235232VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp
  • src/unittests/manipulateAtomsTest.cpp

    r047878 r112f90  
    2222#include "World.hpp"
    2323#include "atom.hpp"
     24
     25#include "DummyUI.hpp"
    2426
    2527#ifdef HAVE_TESTRUNNER
     
    7274// set up and tear down
    7375void manipulateAtomsTest::setUp(){
     76  static bool hasDescriptor = false;
    7477  ActionHistory::init();
    7578  World::getInstance();
     79  // TODO: find a way to really reset the factory to a clean state in tear-down
     80  if(!hasDescriptor){
     81    UIFactory::registerFactory(new DummyUIFactory::description());
     82    hasDescriptor = true;
     83  }
     84  UIFactory::makeUserInterface("Dummy");
    7685  for(int i=0;i<ATOM_COUNT;++i){
    7786    atoms[i]= new AtomStub(i);
     
    8392  ActionRegistry::purgeInstance();
    8493  ActionHistory::purgeInstance();
     94  UIFactory::purgeInstance();
    8595}
    8696
Note: See TracChangeset for help on using the changeset viewer.