Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/bondgraphunittest.cpp

    r23b547 re6fdbe  
    1616#include <cstring>
    1717
    18 #include "World.hpp"
    1918#include "atom.hpp"
    2019#include "bond.hpp"
     
    5756
    5857  // construct periodentafel
    59   tafel = World::getInstance().getPeriode();
     58  tafel = new periodentafel;
    6059  tafel->AddElement(hydrogen);
    6160  tafel->AddElement(carbon);
    6261
    6362  // construct molecule (tetraeder of hydrogens)
    64   TestMolecule = World::getInstance().createMolecule();
    65   Walker = World::getInstance().createAtom();
     63  TestMolecule = new molecule(tafel);
     64  Walker = new atom();
    6665  Walker->type = hydrogen;
    6766  Walker->node->Init(1., 0., 1. );
    6867  TestMolecule->AddAtom(Walker);
    69   Walker = World::getInstance().createAtom();
     68  Walker = new atom();
    7069  Walker->type = hydrogen;
    7170  Walker->node->Init(0., 1., 1. );
    7271  TestMolecule->AddAtom(Walker);
    73   Walker = World::getInstance().createAtom();
     72  Walker = new atom();
    7473  Walker->type = hydrogen;
    7574  Walker->node->Init(1., 1., 0. );
    7675  TestMolecule->AddAtom(Walker);
    77   Walker = World::getInstance().createAtom();
     76  Walker = new atom();
    7877  Walker->type = hydrogen;
    7978  Walker->node->Init(0., 0., 0. );
     
    102101
    103102  // 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();
    108108  MemoryUsageObserver::purgeInstance();
    109109  logger::purgeInstance();
Note: See TracChangeset for help on using the changeset viewer.