Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    re6fdbe r46d958  
    1717#include "AnalysisCorrelationToPointUnitTest.hpp"
    1818
     19#include "World.hpp"
    1920#include "atom.hpp"
    2021#include "boundary.hpp"
     
    2425#include "periodentafel.hpp"
    2526#include "tesselation.hpp"
    26 #include "World.hpp"
    27 
    28 #ifdef HAVE_TESTRUNNER
    29 #include "UnitTestMain.hpp"
    30 #endif /*HAVE_TESTRUNNER*/
    3127
    3228/********************************************** Test classes **************************************/
     
    6157  // construct molecule (tetraeder of hydrogens)
    6258  TestMolecule = new molecule(tafel);
    63   Walker = new atom();
     59  Walker = World::get()->createAtom();
    6460  Walker->type = hydrogen;
    6561  Walker->node->Init(1., 0., 1. );
    6662  TestMolecule->AddAtom(Walker);
    67   Walker = new atom();
     63  Walker = World::get()->createAtom();
    6864  Walker->type = hydrogen;
    6965  Walker->node->Init(0., 1., 1. );
    7066  TestMolecule->AddAtom(Walker);
    71   Walker = new atom();
     67  Walker = World::get()->createAtom();
    7268  Walker->type = hydrogen;
    7369  Walker->node->Init(1., 1., 0. );
    7470  TestMolecule->AddAtom(Walker);
    75   Walker = new atom();
     71  Walker = World::get()->createAtom();
    7672  Walker->type = hydrogen;
    7773  Walker->node->Init(0., 0., 0. );
     
    108104  delete(tafel);
    109105  // note that element is cleaned by periodentafel
    110   World::destroy();
    111   MemoryUsageObserver::purgeInstance();
    112   logger::purgeInstance();
    113106};
    114107
     
    148141
    149142};
     143
     144/********************************************** Main routine **************************************/
     145
     146int main(int argc, char **argv)
     147{
     148  // Get the top level suite from the registry
     149  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
     150
     151  // Adds the test to the list of test to run
     152  CppUnit::TextUi::TestRunner runner;
     153  runner.addTest( suite );
     154
     155  // Change the default outputter to a compiler error format outputter
     156  runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
     157                                                       std::cerr ) );
     158  // Run the tests.
     159  bool wasSucessful = runner.run();
     160
     161  // Return error code 1 if the one of test failed.
     162  return wasSucessful ? 0 : 1;
     163};
Note: See TracChangeset for help on using the changeset viewer.