Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/listofbondsunittest.cpp

    r1bd79e r920c70  
    3838  atom *Walker = NULL;
    3939
    40   // init private all pointers to zero
    41   TestMolecule = NULL;
    42   hydrogen = NULL;
    43   tafel = NULL;
    44 
    4540  // construct element
    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);
     41  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     42  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
    5543
    5644  // construct molecule (tetraeder of hydrogens)
    5745  TestMolecule = World::getInstance().createMolecule();
    58   Walker = World::getInstance().createAtom();
     46  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
     47  Walker = World::getInstance().createAtom();
     48  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5949  Walker->type = hydrogen;
    6050  *Walker->node = Vector(1., 0., 1. );
    6151  TestMolecule->AddAtom(Walker);
    6252  Walker = World::getInstance().createAtom();
     53  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6354  Walker->type = hydrogen;
    6455  *Walker->node = Vector(0., 1., 1. );
    6556  TestMolecule->AddAtom(Walker);
    6657  Walker = World::getInstance().createAtom();
     58  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6759  Walker->type = hydrogen;
    6860  *Walker->node = Vector(1., 1., 0. );
    6961  TestMolecule->AddAtom(Walker);
    7062  Walker = World::getInstance().createAtom();
     63  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7164  Walker->type = hydrogen;
    7265  *Walker->node = Vector(0., 0., 0. );
     
    7568  // check that TestMolecule was correctly constructed
    7669  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
    77 
    7870};
    7971
     
    8678  // are all cleaned when the world is destroyed
    8779  World::purgeInstance();
    88   MemoryUsageObserver::purgeInstance();
    8980  logger::purgeInstance();
    9081};
Note: See TracChangeset for help on using the changeset viewer.