- File:
-
- 1 edited
-
src/unittests/bondgraphunittest.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/bondgraphunittest.cpp
r23b547 re6fdbe 16 16 #include <cstring> 17 17 18 #include "World.hpp"19 18 #include "atom.hpp" 20 19 #include "bond.hpp" … … 57 56 58 57 // construct periodentafel 59 tafel = World::getInstance().getPeriode();58 tafel = new periodentafel; 60 59 tafel->AddElement(hydrogen); 61 60 tafel->AddElement(carbon); 62 61 63 62 // construct molecule (tetraeder of hydrogens) 64 TestMolecule = World::getInstance().createMolecule();65 Walker = World::getInstance().createAtom();63 TestMolecule = new molecule(tafel); 64 Walker = new atom(); 66 65 Walker->type = hydrogen; 67 66 Walker->node->Init(1., 0., 1. ); 68 67 TestMolecule->AddAtom(Walker); 69 Walker = World::getInstance().createAtom();68 Walker = new atom(); 70 69 Walker->type = hydrogen; 71 70 Walker->node->Init(0., 1., 1. ); 72 71 TestMolecule->AddAtom(Walker); 73 Walker = World::getInstance().createAtom();72 Walker = new atom(); 74 73 Walker->type = hydrogen; 75 74 Walker->node->Init(1., 1., 0. ); 76 75 TestMolecule->AddAtom(Walker); 77 Walker = World::getInstance().createAtom();76 Walker = new atom(); 78 77 Walker->type = hydrogen; 79 78 Walker->node->Init(0., 0., 0. ); … … 102 101 103 102 // remove molecule 104 World::getInstance().destroyMolecule(TestMolecule); 105 // note that all the atoms, molecules, the tafel and the elements 106 // are all cleaned when the world is destroyed 107 World::purgeInstance(); 103 delete(TestMolecule); 104 // note that all the atoms are cleaned by TestMolecule 105 delete(tafel); 106 // note that element is cleaned by periodentafel 107 World::destroy(); 108 108 MemoryUsageObserver::purgeInstance(); 109 109 logger::purgeInstance();
Note:
See TracChangeset
for help on using the changeset viewer.
