Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/listofbondsunittest.cpp

    r920c70 r1bd79e  
    3838  atom *Walker = NULL;
    3939
     40  // init private all pointers to zero
     41  TestMolecule = NULL;
     42  hydrogen = NULL;
     43  tafel = NULL;
     44
    4045  // construct element
    41   hydrogen = World::getInstance().getPeriode()->FindElement(1);
    42   CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
     46  hydrogen = new element;
     47  hydrogen->Z = 1;
     48  strcpy(hydrogen->name, "hydrogen");
     49  strcpy(hydrogen->symbol, "H");
     50
     51
     52  // construct periodentafel
     53  tafel = World::getInstance().getPeriode();
     54  tafel->AddElement(hydrogen);
    4355
    4456  // construct molecule (tetraeder of hydrogens)
    4557  TestMolecule = World::getInstance().createMolecule();
    46   CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    47   Walker = World::getInstance().createAtom();
    48   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
     58  Walker = World::getInstance().createAtom();
    4959  Walker->type = hydrogen;
    5060  *Walker->node = Vector(1., 0., 1. );
    5161  TestMolecule->AddAtom(Walker);
    5262  Walker = World::getInstance().createAtom();
    53   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5463  Walker->type = hydrogen;
    5564  *Walker->node = Vector(0., 1., 1. );
    5665  TestMolecule->AddAtom(Walker);
    5766  Walker = World::getInstance().createAtom();
    58   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5967  Walker->type = hydrogen;
    6068  *Walker->node = Vector(1., 1., 0. );
    6169  TestMolecule->AddAtom(Walker);
    6270  Walker = World::getInstance().createAtom();
    63   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6471  Walker->type = hydrogen;
    6572  *Walker->node = Vector(0., 0., 0. );
     
    6875  // check that TestMolecule was correctly constructed
    6976  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
     77
    7078};
    7179
     
    7886  // are all cleaned when the world is destroyed
    7987  World::purgeInstance();
     88  MemoryUsageObserver::purgeInstance();
    8089  logger::purgeInstance();
    8190};
Note: See TracChangeset for help on using the changeset viewer.