- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisCorrelationToPointUnitTest.cpp
rcbc5fb re6fdbe 17 17 #include "AnalysisCorrelationToPointUnitTest.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 **************************************/ … … 52 56 53 57 // construct periodentafel 54 tafel = World::get()->getPeriode();58 tafel = new periodentafel; 55 59 tafel->AddElement(hydrogen); 56 60 57 61 // construct molecule (tetraeder of hydrogens) 58 TestMolecule = World::get()->createMolecule();59 Walker = World::get()->createAtom();62 TestMolecule = new molecule(tafel); 63 Walker = new atom(); 60 64 Walker->type = hydrogen; 61 65 Walker->node->Init(1., 0., 1. ); 62 66 TestMolecule->AddAtom(Walker); 63 Walker = World::get()->createAtom();67 Walker = new atom(); 64 68 Walker->type = hydrogen; 65 69 Walker->node->Init(0., 1., 1. ); 66 70 TestMolecule->AddAtom(Walker); 67 Walker = World::get()->createAtom();71 Walker = new atom(); 68 72 Walker->type = hydrogen; 69 73 Walker->node->Init(1., 1., 0. ); 70 74 TestMolecule->AddAtom(Walker); 71 Walker = World::get()->createAtom();75 Walker = new atom(); 72 76 Walker->type = hydrogen; 73 77 Walker->node->Init(0., 0., 0. ); … … 77 81 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 ); 78 82 79 TestList = World::get()->getMolecules();83 TestList = new MoleculeListClass; 80 84 TestMolecule->ActiveFlag = true; 81 85 TestList->insert(TestMolecule); … … 98 102 delete(binmap); 99 103 104 // remove 105 delete(TestList); 106 // note that all the atoms are cleaned by TestMolecule 100 107 delete(point); 108 delete(tafel); 109 // note that element is cleaned by periodentafel 101 110 World::destroy(); 111 MemoryUsageObserver::purgeInstance(); 112 logger::purgeInstance(); 102 113 }; 103 114 … … 137 148 138 149 }; 139 140 /********************************************** Main routine **************************************/141 142 int main(int argc, char **argv)143 {144 // Get the top level suite from the registry145 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();146 147 // Adds the test to the list of test to run148 CppUnit::TextUi::TestRunner runner;149 runner.addTest( suite );150 151 // Change the default outputter to a compiler error format outputter152 runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),153 std::cerr ) );154 // Run the tests.155 bool wasSucessful = runner.run();156 157 // Return error code 1 if the one of test failed.158 return wasSucessful ? 0 : 1;159 };
Note:
See TracChangeset
for help on using the changeset viewer.
