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