Changeset 5ec8e3 for src/unittests
- Timestamp:
- Jul 2, 2010, 9:51:01 AM (15 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:
- 36166d
- Parents:
- 56fb09 (diff), 7ac4af (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 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/LineUnittest.cpp
r56fb09 r5ec8e3 17 17 18 18 #include <iostream> 19 #include <cmath> 19 20 20 21 using namespace std; … … 352 353 CPPUNIT_ASSERT_EQUAL(fixture,zeroVec); 353 354 } 355 356 void LineUnittest::sphereIntersectionTest(){ 357 { 358 std::vector<Vector> res = la1->getSphereIntersections(); 359 CPPUNIT_ASSERT_EQUAL(res.size(),(size_t)2); 360 CPPUNIT_ASSERT(testDirection(res[0],e1)); 361 CPPUNIT_ASSERT(testDirection(res[1],e1)); 362 CPPUNIT_ASSERT(res[0]!=res[1]); 363 } 364 365 { 366 std::vector<Vector> res = la2->getSphereIntersections(); 367 CPPUNIT_ASSERT_EQUAL(res.size(),(size_t)2); 368 CPPUNIT_ASSERT(testDirection(res[0],e2)); 369 CPPUNIT_ASSERT(testDirection(res[1],e2)); 370 CPPUNIT_ASSERT(res[0]!=res[1]); 371 } 372 373 { 374 std::vector<Vector> res = la3->getSphereIntersections(); 375 CPPUNIT_ASSERT_EQUAL(res.size(),(size_t)2); 376 CPPUNIT_ASSERT(testDirection(res[0],e3)); 377 CPPUNIT_ASSERT(testDirection(res[1],e3)); 378 CPPUNIT_ASSERT(res[0]!=res[1]); 379 } 380 381 { 382 std::vector<Vector> res = lp1->getSphereIntersections(); 383 CPPUNIT_ASSERT_EQUAL(res.size(),(size_t)2); 384 CPPUNIT_ASSERT((res[0]==e1) || (res[0]==e2)); 385 CPPUNIT_ASSERT((res[1]==e1) || (res[1]==e2)); 386 CPPUNIT_ASSERT(res[0]!=res[1]); 387 } 388 389 { 390 std::vector<Vector> res = lp2->getSphereIntersections(); 391 CPPUNIT_ASSERT_EQUAL(res.size(),(size_t)2); 392 CPPUNIT_ASSERT((res[0]==e2) || (res[0]==e3)); 393 CPPUNIT_ASSERT((res[1]==e2) || (res[1]==e3)); 394 CPPUNIT_ASSERT(res[0]!=res[1]); 395 } 396 397 { 398 std::vector<Vector> res = lp3->getSphereIntersections(); 399 CPPUNIT_ASSERT_EQUAL(res.size(),(size_t)2); 400 CPPUNIT_ASSERT((res[0]==e3) || (res[0]==e1)); 401 CPPUNIT_ASSERT((res[1]==e3) || (res[1]==e1)); 402 CPPUNIT_ASSERT(res[0]!=res[1]); 403 } 404 } -
src/unittests/LineUnittest.hpp
r56fb09 r5ec8e3 22 22 CPPUNIT_TEST ( intersectionTest ); 23 23 CPPUNIT_TEST ( rotationTest ); 24 CPPUNIT_TEST ( sphereIntersectionTest ); 24 25 CPPUNIT_TEST_SUITE_END(); 25 26 … … 33 34 void intersectionTest(); 34 35 void rotationTest(); 36 void sphereIntersectionTest(); 35 37 36 38 private: -
src/unittests/Makefile.am
r56fb09 r5ec8e3 38 38 periodentafelTest \ 39 39 PlaneUnittest \ 40 ShapeUnittest \ 40 41 SingletonTest \ 41 42 StackClassUnitTest \ … … 83 84 periodentafelTest.cpp \ 84 85 PlaneUnittest.cpp \ 86 ShapeUnittest.cpp \ 85 87 SingletonTest.cpp \ 86 88 stackclassunittest.cpp \ … … 210 212 PlaneUnittest_LDADD = ${ALLLIBS} 211 213 214 ShapeUnittest_SOURCES = UnitTestMain.cpp ShapeUnittest.cpp ShapeUnittest.hpp 215 ShapeUnittest_LDADD = ${ALLLIBS} 216 212 217 SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp 213 218 SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB} -
src/unittests/PlaneUnittest.cpp
r56fb09 r5ec8e3 11 11 #include <cppunit/extensions/TestFactoryRegistry.h> 12 12 #include <cppunit/ui/text/TestRunner.h> 13 14 #include <cmath> 13 15 14 16 #ifdef HAVE_TESTRUNNER -
src/unittests/linearsystemofequationsunittest.cpp
r56fb09 r5ec8e3 12 12 #include <cppunit/extensions/TestFactoryRegistry.h> 13 13 #include <cppunit/ui/text/TestRunner.h> 14 #include <cmath> 14 15 15 16 #include "linearsystemofequationsunittest.hpp" -
src/unittests/vectorunittest.cpp
r56fb09 r5ec8e3 21 21 #include "Plane.hpp" 22 22 #include "Exceptions/LinearDependenceException.hpp" 23 #include "Matrix.hpp" 23 24 24 25 #ifdef HAVE_TESTRUNNER … … 214 215 CPPUNIT_ASSERT(testVector.ScalarProduct(three) < MYEPSILON); 215 216 } 216 217 218 /**219 * UnitTest for Vector::IsInParallelepiped().220 */221 void VectorTest::IsInParallelepipedTest()222 {223 double parallelepiped[NDIM*NDIM];224 parallelepiped[0] = 1;225 parallelepiped[1] = 0;226 parallelepiped[2] = 0;227 parallelepiped[3] = 0;228 parallelepiped[4] = 1;229 parallelepiped[5] = 0;230 parallelepiped[6] = 0;231 parallelepiped[7] = 0;232 parallelepiped[8] = 1;233 234 fixture = zero;235 CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );236 fixture = Vector(2.5,2.5,2.5);237 CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );238 fixture = Vector(1.,1.,1.);239 CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );240 fixture = Vector(3.5,3.5,3.5);241 CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );242 fixture = Vector(2.,2.,2.);243 CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );244 fixture = Vector(2.,3.,2.);245 CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );246 fixture = Vector(-2.,2.,-1.);247 CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );248 }249 -
src/unittests/vectorunittest.hpp
r56fb09 r5ec8e3 27 27 CPPUNIT_TEST ( ProjectionTest ); 28 28 CPPUNIT_TEST ( NormalsTest ); 29 CPPUNIT_TEST ( IsInParallelepipedTest );30 29 CPPUNIT_TEST_SUITE_END(); 31 30 … … 45 44 void LineIntersectionTest(); 46 45 void VectorRotationTest(); 47 void IsInParallelepipedTest();48 46 49 47 private:
Note:
See TracChangeset
for help on using the changeset viewer.