- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/listofbondsunittest.cpp
re6fdbe r23b547 16 16 #include "listofbondsunittest.hpp" 17 17 18 #include "World.hpp" 18 19 #include "atom.hpp" 19 20 #include "bond.hpp" … … 50 51 51 52 // construct periodentafel 52 tafel = new periodentafel;53 tafel = World::getInstance().getPeriode(); 53 54 tafel->AddElement(hydrogen); 54 55 55 56 // construct molecule (tetraeder of hydrogens) 56 TestMolecule = new molecule(tafel);57 Walker = new atom();57 TestMolecule = World::getInstance().createMolecule(); 58 Walker = World::getInstance().createAtom(); 58 59 Walker->type = hydrogen; 59 60 Walker->node->Init(1., 0., 1. ); 60 61 TestMolecule->AddAtom(Walker); 61 Walker = new atom();62 Walker = World::getInstance().createAtom(); 62 63 Walker->type = hydrogen; 63 64 Walker->node->Init(0., 1., 1. ); 64 65 TestMolecule->AddAtom(Walker); 65 Walker = new atom();66 Walker = World::getInstance().createAtom(); 66 67 Walker->type = hydrogen; 67 68 Walker->node->Init(1., 1., 0. ); 68 69 TestMolecule->AddAtom(Walker); 69 Walker = new atom();70 Walker = World::getInstance().createAtom(); 70 71 Walker->type = hydrogen; 71 72 Walker->node->Init(0., 0., 0. ); … … 81 82 { 82 83 // remove 83 delete(TestMolecule); 84 // note that all the atoms are cleaned by TestMolecule 85 delete(tafel); 86 // note that element is cleaned by periodentafel 87 World::destroy(); 84 World::getInstance().destroyMolecule(TestMolecule); 85 // note that all the atoms, molecules, the tafel and the elements 86 // are all cleaned when the world is destroyed 87 World::purgeInstance(); 88 88 MemoryUsageObserver::purgeInstance(); 89 89 logger::purgeInstance(); … … 250 250 251 251 // remove atom2 252 delete(atom2);252 World::getInstance().destroyAtom(atom2); 253 253 254 254 // check bond if removed from other atom
Note:
See TracChangeset
for help on using the changeset viewer.