Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    re6fdbe r5be0eb  
    1717#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
    1818
     19#include "World.hpp"
    1920#include "atom.hpp"
    2021#include "boundary.hpp"
     
    2627#include "World.hpp"
    2728
     29#include "Helpers/Assert.hpp"
     30
    2831#ifdef HAVE_TESTRUNNER
    2932#include "UnitTestMain.hpp"
     
    3740void AnalysisCorrelationToSurfaceUnitTest::setUp()
    3841{
     42  ASSERT_DO(Assert::Throw);
     43
    3944  atom *Walker = NULL;
    4045
     
    6065
    6166  // construct periodentafel
    62   tafel = new periodentafel;
     67  tafel = World::getInstance().getPeriode();
    6368  tafel->AddElement(hydrogen);
    6469  tafel->AddElement(carbon);
    6570
    6671  // construct molecule (tetraeder of hydrogens) base
    67   TestMolecule = new molecule(tafel);
    68   Walker = new atom();
     72  TestMolecule = World::getInstance().createMolecule();
     73  Walker = World::getInstance().createAtom();
    6974  Walker->type = hydrogen;
    7075  Walker->node->Init(1., 0., 1. );
    7176  TestMolecule->AddAtom(Walker);
    72   Walker = new atom();
     77  Walker = World::getInstance().createAtom();
    7378  Walker->type = hydrogen;
    7479  Walker->node->Init(0., 1., 1. );
    7580  TestMolecule->AddAtom(Walker);
    76   Walker = new atom();
     81  Walker = World::getInstance().createAtom();
    7782  Walker->type = hydrogen;
    7883  Walker->node->Init(1., 1., 0. );
    7984  TestMolecule->AddAtom(Walker);
    80   Walker = new atom();
     85  Walker = World::getInstance().createAtom();
    8186  Walker->type = hydrogen;
    8287  Walker->node->Init(0., 0., 0. );
     
    8691  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
    8792
    88   TestList = new MoleculeListClass;
     93  TestList = World::getInstance().getMolecules();
    8994  TestMolecule->ActiveFlag = true;
    9095  TestList->insert(TestMolecule);
     
    99104
    100105  // add outer atoms
    101   Walker = new atom();
     106  Walker = World::getInstance().createAtom();
    102107  Walker->type = carbon;
    103108  Walker->node->Init(4., 0., 4. );
    104109  TestMolecule->AddAtom(Walker);
    105   Walker = new atom();
     110  Walker = World::getInstance().createAtom();
    106111  Walker->type = carbon;
    107112  Walker->node->Init(0., 4., 4. );
    108113  TestMolecule->AddAtom(Walker);
    109   Walker = new atom();
     114  Walker = World::getInstance().createAtom();
    110115  Walker->type = carbon;
    111116  Walker->node->Init(4., 4., 0. );
    112117  TestMolecule->AddAtom(Walker);
    113118  // add inner atoms
    114   Walker = new atom();
     119  Walker = World::getInstance().createAtom();
    115120  Walker->type = carbon;
    116121  Walker->node->Init(0.5, 0.5, 0.5 );
     
    131136    delete(binmap);
    132137
    133   // remove
    134   delete(TestList);
    135138  delete(Surface);
    136139  // note that all the atoms are cleaned by TestMolecule
    137140  delete(LC);
    138   delete(tafel);
    139   // note that element is cleaned by periodentafel
    140   World::destroy();
     141  World::purgeInstance();
    141142  MemoryUsageObserver::purgeInstance();
    142143  logger::purgeInstance();
Note: See TracChangeset for help on using the changeset viewer.