Changeset 34c43a for src/unittests
- Timestamp:
- Mar 1, 2011, 10:16:38 AM (14 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:
- caa06ef
- Parents:
- ba5215
- git-author:
- Frederik Heber <heber@…> (02/21/11 18:02:41)
- git-committer:
- Frederik Heber <heber@…> (03/01/11 10:16:38)
- Location:
- src/unittests
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
rba5215 r34c43a 27 27 28 28 #include "analysis_correlation.hpp" 29 #include "Descriptors/MoleculeDescriptor.hpp"30 31 29 #include "atom.hpp" 32 30 #include "boundary.hpp" 31 #include "CodePatterns/Assert.hpp" 32 #include "Descriptors/MoleculeDescriptor.hpp" 33 33 #include "element.hpp" 34 34 #include "molecule.hpp" 35 35 #include "linkedcell.hpp" 36 36 #include "periodentafel.hpp" 37 #include "PointCloudAdaptor.hpp" 37 38 #include "tesselation.hpp" 38 39 #include "World.hpp" 39 #include "CodePatterns/Assert.hpp"40 40 41 41 #include "AnalysisCorrelationToSurfaceUnitTest.hpp" … … 100 100 // init tesselation and linked cell 101 101 Surface = new Tesselation; 102 LC = new LinkedCell(*TestSurfaceMolecule, 5.); 102 PointCloudAdaptor<molecule> cloud(TestSurfaceMolecule); 103 LC = new LinkedCell(cloud, 5.); 103 104 FindNonConvexBorder(TestSurfaceMolecule, Surface, (const LinkedCell *&)LC, 2.5, NULL); 104 105 -
src/unittests/LinkedCellUnitTest.cpp
rba5215 r34c43a 29 29 30 30 #include "atom.hpp" 31 #include "Descriptors/MoleculeDescriptor.hpp" 31 32 #include "element.hpp" 32 33 #include "linkedcell.hpp" 33 34 #include "molecule.hpp" 34 35 #include "periodentafel.hpp" 36 #include "PointCloudAdaptor.hpp" 35 37 #include "World.hpp" 36 38 … … 69 71 70 72 // construct linked cell 71 LC = new LinkedCell (*TestMolecule, 1.); 73 PointCloudAdaptor<molecule> cloud(TestMolecule); 74 LC = new LinkedCell (cloud, 1.); 72 75 CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell"); 73 76 … … 121 124 // within bounds 122 125 LC->n[0] = LC->n[1] = LC->n[2] = 0; 123 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0 * 3*3 + 0 * 3 + 0], LC->GetCurrentCell() );124 LC->n[0] = LC->n[1] = LC->n[2] = 1; 125 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[1 * 3*3 + 1 * 3 + 1], LC->GetCurrentCell() );126 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0 * 3*3 + 0 * 3 + 0], LC->GetCurrentCell() ); 127 LC->n[0] = LC->n[1] = LC->n[2] = 1; 128 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[1 * 3*3 + 1 * 3 + 1], LC->GetCurrentCell() ); 126 129 LC->n[0] = LC->n[1] = LC->n[2] = 2; 127 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetCurrentCell() );130 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetCurrentCell() ); 128 131 129 132 // out of bounds 130 133 LC->n[0] = LC->n[1] = LC->n[2] = 3; 131 134 cout << "The following test is supposed to fail and produce an ERROR." << endl; 132 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetCurrentCell() );135 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetCurrentCell() ); 133 136 LC->n[0] = LC->n[1] = LC->n[2] = -1; 134 137 cout << "The following test is supposed to fail and produce an ERROR." << endl; 135 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetCurrentCell() );138 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetCurrentCell() ); 136 139 }; 137 140 … … 145 148 offset[0] = offset[1] = offset[2] = 0; 146 149 LC->n[0] = LC->n[1] = LC->n[2] = 0; 147 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );150 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) ); 148 151 offset[0] = offset[1] = offset[2] = -1; 149 152 LC->n[0] = LC->n[1] = LC->n[2] = 1; 150 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );153 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) ); 151 154 offset[0] = offset[1] = offset[2] = -2; 152 155 LC->n[0] = LC->n[1] = LC->n[2] = 2; 153 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );156 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) ); 154 157 155 158 // offset to (0,0,0) - 1.*(x/y/z) out of bounds … … 158 161 LC->n[0] = LC->n[1] = LC->n[2] = 0; 159 162 cout << "The following test is supposed to fail and produce an ERROR." << endl; 160 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );163 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) ); 161 164 offset[0] = offset[1] = offset[2] = 0; 162 165 offset[1] = -1; 163 166 LC->n[0] = LC->n[1] = LC->n[2] = 0; 164 167 cout << "The following test is supposed to fail and produce an ERROR." << endl; 165 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );168 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) ); 166 169 offset[0] = offset[1] = offset[2] = 0; 167 170 offset[2] = -1; 168 171 LC->n[0] = LC->n[1] = LC->n[2] = 0; 169 172 cout << "The following test is supposed to fail and produce an ERROR." << endl; 170 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );173 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) ); 171 174 172 175 // out of bounds … … 174 177 LC->n[0] = LC->n[1] = LC->n[2] = 1; 175 178 cout << "The following test is supposed to fail and produce an ERROR." << endl; 176 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );179 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) ); 177 180 offset[0] = offset[1] = offset[2] = 192345; 178 181 LC->n[0] = LC->n[1] = LC->n[2] = 1; 179 182 cout << "The following test is supposed to fail and produce an ERROR." << endl; 180 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );183 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) ); 181 184 182 185 // index is out of bounds, offset points within 183 186 offset[0] = offset[1] = offset[2] = -2; 184 187 LC->n[0] = LC->n[1] = LC->n[2] = 4; 185 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetRelativeToCurrentCell(offset) );188 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetRelativeToCurrentCell(offset) ); 186 189 187 190 // index is within bounds, offset points out … … 189 192 LC->n[0] = LC->n[1] = LC->n[2] = 2; 190 193 cout << "The following test is supposed to fail and produce an ERROR." << endl; 191 CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );194 CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) ); 192 195 }; 193 196 … … 276 279 { 277 280 Vector tester; 278 LinkedCell::LinkedNodes*ListOfPoints = NULL;281 TesselPointSTLList *ListOfPoints = NULL; 279 282 size_t size = 0; 280 283 … … 337 340 { 338 341 Vector tester; 339 LinkedCell::LinkedNodes*ListOfPoints = NULL;342 TesselPointSTLList *ListOfPoints = NULL; 340 343 size_t size = 0; 341 344 -
src/unittests/TesselationUnitTest.cpp
rba5215 r34c43a 26 26 #include <cstring> 27 27 28 #include "Helpers/defs.hpp"29 #include "TesselPoint.hpp"30 28 #include "BoundaryLineSet.hpp" 31 29 #include "BoundaryTriangleSet.hpp" 32 30 #include "CandidateForTesselation.hpp" 31 #include "Helpers/defs.hpp" 32 #include "PointCloudAdaptor.hpp" 33 #include "TesselPoint.hpp" 33 34 34 35 #include "TesselationUnitTest.hpp" … … 72 73 73 74 // create linkedcell 74 LinkedList = new LinkedCell(Corners, 2.*SPHERERADIUS); 75 PointCloudAdaptor<TesselPointSTLList> cloud(&Corners); 76 LinkedList = new LinkedCell(cloud, 2.*SPHERERADIUS); 75 77 76 78 // create tesselation … … 116 118 delete(LinkedList); 117 119 delete(TesselStruct); 118 for ( LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)120 for (TesselPointSTLList::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) 119 121 delete(*Runner); 120 122 Corners.clear(); -
src/unittests/TesselationUnitTest.hpp
rba5215 r34c43a 42 42 43 43 class Tesselation *TesselStruct; 44 LinkedCell::LinkedNodesCorners;44 TesselPointSTLList Corners; 45 45 class LinkedCell *LinkedList; 46 46 }; -
src/unittests/Tesselation_BoundaryTriangleUnitTest.hpp
rba5215 r34c43a 46 46 class BoundaryPointSet *points[3]; 47 47 class TesselPoint *tesselpoints[3]; 48 LinkedCell::LinkedNodesCorners;48 TesselPointSTLList Corners; 49 49 }; 50 50 -
src/unittests/Tesselation_InsideOutsideUnitTest.cpp
rba5215 r34c43a 27 27 #include <iostream> 28 28 29 #include "Helpers/defs.hpp"30 #include "TesselPoint.hpp"31 29 #include "BoundaryLineSet.hpp" 32 30 #include "BoundaryTriangleSet.hpp" 33 31 #include "CandidateForTesselation.hpp" 34 32 #include "CodePatterns/Verbose.hpp" 33 #include "Helpers/defs.hpp" 34 #include "PointCloudAdaptor.hpp" 35 #include "TesselPoint.hpp" 35 36 36 37 #include "Tesselation_InsideOutsideUnitTest.hpp" … … 95 96 96 97 // create linkedcell 97 LinkedList = new LinkedCell(Corners, 2.*SPHERERADIUS); 98 PointCloudAdaptor< TesselPointSTLList > cloud(&Corners); 99 LinkedList = new LinkedCell(cloud, 2.*SPHERERADIUS); 98 100 99 101 // create tesselation … … 146 148 delete(LinkedList); 147 149 delete(TesselStruct); 148 for ( LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)150 for (TesselPointSTLList::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) 149 151 delete(*Runner); 150 152 Corners.clear(); -
src/unittests/Tesselation_InsideOutsideUnitTest.hpp
rba5215 r34c43a 39 39 40 40 class Tesselation *TesselStruct; 41 LinkedCell::LinkedNodesCorners;41 TesselPointSTLList Corners; 42 42 class LinkedCell *LinkedList; 43 43 };
Note:
See TracChangeset
for help on using the changeset viewer.