- File:
-
- 1 edited
-
src/unittests/AnalysisPairCorrelationUnitTest.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisPairCorrelationUnitTest.cpp
rcbc5fb 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 **************************************/ … … 51 55 52 56 // construct periodentafel 53 tafel = World::get()->getPeriode();57 tafel = new periodentafel; 54 58 tafel->AddElement(hydrogen); 55 59 56 60 // construct molecule (tetraeder of hydrogens) 57 TestMolecule = World::get()->createMolecule();58 Walker = World::get()->createAtom();61 TestMolecule = new molecule(tafel); 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. ); … … 76 80 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 ); 77 81 78 TestList = World::get()->getMolecules();82 TestList = new MoleculeListClass; 79 83 TestMolecule->ActiveFlag = true; 80 84 TestList->insert(TestMolecule); … … 94 98 delete(binmap); 95 99 100 // remove 101 delete(TestList); 96 102 // note that all the atoms are cleaned by TestMolecule 103 delete(tafel); 104 // note that element is cleaned by periodentafel 97 105 World::destroy(); 106 MemoryUsageObserver::purgeInstance(); 107 logger::purgeInstance(); 108 errorLogger::purgeInstance(); 98 109 }; 99 110 … … 130 141 CPPUNIT_ASSERT_EQUAL( 6, tester->second ); 131 142 }; 132 133 /********************************************** Main routine **************************************/134 135 int main(int argc, char **argv)136 {137 // Get the top level suite from the registry138 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();139 140 // Adds the test to the list of test to run141 CppUnit::TextUi::TestRunner runner;142 runner.addTest( suite );143 144 // Change the default outputter to a compiler error format outputter145 runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),146 std::cerr ) );147 // Run the tests.148 bool wasSucessful = runner.run();149 150 // Return error code 1 if the one of test failed.151 return wasSucessful ? 0 : 1;152 };
Note:
See TracChangeset
for help on using the changeset viewer.
