- File:
-
- 1 edited
-
src/unittests/AnalysisPairCorrelationUnitTest.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisPairCorrelationUnitTest.cpp
re6fdbe r46d958 17 17 #include "AnalysisPairCorrelationUnitTest.hpp" 18 18 19 #include "World.hpp" 19 20 #include "atom.hpp" 20 21 #include "boundary.hpp" … … 24 25 #include "periodentafel.hpp" 25 26 #include "tesselation.hpp" 26 #include "World.hpp"27 28 #ifdef HAVE_TESTRUNNER29 #include "UnitTestMain.hpp"30 #endif /*HAVE_TESTRUNNER*/31 27 32 28 /********************************************** Test classes **************************************/ … … 60 56 // construct molecule (tetraeder of hydrogens) 61 57 TestMolecule = new molecule(tafel); 62 Walker = new atom();58 Walker = World::get()->createAtom(); 63 59 Walker->type = hydrogen; 64 60 Walker->node->Init(1., 0., 1. ); 65 61 TestMolecule->AddAtom(Walker); 66 Walker = new atom();62 Walker = World::get()->createAtom(); 67 63 Walker->type = hydrogen; 68 64 Walker->node->Init(0., 1., 1. ); 69 65 TestMolecule->AddAtom(Walker); 70 Walker = new atom();66 Walker = World::get()->createAtom(); 71 67 Walker->type = hydrogen; 72 68 Walker->node->Init(1., 1., 0. ); 73 69 TestMolecule->AddAtom(Walker); 74 Walker = new atom();70 Walker = World::get()->createAtom(); 75 71 Walker->type = hydrogen; 76 72 Walker->node->Init(0., 0., 0. ); … … 103 99 delete(tafel); 104 100 // note that element is cleaned by periodentafel 105 World::destroy();106 MemoryUsageObserver::purgeInstance();107 logger::purgeInstance();108 errorLogger::purgeInstance();109 101 }; 110 102 … … 141 133 CPPUNIT_ASSERT_EQUAL( 6, tester->second ); 142 134 }; 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.
