Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r46d958 re6fdbe  
    1717#include "AnalysisPairCorrelationUnitTest.hpp"
    1818
    19 #include "World.hpp"
    2019#include "atom.hpp"
    2120#include "boundary.hpp"
     
    2524#include "periodentafel.hpp"
    2625#include "tesselation.hpp"
     26#include "World.hpp"
     27
     28#ifdef HAVE_TESTRUNNER
     29#include "UnitTestMain.hpp"
     30#endif /*HAVE_TESTRUNNER*/
    2731
    2832/********************************************** Test classes **************************************/
     
    5660  // construct molecule (tetraeder of hydrogens)
    5761  TestMolecule = new molecule(tafel);
    58   Walker = World::get()->createAtom();
     62  Walker = new atom();
    5963  Walker->type = hydrogen;
    6064  Walker->node->Init(1., 0., 1. );
    6165  TestMolecule->AddAtom(Walker);
    62   Walker = World::get()->createAtom();
     66  Walker = new atom();
    6367  Walker->type = hydrogen;
    6468  Walker->node->Init(0., 1., 1. );
    6569  TestMolecule->AddAtom(Walker);
    66   Walker = World::get()->createAtom();
     70  Walker = new atom();
    6771  Walker->type = hydrogen;
    6872  Walker->node->Init(1., 1., 0. );
    6973  TestMolecule->AddAtom(Walker);
    70   Walker = World::get()->createAtom();
     74  Walker = new atom();
    7175  Walker->type = hydrogen;
    7276  Walker->node->Init(0., 0., 0. );
     
    99103  delete(tafel);
    100104  // note that element is cleaned by periodentafel
     105  World::destroy();
     106  MemoryUsageObserver::purgeInstance();
     107  logger::purgeInstance();
     108  errorLogger::purgeInstance();
    101109};
    102110
     
    133141  CPPUNIT_ASSERT_EQUAL( 6, tester->second );
    134142};
    135 
    136 /********************************************** Main routine **************************************/
    137 
    138 int 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.