- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisCorrelationToPointUnitTest.cpp
re6fdbe rcbc5fb 17 17 #include "AnalysisCorrelationToPointUnitTest.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 **************************************/ … … 56 52 57 53 // construct periodentafel 58 tafel = new periodentafel;54 tafel = World::get()->getPeriode(); 59 55 tafel->AddElement(hydrogen); 60 56 61 57 // construct molecule (tetraeder of hydrogens) 62 TestMolecule = new molecule(tafel);63 Walker = new atom();58 TestMolecule = World::get()->createMolecule(); 59 Walker = World::get()->createAtom(); 64 60 Walker->type = hydrogen; 65 61 Walker->node->Init(1., 0., 1. ); 66 62 TestMolecule->AddAtom(Walker); 67 Walker = new atom();63 Walker = World::get()->createAtom(); 68 64 Walker->type = hydrogen; 69 65 Walker->node->Init(0., 1., 1. ); 70 66 TestMolecule->AddAtom(Walker); 71 Walker = new atom();67 Walker = World::get()->createAtom(); 72 68 Walker->type = hydrogen; 73 69 Walker->node->Init(1., 1., 0. ); 74 70 TestMolecule->AddAtom(Walker); 75 Walker = new atom();71 Walker = World::get()->createAtom(); 76 72 Walker->type = hydrogen; 77 73 Walker->node->Init(0., 0., 0. ); … … 81 77 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 ); 82 78 83 TestList = new MoleculeListClass;79 TestList = World::get()->getMolecules(); 84 80 TestMolecule->ActiveFlag = true; 85 81 TestList->insert(TestMolecule); … … 102 98 delete(binmap); 103 99 104 // remove105 delete(TestList);106 // note that all the atoms are cleaned by TestMolecule107 100 delete(point); 108 delete(tafel);109 // note that element is cleaned by periodentafel110 101 World::destroy(); 111 MemoryUsageObserver::purgeInstance();112 logger::purgeInstance();113 102 }; 114 103 … … 148 137 149 138 }; 139 140 /********************************************** Main routine **************************************/ 141 142 int main(int argc, char **argv) 143 { 144 // Get the top level suite from the registry 145 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); 146 147 // Adds the test to the list of test to run 148 CppUnit::TextUi::TestRunner runner; 149 runner.addTest( suite ); 150 151 // Change the default outputter to a compiler error format outputter 152 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.
