- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
r5be0eb re6fdbe 17 17 #include "AnalysisCorrelationToSurfaceUnitTest.hpp" 18 18 19 #include "World.hpp"20 19 #include "atom.hpp" 21 20 #include "boundary.hpp" … … 27 26 #include "World.hpp" 28 27 29 #include "Helpers/Assert.hpp"30 31 28 #ifdef HAVE_TESTRUNNER 32 29 #include "UnitTestMain.hpp" … … 40 37 void AnalysisCorrelationToSurfaceUnitTest::setUp() 41 38 { 42 ASSERT_DO(Assert::Throw);43 44 39 atom *Walker = NULL; 45 40 … … 65 60 66 61 // construct periodentafel 67 tafel = World::getInstance().getPeriode();62 tafel = new periodentafel; 68 63 tafel->AddElement(hydrogen); 69 64 tafel->AddElement(carbon); 70 65 71 66 // construct molecule (tetraeder of hydrogens) base 72 TestMolecule = World::getInstance().createMolecule();73 Walker = World::getInstance().createAtom();67 TestMolecule = new molecule(tafel); 68 Walker = new atom(); 74 69 Walker->type = hydrogen; 75 70 Walker->node->Init(1., 0., 1. ); 76 71 TestMolecule->AddAtom(Walker); 77 Walker = World::getInstance().createAtom();72 Walker = new atom(); 78 73 Walker->type = hydrogen; 79 74 Walker->node->Init(0., 1., 1. ); 80 75 TestMolecule->AddAtom(Walker); 81 Walker = World::getInstance().createAtom();76 Walker = new atom(); 82 77 Walker->type = hydrogen; 83 78 Walker->node->Init(1., 1., 0. ); 84 79 TestMolecule->AddAtom(Walker); 85 Walker = World::getInstance().createAtom();80 Walker = new atom(); 86 81 Walker->type = hydrogen; 87 82 Walker->node->Init(0., 0., 0. ); … … 91 86 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 ); 92 87 93 TestList = World::getInstance().getMolecules();88 TestList = new MoleculeListClass; 94 89 TestMolecule->ActiveFlag = true; 95 90 TestList->insert(TestMolecule); … … 104 99 105 100 // add outer atoms 106 Walker = World::getInstance().createAtom();101 Walker = new atom(); 107 102 Walker->type = carbon; 108 103 Walker->node->Init(4., 0., 4. ); 109 104 TestMolecule->AddAtom(Walker); 110 Walker = World::getInstance().createAtom();105 Walker = new atom(); 111 106 Walker->type = carbon; 112 107 Walker->node->Init(0., 4., 4. ); 113 108 TestMolecule->AddAtom(Walker); 114 Walker = World::getInstance().createAtom();109 Walker = new atom(); 115 110 Walker->type = carbon; 116 111 Walker->node->Init(4., 4., 0. ); 117 112 TestMolecule->AddAtom(Walker); 118 113 // add inner atoms 119 Walker = World::getInstance().createAtom();114 Walker = new atom(); 120 115 Walker->type = carbon; 121 116 Walker->node->Init(0.5, 0.5, 0.5 ); … … 136 131 delete(binmap); 137 132 133 // remove 134 delete(TestList); 138 135 delete(Surface); 139 136 // note that all the atoms are cleaned by TestMolecule 140 137 delete(LC); 141 World::purgeInstance(); 138 delete(tafel); 139 // note that element is cleaned by periodentafel 140 World::destroy(); 142 141 MemoryUsageObserver::purgeInstance(); 143 142 logger::purgeInstance();
Note:
See TracChangeset
for help on using the changeset viewer.