- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/unittests/AnalysisPairCorrelationUnitTest.cpp ¶
r46d958 re6fdbe 17 17 #include "AnalysisPairCorrelationUnitTest.hpp" 18 18 19 #include "World.hpp"20 19 #include "atom.hpp" 21 20 #include "boundary.hpp" … … 25 24 #include "periodentafel.hpp" 26 25 #include "tesselation.hpp" 26 #include "World.hpp" 27 28 #ifdef HAVE_TESTRUNNER 29 #include "UnitTestMain.hpp" 30 #endif /*HAVE_TESTRUNNER*/ 27 31 28 32 /********************************************** Test classes **************************************/ … … 56 60 // construct molecule (tetraeder of hydrogens) 57 61 TestMolecule = new molecule(tafel); 58 Walker = World::get()->createAtom();62 Walker = new atom(); 59 63 Walker->type = hydrogen; 60 64 Walker->node->Init(1., 0., 1. ); 61 65 TestMolecule->AddAtom(Walker); 62 Walker = World::get()->createAtom();66 Walker = new atom(); 63 67 Walker->type = hydrogen; 64 68 Walker->node->Init(0., 1., 1. ); 65 69 TestMolecule->AddAtom(Walker); 66 Walker = World::get()->createAtom();70 Walker = new atom(); 67 71 Walker->type = hydrogen; 68 72 Walker->node->Init(1., 1., 0. ); 69 73 TestMolecule->AddAtom(Walker); 70 Walker = World::get()->createAtom();74 Walker = new atom(); 71 75 Walker->type = hydrogen; 72 76 Walker->node->Init(0., 0., 0. ); … … 99 103 delete(tafel); 100 104 // note that element is cleaned by periodentafel 105 World::destroy(); 106 MemoryUsageObserver::purgeInstance(); 107 logger::purgeInstance(); 108 errorLogger::purgeInstance(); 101 109 }; 102 110 … … 133 141 CPPUNIT_ASSERT_EQUAL( 6, tester->second ); 134 142 }; 135 136 /********************************************** Main routine **************************************/137 138 int main(int argc, char **argv)139 {140 // Get the top level suite from the registry141 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();142 143 // Adds the test to the list of test to run144 CppUnit::TextUi::TestRunner runner;145 runner.addTest( suite );146 147 // Change the default outputter to a compiler error format outputter148 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.