Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    re6fdbe r46d958  
    1717#include "AnalysisPairCorrelationUnitTest.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 **************************************/
     
    6056  // construct molecule (tetraeder of hydrogens)
    6157  TestMolecule = new molecule(tafel);
    62   Walker = new atom();
     58  Walker = World::get()->createAtom();
    6359  Walker->type = hydrogen;
    6460  Walker->node->Init(1., 0., 1. );
    6561  TestMolecule->AddAtom(Walker);
    66   Walker = new atom();
     62  Walker = World::get()->createAtom();
    6763  Walker->type = hydrogen;
    6864  Walker->node->Init(0., 1., 1. );
    6965  TestMolecule->AddAtom(Walker);
    70   Walker = new atom();
     66  Walker = World::get()->createAtom();
    7167  Walker->type = hydrogen;
    7268  Walker->node->Init(1., 1., 0. );
    7369  TestMolecule->AddAtom(Walker);
    74   Walker = new atom();
     70  Walker = World::get()->createAtom();
    7571  Walker->type = hydrogen;
    7672  Walker->node->Init(0., 0., 0. );
     
    10399  delete(tafel);
    104100  // note that element is cleaned by periodentafel
    105   World::destroy();
    106   MemoryUsageObserver::purgeInstance();
    107   logger::purgeInstance();
    108   errorLogger::purgeInstance();
    109101};
    110102
     
    141133  CPPUNIT_ASSERT_EQUAL( 6, tester->second );
    142134};
     135
     136/********************************************** Main routine **************************************/
     137
     138int main(int argc, char **argv)
     139{
     140  // Get the top level suite from the registry
     141  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
     142
     143  // Adds the test to the list of test to run
     144  CppUnit::TextUi::TestRunner runner;
     145  runner.addTest( suite );
     146
     147  // Change the default outputter to a compiler error format outputter
     148  runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
     149                                                       std::cerr ) );
     150  // Run the tests.
     151  bool wasSucessful = runner.run();
     152
     153  // Return error code 1 if the one of test failed.
     154  return wasSucessful ? 0 : 1;
     155};
Note: See TracChangeset for help on using the changeset viewer.