- File:
-
- 1 edited
-
src/unittests/AnalysisPairCorrelationUnitTest.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisPairCorrelationUnitTest.cpp
re6fdbe rcbc5fb 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 **************************************/ … … 55 51 56 52 // construct periodentafel 57 tafel = new periodentafel;53 tafel = World::get()->getPeriode(); 58 54 tafel->AddElement(hydrogen); 59 55 60 56 // construct molecule (tetraeder of hydrogens) 61 TestMolecule = new molecule(tafel);62 Walker = new atom();57 TestMolecule = World::get()->createMolecule(); 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. ); … … 80 76 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 ); 81 77 82 TestList = new MoleculeListClass;78 TestList = World::get()->getMolecules(); 83 79 TestMolecule->ActiveFlag = true; 84 80 TestList->insert(TestMolecule); … … 98 94 delete(binmap); 99 95 100 // remove101 delete(TestList);102 96 // note that all the atoms are cleaned by TestMolecule 103 delete(tafel);104 // note that element is cleaned by periodentafel105 97 World::destroy(); 106 MemoryUsageObserver::purgeInstance();107 logger::purgeInstance();108 errorLogger::purgeInstance();109 98 }; 110 99 … … 141 130 CPPUNIT_ASSERT_EQUAL( 6, tester->second ); 142 131 }; 132 133 /********************************************** Main routine **************************************/ 134 135 int main(int argc, char **argv) 136 { 137 // Get the top level suite from the registry 138 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); 139 140 // Adds the test to the list of test to run 141 CppUnit::TextUi::TestRunner runner; 142 runner.addTest( suite ); 143 144 // Change the default outputter to a compiler error format outputter 145 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.
