Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/listofbondsunittest.cpp

    r23b547 re6fdbe  
    1616#include "listofbondsunittest.hpp"
    1717
    18 #include "World.hpp"
    1918#include "atom.hpp"
    2019#include "bond.hpp"
     
    5150
    5251  // construct periodentafel
    53   tafel = World::getInstance().getPeriode();
     52  tafel = new periodentafel;
    5453  tafel->AddElement(hydrogen);
    5554
    5655  // construct molecule (tetraeder of hydrogens)
    57   TestMolecule = World::getInstance().createMolecule();
    58   Walker = World::getInstance().createAtom();
     56  TestMolecule = new molecule(tafel);
     57  Walker = new atom();
    5958  Walker->type = hydrogen;
    6059  Walker->node->Init(1., 0., 1. );
    6160  TestMolecule->AddAtom(Walker);
    62   Walker = World::getInstance().createAtom();
     61  Walker = new atom();
    6362  Walker->type = hydrogen;
    6463  Walker->node->Init(0., 1., 1. );
    6564  TestMolecule->AddAtom(Walker);
    66   Walker = World::getInstance().createAtom();
     65  Walker = new atom();
    6766  Walker->type = hydrogen;
    6867  Walker->node->Init(1., 1., 0. );
    6968  TestMolecule->AddAtom(Walker);
    70   Walker = World::getInstance().createAtom();
     69  Walker = new atom();
    7170  Walker->type = hydrogen;
    7271  Walker->node->Init(0., 0., 0. );
     
    8281{
    8382  // remove
    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();
     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();
    8888  MemoryUsageObserver::purgeInstance();
    8989  logger::purgeInstance();
     
    250250
    251251  // remove atom2
    252   World::getInstance().destroyAtom(atom2);
     252  delete(atom2);
    253253
    254254  // check bond if removed from other atom
Note: See TracChangeset for help on using the changeset viewer.