Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/listofbondsunittest.cpp

    re6fdbe r23b547  
    1616#include "listofbondsunittest.hpp"
    1717
     18#include "World.hpp"
    1819#include "atom.hpp"
    1920#include "bond.hpp"
     
    5051
    5152  // construct periodentafel
    52   tafel = new periodentafel;
     53  tafel = World::getInstance().getPeriode();
    5354  tafel->AddElement(hydrogen);
    5455
    5556  // construct molecule (tetraeder of hydrogens)
    56   TestMolecule = new molecule(tafel);
    57   Walker = new atom();
     57  TestMolecule = World::getInstance().createMolecule();
     58  Walker = World::getInstance().createAtom();
    5859  Walker->type = hydrogen;
    5960  Walker->node->Init(1., 0., 1. );
    6061  TestMolecule->AddAtom(Walker);
    61   Walker = new atom();
     62  Walker = World::getInstance().createAtom();
    6263  Walker->type = hydrogen;
    6364  Walker->node->Init(0., 1., 1. );
    6465  TestMolecule->AddAtom(Walker);
    65   Walker = new atom();
     66  Walker = World::getInstance().createAtom();
    6667  Walker->type = hydrogen;
    6768  Walker->node->Init(1., 1., 0. );
    6869  TestMolecule->AddAtom(Walker);
    69   Walker = new atom();
     70  Walker = World::getInstance().createAtom();
    7071  Walker->type = hydrogen;
    7172  Walker->node->Init(0., 0., 0. );
     
    8182{
    8283  // 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();
    8888  MemoryUsageObserver::purgeInstance();
    8989  logger::purgeInstance();
     
    250250
    251251  // remove atom2
    252   delete(atom2);
     252  World::getInstance().destroyAtom(atom2);
    253253
    254254  // check bond if removed from other atom
Note: See TracChangeset for help on using the changeset viewer.