Changeset a367b8


Ignore:
Timestamp:
Nov 15, 2012, 5:31:06 PM (12 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:
4dc309
Parents:
4477b7
git-author:
Michael Ankele <ankele@…> (09/05/12 15:38:31)
git-committer:
Frederik Heber <heber@…> (11/15/12 17:31:06)
Message:

ShapeFactoryUnitTest added

Location:
src/Shapes
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/Shapes/Shape.hpp

    r4477b7 ra367b8  
    2727class LineSegmentSet;
    2828class Line;
     29class ShapeFactoryTest;
    2930
    3031class Shape
     
    3334  typedef boost::shared_ptr<Shape_impl> impl_ptr;
    3435  friend impl_ptr getShapeImpl(const Shape&);
     36  friend class ShapeFactoryTest;
    3537
    3638  Shape(impl_ptr);
  • src/Shapes/ShapeFactory.cpp

    r4477b7 ra367b8  
    8585
    8686
     87void ShapeFactory::setType(ShapeType type)
     88{
     89  ShapeNameMap::iterator iter = shapeNameMap.find(type);
     90  ASSERT(iter != shapeNameMap.end(),
     91      "ShapeFactory::setType() - unknown type: "+toString(type)+".");
     92  this->type = type;
     93}
     94
    8795void ShapeFactory::setStretch(const Vector &stretch)
    8896{
    89   ASSERT(!stretch.IsZero(),
    90       "ShapeFactory::setStretch() - stretch is zero.");
     97  for (int i=0; i<NDIM; i++){
     98    ASSERT(stretch[i] > 0,
     99      "ShapeFactory::setStretch() - non positive component.");
     100  }
    91101  this->stretch = stretch;
    92102}
  • src/Shapes/ShapeFactory.hpp

    r4477b7 ra367b8  
    4444
    4545  ShapeType getType() const { return type; }
    46   void setType(ShapeType type) { this->type = type; }
     46  void setType(ShapeType type);
    4747
    4848  // create a shape
  • src/Shapes/unittests/Makefile.am

    r4477b7 ra367b8  
    55SHAPETESTSSOURCES = \
    66        ../Shapes/unittests/BaseShapesUnitTest.cpp \
     7        ../Shapes/unittests/ShapeFactoryUnitTest.cpp \
    78        ../Shapes/unittests/ShapeOpsUnitTest.cpp \
    89        ../Shapes/unittests/Shape_HomogeneousPointsUnitTest.cpp
     
    1011SHAPETESTSHEADERS= \
    1112        ../Shapes/unittests/BaseShapesUnitTest.hpp \
     13        ../Shapes/unittests/ShapeFactoryUnitTest.hpp \
    1214        ../Shapes/unittests/ShapeOpsUnitTest.hpp \
    1315        ../Shapes/unittests/Shape_HomogeneousPointsUnitTest.cpp
     
    1517SHAPETESTS = \
    1618  BaseShapesUnitTest \
     19  ShapeFactoryUnitTest \
    1720  ShapeOpsUnitTest \
    1821  Shape_HomogeneousPointsUnitTest
     
    3841BaseShapesUnitTest_LDADD = $(SHAPELIBS)
    3942
     43ShapeFactoryUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
     44        ../Shapes/unittests/ShapeFactoryUnitTest.cpp \
     45        ../Shapes/unittests/ShapeFactoryUnitTest.hpp \
     46        ../Shapes/unittests/stubs/ApproximateShapeAreaStub.cpp \
     47        ../Shapes/unittests/stubs/ApproximateShapeVolumeStub.cpp
     48nodist_ShapeFactoryUnitTest_SOURCES = \
     49        ../Helpers/defs.hpp \
     50        ../Helpers/defs.cpp
     51ShapeFactoryUnitTest_LDADD = $(SHAPELIBS)
     52
    4053ShapeOpsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    4154        ../Shapes/unittests/ShapeOpsUnitTest.cpp \
Note: See TracChangeset for help on using the changeset viewer.