Changeset 34c43a for src/unittests


Ignore:
Timestamp:
Mar 1, 2011, 10:16:38 AM (14 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:
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)
Message:

Bigger change: Replaced PointCloud by PointCloudAdaptor.

Location:
src/unittests
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    rba5215 r34c43a  
    2727
    2828#include "analysis_correlation.hpp"
    29 #include "Descriptors/MoleculeDescriptor.hpp"
    30 
    3129#include "atom.hpp"
    3230#include "boundary.hpp"
     31#include "CodePatterns/Assert.hpp"
     32#include "Descriptors/MoleculeDescriptor.hpp"
    3333#include "element.hpp"
    3434#include "molecule.hpp"
    3535#include "linkedcell.hpp"
    3636#include "periodentafel.hpp"
     37#include "PointCloudAdaptor.hpp"
    3738#include "tesselation.hpp"
    3839#include "World.hpp"
    39 #include "CodePatterns/Assert.hpp"
    4040
    4141#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
     
    100100  // init tesselation and linked cell
    101101  Surface = new Tesselation;
    102   LC = new LinkedCell(*TestSurfaceMolecule, 5.);
     102  PointCloudAdaptor<molecule> cloud(TestSurfaceMolecule);
     103  LC = new LinkedCell(cloud, 5.);
    103104  FindNonConvexBorder(TestSurfaceMolecule, Surface, (const LinkedCell *&)LC, 2.5, NULL);
    104105
  • src/unittests/LinkedCellUnitTest.cpp

    rba5215 r34c43a  
    2929
    3030#include "atom.hpp"
     31#include "Descriptors/MoleculeDescriptor.hpp"
    3132#include "element.hpp"
    3233#include "linkedcell.hpp"
    3334#include "molecule.hpp"
    3435#include "periodentafel.hpp"
     36#include "PointCloudAdaptor.hpp"
    3537#include "World.hpp"
    3638
     
    6971
    7072  // construct linked cell
    71   LC = new LinkedCell (*TestMolecule, 1.);
     73  PointCloudAdaptor<molecule> cloud(TestMolecule);
     74  LC = new LinkedCell (cloud, 1.);
    7275  CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell");
    7376
     
    121124  // within bounds
    122125  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() );
    126129  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() );
    128131
    129132  // out of bounds
    130133  LC->n[0] = LC->n[1] = LC->n[2] = 3;
    131134  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() );
    133136  LC->n[0] = LC->n[1] = LC->n[2] = -1;
    134137  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() );
    136139};
    137140
     
    145148  offset[0] = offset[1] = offset[2] = 0;
    146149  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) );
    148151  offset[0] = offset[1] = offset[2] = -1;
    149152  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) );
    151154  offset[0] = offset[1] = offset[2] = -2;
    152155  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) );
    154157
    155158  // offset to (0,0,0) - 1.*(x/y/z) out of bounds
     
    158161  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    159162  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) );
    161164  offset[0] = offset[1] = offset[2] = 0;
    162165  offset[1] = -1;
    163166  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    164167  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) );
    166169  offset[0] = offset[1] = offset[2] = 0;
    167170  offset[2] = -1;
    168171  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    169172  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) );
    171174
    172175  // out of bounds
     
    174177  LC->n[0] = LC->n[1] = LC->n[2] = 1;
    175178  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) );
    177180  offset[0] = offset[1] = offset[2] = 192345;
    178181  LC->n[0] = LC->n[1] = LC->n[2] = 1;
    179182  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) );
    181184
    182185  // index is out of bounds, offset points within
    183186  offset[0] = offset[1] = offset[2] = -2;
    184187  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) );
    186189
    187190  // index is within bounds, offset points out
     
    189192  LC->n[0] = LC->n[1] = LC->n[2] = 2;
    190193  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) );
    192195};
    193196
     
    276279{
    277280  Vector tester;
    278   LinkedCell::LinkedNodes *ListOfPoints = NULL;
     281  TesselPointSTLList *ListOfPoints = NULL;
    279282  size_t size = 0;
    280283
     
    337340{
    338341  Vector tester;
    339   LinkedCell::LinkedNodes *ListOfPoints = NULL;
     342  TesselPointSTLList *ListOfPoints = NULL;
    340343  size_t size = 0;
    341344
  • src/unittests/TesselationUnitTest.cpp

    rba5215 r34c43a  
    2626#include <cstring>
    2727
    28 #include "Helpers/defs.hpp"
    29 #include "TesselPoint.hpp"
    3028#include "BoundaryLineSet.hpp"
    3129#include "BoundaryTriangleSet.hpp"
    3230#include "CandidateForTesselation.hpp"
     31#include "Helpers/defs.hpp"
     32#include "PointCloudAdaptor.hpp"
     33#include "TesselPoint.hpp"
    3334
    3435#include "TesselationUnitTest.hpp"
     
    7273
    7374  // create linkedcell
    74   LinkedList = new LinkedCell(Corners, 2.*SPHERERADIUS);
     75  PointCloudAdaptor<TesselPointSTLList> cloud(&Corners);
     76  LinkedList = new LinkedCell(cloud, 2.*SPHERERADIUS);
    7577
    7678  // create tesselation
     
    116118  delete(LinkedList);
    117119  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++)
    119121    delete(*Runner);
    120122  Corners.clear();
  • src/unittests/TesselationUnitTest.hpp

    rba5215 r34c43a  
    4242
    4343      class Tesselation *TesselStruct;
    44       LinkedCell::LinkedNodes Corners;
     44      TesselPointSTLList Corners;
    4545      class LinkedCell *LinkedList;
    4646};
  • src/unittests/Tesselation_BoundaryTriangleUnitTest.hpp

    rba5215 r34c43a  
    4646      class BoundaryPointSet *points[3];
    4747      class TesselPoint *tesselpoints[3];
    48       LinkedCell::LinkedNodes Corners;
     48      TesselPointSTLList Corners;
    4949};
    5050
  • src/unittests/Tesselation_InsideOutsideUnitTest.cpp

    rba5215 r34c43a  
    2727#include <iostream>
    2828
    29 #include "Helpers/defs.hpp"
    30 #include "TesselPoint.hpp"
    3129#include "BoundaryLineSet.hpp"
    3230#include "BoundaryTriangleSet.hpp"
    3331#include "CandidateForTesselation.hpp"
    3432#include "CodePatterns/Verbose.hpp"
     33#include "Helpers/defs.hpp"
     34#include "PointCloudAdaptor.hpp"
     35#include "TesselPoint.hpp"
    3536
    3637#include "Tesselation_InsideOutsideUnitTest.hpp"
     
    9596
    9697  // create linkedcell
    97   LinkedList = new LinkedCell(Corners, 2.*SPHERERADIUS);
     98  PointCloudAdaptor< TesselPointSTLList > cloud(&Corners);
     99  LinkedList = new LinkedCell(cloud, 2.*SPHERERADIUS);
    98100
    99101  // create tesselation
     
    146148  delete(LinkedList);
    147149  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++)
    149151    delete(*Runner);
    150152  Corners.clear();
  • src/unittests/Tesselation_InsideOutsideUnitTest.hpp

    rba5215 r34c43a  
    3939
    4040      class Tesselation *TesselStruct;
    41       LinkedCell::LinkedNodes Corners;
     41      TesselPointSTLList Corners;
    4242      class LinkedCell *LinkedList;
    4343};
Note: See TracChangeset for help on using the changeset viewer.