Changeset e138de for src/unittests
- Timestamp:
- Nov 4, 2009, 7:56:04 PM (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:
- 1614174, e5ad5c
- Parents:
- 7326b2
- Location:
- src/unittests
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/ActOnAllUnitTest.cpp
r7326b2 re138de 15 15 #include "ActOnAllUnitTest.hpp" 16 16 #include "memoryallocator.hpp" 17 #include "vector.hpp" 17 18 18 19 /********************************************** Test classes **************************************/ -
src/unittests/AnalysisCorrelationToPointUnitTest.cpp
r7326b2 re138de 82 82 83 83 // init maps 84 pointmap = CorrelationToPoint( ( ofstream *)&cout, (MoleculeListClass * const)TestList, (const element * const)hydrogen, (const Vector *)point );84 pointmap = CorrelationToPoint( (MoleculeListClass * const)TestList, (const element * const)hydrogen, (const Vector *)point ); 85 85 binmap = NULL; 86 86 … … 115 115 BinPairMap::iterator tester; 116 116 // put pair correlation into bins and check with no range 117 binmap = BinData( (ofstream *)&cout,pointmap, 0.5, 0., 0. );117 binmap = BinData( pointmap, 0.5, 0., 0. ); 118 118 CPPUNIT_ASSERT_EQUAL( (size_t)2, binmap->size() ); 119 //OutputCorrelation ( (ofstream *)&cout,binmap );119 //OutputCorrelation ( binmap ); 120 120 tester = binmap->begin(); 121 121 CPPUNIT_ASSERT_EQUAL( 1., tester->first ); … … 128 128 BinPairMap::iterator tester; 129 129 // ... and check with [0., 2.] range 130 binmap = BinData( (ofstream *)&cout,pointmap, 0.5, 0., 2. );130 binmap = BinData( pointmap, 0.5, 0., 2. ); 131 131 CPPUNIT_ASSERT_EQUAL( (size_t)5, binmap->size() ); 132 //OutputCorrelation ( (ofstream *)&cout,binmap );132 //OutputCorrelation ( binmap ); 133 133 tester = binmap->begin(); 134 134 CPPUNIT_ASSERT_EQUAL( 0., tester->first ); -
src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
r7326b2 re138de 85 85 // init tesselation and linked cell 86 86 Surface = new Tesselation; 87 FindNonConvexBorder( (ofstream *)&cerr,TestMolecule, Surface, (const LinkedCell *&)LC, 2.5, NULL);87 FindNonConvexBorder(TestMolecule, Surface, (const LinkedCell *&)LC, 2.5, NULL); 88 88 LC = new LinkedCell(TestMolecule, 5.); 89 89 CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->PointsOnBoundary.size() ); … … 137 137 { 138 138 // do the pair correlation 139 surfacemap = CorrelationToSurface( (ofstream *)&cout,TestList, hydrogen, Surface, LC );139 surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC ); 140 140 CPPUNIT_ASSERT( surfacemap != NULL ); 141 141 CPPUNIT_ASSERT_EQUAL( (size_t)4, surfacemap->size() ); … … 145 145 { 146 146 BinPairMap::iterator tester; 147 surfacemap = CorrelationToSurface( (ofstream *)&cout,TestList, hydrogen, Surface, LC );147 surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC ); 148 148 // put pair correlation into bins and check with no range 149 binmap = BinData( (ofstream *)&cout,surfacemap, 0.5, 0., 0. );149 binmap = BinData( surfacemap, 0.5, 0., 0. ); 150 150 CPPUNIT_ASSERT_EQUAL( (size_t)1, binmap->size() ); 151 //OutputCorrelation ( (ofstream *)&cout,binmap );151 //OutputCorrelation ( binmap ); 152 152 tester = binmap->begin(); 153 153 CPPUNIT_ASSERT_EQUAL( 0., tester->first ); … … 159 159 { 160 160 BinPairMap::iterator tester; 161 surfacemap = CorrelationToSurface( (ofstream *)&cout,TestList, hydrogen, Surface, LC );161 surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC ); 162 162 // ... and check with [0., 2.] range 163 binmap = BinData( (ofstream *)&cout,surfacemap, 0.5, 0., 2. );163 binmap = BinData( surfacemap, 0.5, 0., 2. ); 164 164 CPPUNIT_ASSERT_EQUAL( (size_t)5, binmap->size() ); 165 //OutputCorrelation ( (ofstream *)&cout,binmap );165 //OutputCorrelation ( binmap ); 166 166 tester = binmap->begin(); 167 167 CPPUNIT_ASSERT_EQUAL( 0., tester->first ); … … 176 176 { 177 177 BinPairMap::iterator tester; 178 surfacemap = CorrelationToSurface( (ofstream *)&cout,TestList, carbon, Surface, LC );178 surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC ); 179 179 // put pair correlation into bins and check with no range 180 binmap = BinData( (ofstream *)&cout,surfacemap, 0.5, 0., 0. );180 binmap = BinData( surfacemap, 0.5, 0., 0. ); 181 181 CPPUNIT_ASSERT_EQUAL( (size_t)2, binmap->size() ); 182 182 OutputCorrelation ( (ofstream *)&cout, binmap ); … … 194 194 { 195 195 BinPairMap::iterator tester; 196 surfacemap = CorrelationToSurface( (ofstream *)&cout,TestList, carbon, Surface, LC );196 surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC ); 197 197 // ... and check with [0., 2.] range 198 binmap = BinData( (ofstream *)&cout,surfacemap, 0.5, -2., 4. );198 binmap = BinData( surfacemap, 0.5, -2., 4. ); 199 199 CPPUNIT_ASSERT_EQUAL( (size_t)13, binmap->size() ); 200 200 OutputCorrelation ( (ofstream *)&cout, binmap ); -
src/unittests/AnalysisPairCorrelationUnitTest.cpp
r7326b2 re138de 78 78 79 79 // init maps 80 correlationmap = PairCorrelation( (ofstream *)&cout,TestList, hydrogen, hydrogen );80 correlationmap = PairCorrelation( TestList, hydrogen, hydrogen ); 81 81 binmap = NULL; 82 82 … … 109 109 BinPairMap::iterator tester; 110 110 // put pair correlation into bins and check with no range 111 binmap = BinData( (ofstream *)&cout,correlationmap, 0.5, 0., 0. );111 binmap = BinData( correlationmap, 0.5, 0., 0. ); 112 112 CPPUNIT_ASSERT_EQUAL( (size_t)1, binmap->size() ); 113 //OutputCorrelation ( (ofstream *)&cout,binmap );113 //OutputCorrelation ( binmap ); 114 114 tester = binmap->begin(); 115 115 CPPUNIT_ASSERT_EQUAL( sqrt(2.), tester->first ); … … 121 121 BinPairMap::iterator tester; 122 122 // ... and check with [0., 2.] range 123 binmap = BinData( (ofstream *)&cout,correlationmap, 0.5, 0., 2. );123 binmap = BinData( correlationmap, 0.5, 0., 2. ); 124 124 CPPUNIT_ASSERT_EQUAL( (size_t)5, binmap->size() ); 125 //OutputCorrelation ( (ofstream *)&cout,binmap );125 //OutputCorrelation ( binmap ); 126 126 tester = binmap->begin(); 127 127 CPPUNIT_ASSERT_EQUAL( 0., tester->first ); -
src/unittests/Makefile.am
r7326b2 re138de 8 8 noinst_PROGRAMS = $(TESTS) 9 9 10 ActOnAllUnitTest_SOURCES = ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp memoryallocator.hpp 10 ActOnAllUnitTest_SOURCES = ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp 11 ActOnAllUnitTest_LDADD = ../libmolecuilder.a 11 12 12 13 AnalysisCorrelationToPointUnitTest_SOURCES = analysis_correlation.hpp AnalysisCorrelationToPointUnitTest.cpp AnalysisCorrelationToPointUnitTest.hpp … … 28 29 LogUnitTest_LDADD = ../libmolecuilder.a 29 30 30 MemoryAllocatorUnitTest_SOURCES = defs.hpp ../helpers.cpp ../helpers.hpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp memoryallocator.hpp ../memoryusageobserver.cpp memoryusageobserver.hpp ../verbose.cpp verbose.hpp 31 MemoryAllocatorUnitTest_SOURCES = memoryallocatorunittest.cpp memoryallocatorunittest.hpp 32 MemoryAllocatorUnitTest_LDADD = ../libmolecuilder.a 31 33 32 MemoryUsageObserverUnitTest_SOURCES = defs.hpp helpers.hpp memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp memoryusageobserver.hpp verbose.hpp 34 MemoryUsageObserverUnitTest_SOURCES = memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp 35 MemoryUsageObserverUnitTest_LDADD = ../libmolecuilder.a 33 36 34 StackClassUnitTest_SOURCES = memoryallocator.hpp stackclass.hpp stackclassunittest.cpp stackclassunittest.hpp 37 StackClassUnitTest_SOURCES = stackclassunittest.cpp stackclassunittest.hpp 38 StackClassUnitTest_LDADD = ../libmolecuilder.a 35 39 36 VectorUnitTest_SOURCES = defs.hpp ../helpers.cpp helpers.hpp ../leastsquaremin.cpp leastsquaremin.hpp memoryallocator.hpp memoryusageobserver.hpp ../memoryusageobserver.cpp vectorunittest.cpp vectorunittest.hpp vector.hpp ../vector.cpp verbose.hpp ../verbose.cpp 40 VectorUnitTest_SOURCES = vectorunittest.cpp vectorunittest.hpp 41 VectorUnitTest_LDADD = ../libmolecuilder.a 37 42 38 43 -
src/unittests/bondgraphunittest.cpp
r7326b2 re138de 104 104 void BondGraphTest::LoadTableTest() 105 105 { 106 CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable( (ofstream *)&cout,*filename) );106 CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) ); 107 107 CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) ); 108 108 CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) ); … … 117 117 atom *Runner = TestMolecule->end->previous; 118 118 CPPUNIT_ASSERT( TestMolecule->end != Walker ); 119 CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable( (ofstream *)&cout,*filename) );120 CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph( (ofstream *)&cout,TestMolecule) );119 CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) ); 120 CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) ); 121 121 CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) ); 122 122 }; -
src/unittests/logunittest.cpp
r7326b2 re138de 11 11 12 12 #include "logunittest.hpp" 13 #include "logger.hpp"14 #include "errorLogger.hpp"15 13 #include "log.hpp" 16 14 #include "defs.hpp" … … 37 35 { 38 36 logger::getInstance()->setVerbosity(2); 39 cout<< "Verbosity level is set to 2." << endl;40 log() << Verbose(0) << "Test level 0" << endl;41 log() << Verbose(1) << "Test level 1" << endl;42 log() << Verbose(2) << "Test level 2" << endl;43 log() << Verbose(3) << "Test level 3" << endl;44 log() << Verbose(4) << "Test level 4" << endl;37 Log() << Verbose(0) << "Verbosity level is set to 2." << endl; 38 Log() << Verbose(0) << "Test level 0" << endl; 39 Log() << Verbose(1) << "Test level 1" << endl; 40 Log() << Verbose(2) << "Test level 2" << endl; 41 Log() << Verbose(3) << "Test level 3" << endl; 42 Log() << Verbose(4) << "Test level 4" << endl; 45 43 46 log() << Verbose(0) << "Output a log message." << endl;47 e log() << Verbose(0) << "Output an error message." << endl;44 Log() << Verbose(0) << "Output a log message." << endl; 45 eLog() << Verbose(0) << "Output an error message." << endl; 48 46 setVerbosity(3); 49 log() << Verbose(4) << "This should not be printed." << endl;50 e log() << Verbose(4) << "This should not be printed." << endl;47 Log() << Verbose(4) << "This should not be printed." << endl; 48 eLog() << Verbose(4) << "This should not be printed." << endl; 51 49 }; 52 50 -
src/unittests/memoryallocatorunittest.cpp
r7326b2 re138de 46 46 char* buffer3 = NULL; 47 47 buffer3 = Malloc<char>(4, ""); 48 cout<< buffer3 << endl;48 Log() << Verbose(0) << buffer3 << endl; 49 49 Free(&buffer3); 50 50 -
src/unittests/stackclassunittest.cpp
r7326b2 re138de 13 13 14 14 #include "stackclassunittest.hpp" 15 #include "log.hpp" 15 16 16 17 enum { testdimension=3 }; … … 41 42 { 42 43 int testfield[testdimension] = {0,1,2}; 43 // cout<< Verbose(1) << "Testing the snake stack..." << endl;44 //Log() << Verbose(1) << "Testing the snake stack..." << endl; 44 45 for (int i=0;i<testdimension;i++) { 45 // cout<< Verbose(2) << "Filling " << i << "th element of stack." << endl;46 //Log() << Verbose(2) << "Filling " << i << "th element of stack." << endl; 46 47 Stack->Push(&testfield[i]); 47 48 } 48 // cout<< endl;49 //Log() << Verbose(0) << endl; 49 50 //Output(out); 50 51 CPPUNIT_ASSERT_EQUAL(true, Stack->IsFull()); -
src/unittests/tesselationunittest.cpp
r7326b2 re138de 62 62 TesselStruct->LinesOnBoundary.clear(); 63 63 TesselStruct->TrianglesOnBoundary.clear(); 64 TesselStruct->FindStartingTriangle( (ofstream *)&cout,SPHERERADIUS, LinkedList);64 TesselStruct->FindStartingTriangle(SPHERERADIUS, LinkedList); 65 65 bool flag = false; 66 66 … … 68 68 while (baseline != TesselStruct->LinesOnBoundary.end()) { 69 69 if (baseline->second->triangles.size() == 1) { 70 flag = TesselStruct->FindNextSuitableTriangle( (ofstream *)&cout,*(baseline->second), *(((baseline->second->triangles.begin()))->second), SPHERERADIUS, LinkedList); //the line is there, so there is a triangle, but only one.70 flag = TesselStruct->FindNextSuitableTriangle(*(baseline->second), *(((baseline->second->triangles.begin()))->second), SPHERERADIUS, LinkedList); //the line is there, so there is a triangle, but only one. 71 71 } 72 72 baseline++; … … 96 96 { 97 97 // true inside points 98 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(0.,0.,0.), LinkedList) );99 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(0.5,0.,0.), LinkedList) );100 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(0.,0.5,0.), LinkedList) );101 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(0.,0.,0.5), LinkedList) );98 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.,0.,0.), LinkedList) ); 99 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.5,0.,0.), LinkedList) ); 100 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.,0.5,0.), LinkedList) ); 101 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.,0.,0.5), LinkedList) ); 102 102 103 103 // corners 104 104 for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) 105 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(( ofstream *)&cout, (*Runner), LinkedList) );105 CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint((*Runner), LinkedList) ); 106 106 107 107 // true outside points 108 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(0.,5.,0.), LinkedList) );109 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(0.,0.,5.), LinkedList) );110 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(1.,1.,1.), LinkedList) );108 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(0.,5.,0.), LinkedList) ); 109 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(0.,0.,5.), LinkedList) ); 110 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(1.,1.,1.), LinkedList) ); 111 111 112 112 // tricky point, there are three equally close triangles 113 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint( (ofstream *)&cout,Vector(5.,0.,0.), LinkedList) );113 CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(5.,0.,0.), LinkedList) ); 114 114 115 115 }; … … 173 173 for (PointMap::iterator Runner = TesselStruct->PointsOnBoundary.begin(); Runner != TesselStruct->PointsOnBoundary.end(); Runner++) { 174 174 Walker = Runner->second; 175 set<BoundaryTriangleSet*> *triangles = TesselStruct->GetAllTriangles( (ofstream *)&cout,Walker);175 set<BoundaryTriangleSet*> *triangles = TesselStruct->GetAllTriangles(Walker); 176 176 CPPUNIT_ASSERT_EQUAL( (size_t)3, triangles->size() ); 177 177 // check that the returned triangle all contain the Walker -
src/unittests/vectorunittest.cpp
r7326b2 re138de 186 186 { 187 187 // plane at (0,0,0) normal to (1,0,0) cuts line from (0,0,0) to (2,1,0) at ??? 188 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionWithPlane( (ofstream *)&cout,&unit, &zero, &zero, &two) );188 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionWithPlane(&unit, &zero, &zero, &two) ); 189 189 CPPUNIT_ASSERT_EQUAL( zero, fixture ); 190 190 191 191 // plane at (2,1,0) normal to (0,1,0) cuts line from (1,0,0) to (0,1,1) at ??? 192 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionWithPlane( (ofstream *)&cout,&otherunit, &two, &unit, ¬unit) );192 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionWithPlane(&otherunit, &two, &unit, ¬unit) ); 193 193 CPPUNIT_ASSERT_EQUAL( Vector(0., 1., 1.), fixture ); 194 194 195 195 // four vectors equal to zero 196 CPPUNIT_ASSERT_EQUAL( false, fixture.GetIntersectionOfTwoLinesOnPlane( (ofstream *)&cout,&zero, &zero, &zero, &zero, NULL) );196 CPPUNIT_ASSERT_EQUAL( false, fixture.GetIntersectionOfTwoLinesOnPlane(&zero, &zero, &zero, &zero, NULL) ); 197 197 CPPUNIT_ASSERT_EQUAL( zero, fixture ); 198 198 199 199 // four vectors equal to unit 200 CPPUNIT_ASSERT_EQUAL( false, fixture.GetIntersectionOfTwoLinesOnPlane( (ofstream *)&cout,&unit, &unit, &unit, &unit, NULL) );200 CPPUNIT_ASSERT_EQUAL( false, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &unit, &unit, &unit, NULL) ); 201 201 CPPUNIT_ASSERT_EQUAL( zero, fixture ); 202 202 203 203 // two equal lines 204 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane( (ofstream *)&cout,&unit, &two, &unit, &two, NULL) );204 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &two, &unit, &two, NULL) ); 205 205 CPPUNIT_ASSERT_EQUAL( unit, fixture ); 206 206 207 207 // line from (1,0,0) to (2,1,0) cuts line from (1,0,0) to (0,1,0) at ??? 208 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane( (ofstream *)&cout,&unit, &two, &unit, &otherunit, NULL) );208 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &two, &unit, &otherunit, NULL) ); 209 209 CPPUNIT_ASSERT_EQUAL( unit, fixture ); 210 210 211 211 // line from (1,0,0) to (0,0,0) cuts line from (0,0,0) to (2,1,0) at ??? 212 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane( (ofstream *)&cout,&unit, &zero, &zero, &two, NULL) );212 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &zero, &zero, &two, NULL) ); 213 213 CPPUNIT_ASSERT_EQUAL( zero, fixture ); 214 214 215 215 // line from (1,0,0) to (2,1,0) cuts line from (0,0,0) to (0,1,0) at ??? 216 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane( (ofstream *)&cout,&unit, &two, &zero, &otherunit, NULL) );216 CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &two, &zero, &otherunit, NULL) ); 217 217 CPPUNIT_ASSERT_EQUAL( Vector(0., -1., 0.), fixture ); 218 218 };
Note:
See TracChangeset
for help on using the changeset viewer.