Index: src/unittests/ActOnAllUnitTest.cpp
===================================================================
--- src/unittests/ActOnAllUnitTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/ActOnAllUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -46,5 +46,4 @@
   // Ref was copy constructed, hence has to be cleaned, too!
   Ref.EmptyList();
-  MemoryUsageObserver::purgeInstance();
 };
 
@@ -77,6 +76,6 @@
 
   // scaling by three values
-  double *factors = Malloc<double>(NDIM, "ActOnAllTest::ScaleTest - factors");
-  double *inverses = Malloc<double>(NDIM, "ActOnAllTest::ScaleTest - inverses");
+  double *factors = new double[NDIM];
+  double *inverses = new double[NDIM];
   for (int i=0;i<NDIM;++i) {
     factors[i] = 2.;
@@ -88,6 +87,6 @@
   VL.ActOnAll<Vector,void,const double*>(&Vector::ScaleAll, inverses );
   CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
-  Free(factors);
-  Free(inverses);
+  delete[](factors);
+  delete[](inverses);
 };
 
Index: src/unittests/AnalysisCorrelationToPointUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -17,12 +17,9 @@
 #include "AnalysisCorrelationToPointUnitTest.hpp"
 
-#include "World.hpp"
 #include "atom.hpp"
-#include "boundary.hpp"
 #include "element.hpp"
 #include "molecule.hpp"
 #include "linkedcell.hpp"
 #include "periodentafel.hpp"
-#include "tesselation.hpp"
 #include "World.hpp"
 
@@ -43,21 +40,13 @@
   TestList = NULL;
   TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
   pointmap = NULL;
   binmap = NULL;
   point = NULL;
 
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-
+  // construct element list
+  std::vector<element *> elements;
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
+  elements.push_back(hydrogen);
   // construct molecule (tetraeder of hydrogens)
   TestMolecule = World::getInstance().createMolecule();
@@ -80,5 +69,5 @@
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
 
   TestList = World::getInstance().getMolecules();
@@ -90,5 +79,5 @@
 
   // init maps
-  pointmap = CorrelationToPoint( (MoleculeListClass * const)TestList, (const element * const)hydrogen, (const Vector *)point );
+  pointmap = CorrelationToPoint( (MoleculeListClass * const)TestList, elements, (const Vector *)point );
   binmap = NULL;
 
@@ -105,5 +94,4 @@
   delete(point);
   World::purgeInstance();
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
 };
Index: src/unittests/AnalysisCorrelationToPointUnitTest.hpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -12,9 +12,6 @@
 
 class element;
-class LinkedCell;
 class molecule;
 class MoleculeListClass;
-class periodentafel;
-class Tesselation;
 class Vector;
 
@@ -41,5 +38,4 @@
       molecule *TestMolecule;
       element *hydrogen;
-      periodentafel *tafel;
 
       CorrelationToPointMap *pointmap;
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -17,5 +17,4 @@
 #include "AnalysisCorrelationToSurfaceUnitTest.hpp"
 
-#include "World.hpp"
 #include "atom.hpp"
 #include "boundary.hpp"
@@ -26,4 +25,5 @@
 #include "tesselation.hpp"
 #include "World.hpp"
+#include "Helpers/Assert.hpp"
 
 #include "Helpers/Assert.hpp"
@@ -40,5 +40,5 @@
 void AnalysisCorrelationToSurfaceUnitTest::setUp()
 {
-  //ASSERT_DO(Assert::Throw);
+  ASSERT_DO(Assert::Throw);
 
   atom *Walker = NULL;
@@ -47,6 +47,4 @@
   TestList = NULL;
   TestSurfaceMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
   surfacemap = NULL;
   binmap = NULL;
@@ -54,34 +52,27 @@
   LC = NULL;
 
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  carbon = new element;
-  carbon->Z = 6;
-  strcpy(carbon->name, "carbon");
-  strcpy(carbon->symbol, "C");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(carbon);
+  // prepare element list
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
+  elements.clear();
 
   // construct molecule (tetraeder of hydrogens) base
   TestSurfaceMolecule = World::getInstance().createMolecule();
+
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
   *Walker->node = Vector(1., 0., 1. );
-
-  TestSurfaceMolecule->AddAtom(Walker);
+  TestSurfaceMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 1., 1. );
   TestSurfaceMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
   *Walker->node = Vector(1., 1., 0. );
   TestSurfaceMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
@@ -90,5 +81,5 @@
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestSurfaceMolecule->AtomCount, 4 );
+  CPPUNIT_ASSERT_EQUAL( TestSurfaceMolecule->getAtomCount(), 4 );
 
   TestList = World::getInstance().getMolecules();
@@ -102,4 +93,5 @@
 
   // add outer atoms
+  carbon = World::getInstance().getPeriode()->FindElement(6);
   TestSurfaceMolecule = World::getInstance().createMolecule();
   Walker = World::getInstance().createAtom();
@@ -107,12 +99,15 @@
   *Walker->node = Vector(4., 0., 4. );
   TestSurfaceMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
   Walker->type = carbon;
   *Walker->node = Vector(0., 4., 4. );
   TestSurfaceMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
   Walker->type = carbon;
   *Walker->node = Vector(4., 4., 0. );
   TestSurfaceMolecule->AddAtom(Walker);
+
   // add inner atoms
   Walker = World::getInstance().createAtom();
@@ -120,4 +115,5 @@
   *Walker->node = Vector(0.5, 0.5, 0.5 );
   TestSurfaceMolecule->AddAtom(Walker);
+
   TestSurfaceMolecule->ActiveFlag = true;
   TestList->insert(TestSurfaceMolecule);
@@ -141,5 +137,4 @@
   delete(LC);
   World::purgeInstance();
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
 };
@@ -150,5 +145,5 @@
 void AnalysisCorrelationToSurfaceUnitTest::SurfaceTest()
 {
-  CPPUNIT_ASSERT_EQUAL( 4, TestSurfaceMolecule->AtomCount );
+  CPPUNIT_ASSERT_EQUAL( 4, TestSurfaceMolecule->getAtomCount() );
   CPPUNIT_ASSERT_EQUAL( (size_t)2, TestList->ListOfMolecules.size() );
   CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->PointsOnBoundary.size() );
@@ -160,5 +155,6 @@
 {
   // do the pair correlation
-  surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
+  elements.push_back(hydrogen);
+  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
 //  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   CPPUNIT_ASSERT( surfacemap != NULL );
@@ -169,5 +165,6 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
+  elements.push_back(hydrogen);
+  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
   // put pair correlation into bins and check with no range
 //  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
@@ -184,5 +181,6 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
+  elements.push_back(hydrogen);
+  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
 //  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   // ... and check with [0., 2.] range
@@ -202,5 +200,6 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC );
+  elements.push_back(carbon);
+  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
 //  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   // put pair correlation into bins and check with no range
@@ -221,5 +220,6 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC );
+  elements.push_back(carbon);
+  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
 //  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   // ... and check with [0., 2.] range
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -47,5 +47,5 @@
       element *hydrogen;
       element *carbon;
-      periodentafel *tafel;
+      std::vector<element *> elements;
 
       CorrelationToSurfaceMap *surfacemap;
Index: src/unittests/AnalysisPairCorrelationUnitTest.cpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -44,18 +44,13 @@
   TestList = NULL;
   TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
   correlationmap = NULL;
   binmap = NULL;
 
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
+  // construct element list
+  std::vector<element *> elements;
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
+  elements.push_back(hydrogen);
+  elements.push_back(hydrogen);
 
   // construct molecule (tetraeder of hydrogens)
@@ -79,5 +74,5 @@
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
 
   TestList = World::getInstance().getMolecules();
@@ -86,5 +81,5 @@
 
   // init maps
-  correlationmap = PairCorrelation( TestList, hydrogen, hydrogen );
+  correlationmap = PairCorrelation( TestList, elements);
   binmap = NULL;
 
@@ -101,5 +96,4 @@
   // note that all the atoms are cleaned by TestMolecule
   World::purgeInstance();
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
   errorLogger::purgeInstance();
Index: src/unittests/AnalysisPairCorrelationUnitTest.hpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -12,9 +12,6 @@
 
 class element;
-class LinkedCell;
 class molecule;
 class MoleculeListClass;
-class periodentafel;
-class Tesselation;
 class Vector;
 
@@ -41,5 +38,4 @@
       molecule *TestMolecule;
       element *hydrogen;
-      periodentafel *tafel;
 
       PairCorrelationMap *correlationmap;
Index: src/unittests/CacheableTest.cpp
===================================================================
--- src/unittests/CacheableTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/CacheableTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -55,6 +55,7 @@
 
   threeNumbers(int _x,int _y, int _z) :
+    Observable("threeNumbers"),
     x(_x),y(_y),z(_z),
-    sum(this,boost::bind(&threeNumbers::calcSum,this)),
+    sum(this,boost::bind(&threeNumbers::calcSum,this),"sum"),
     hasRecalced(false)
   {}
@@ -81,3 +82,10 @@
   CPPUNIT_ASSERT_EQUAL( 9, *(numbers->sum));
   CPPUNIT_ASSERT_EQUAL( true, numbers->hasRecalced);
+  numbers->hasRecalced=false;
+  CPPUNIT_ASSERT_EQUAL( 9, *(numbers->sum));
+#ifndef NO_CACHING
+  CPPUNIT_ASSERT_EQUAL( false, numbers->hasRecalced);
+#else
+  CPPUNIT_ASSERT_EQUAL( true, numbers->hasRecalced);
+#endif
 }
Index: src/unittests/CountBondsUnitTest.cpp
===================================================================
--- src/unittests/CountBondsUnitTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/CountBondsUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -16,4 +16,6 @@
 #include <stdio.h>
 #include <cstring>
+
+#include "Helpers/Assert.hpp"
 
 #include "analysis_bonds.hpp"
@@ -40,43 +42,26 @@
 {
   atom *Walker = NULL;
-  BG = NULL;
-  filename = NULL;
-
-  // init private all pointers to zero
-  molecules = NULL;
-  TestMolecule1 = NULL;
-  TestMolecule2 = NULL;
-  hydrogen = NULL;
-  oxygen = NULL;
-  tafel = NULL;
 
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->CovalentRadius = 0.23;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  oxygen = new element;
-  oxygen->Z = 8;
-  oxygen->CovalentRadius = 0.68;
-  strcpy(oxygen->name, "oxygen");
-  strcpy(oxygen->symbol, "O");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(oxygen);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  oxygen = World::getInstance().getPeriode()->FindElement(8);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
+  CPPUNIT_ASSERT(oxygen != NULL && "could not find element oxygen");
 
   // construct molecule (water molecule)
   TestMolecule1 = World::getInstance().createMolecule();
-  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(TestMolecule1 != NULL && "could not create first molecule");
+  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(-0.2418, 0.9350, 0. );
   TestMolecule1->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0.9658, 0., 0. );
   TestMolecule1->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = oxygen;
   *Walker->node = Vector(0., 0., 0. );
@@ -84,13 +69,17 @@
 
   TestMolecule2 = World::getInstance().createMolecule();
-  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(TestMolecule2 != NULL && "could not create second molecule");
+  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(-0.2418, 0.9350, 0. );
   TestMolecule2->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0.9658, 0., 0. );
   TestMolecule2->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = oxygen;
   *Walker->node = Vector(0., 0., 0. );
@@ -98,17 +87,15 @@
 
   molecules = World::getInstance().getMolecules();
+  CPPUNIT_ASSERT(molecules != NULL && "could not obtain list of molecules");
   molecules->insert(TestMolecule1);
   molecules->insert(TestMolecule2);
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule1->AtomCount, 3 );
-  Walker = TestMolecule1->start->next;
-  CPPUNIT_ASSERT( TestMolecule1->end != Walker );
-  CPPUNIT_ASSERT_EQUAL( TestMolecule2->AtomCount, 3 );
-  Walker = TestMolecule2->start->next;
-  CPPUNIT_ASSERT( TestMolecule2->end != Walker );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule1->getAtomCount(), 3 );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule2->getAtomCount(), 3 );
 
   // create a small file with table
   BG = new BondGraph(true);
+  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
 
   // construct bond graphs
@@ -126,5 +113,4 @@
 
   World::purgeInstance();
-  MemoryUsageObserver::purgeInstance();
 };
 
@@ -158,4 +144,5 @@
 {
   double *mirror = new double[3];
+  CPPUNIT_ASSERT(mirror != NULL && "could not create array of doubles");
   for (int i=0;i<3;i++)
     mirror[i] = -1.;
Index: src/unittests/CountBondsUnitTest.hpp
===================================================================
--- src/unittests/CountBondsUnitTest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/CountBondsUnitTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -39,7 +39,6 @@
       molecule *TestMolecule1;
       molecule *TestMolecule2;
-      element *hydrogen;
-      element *oxygen;
-      periodentafel *tafel;
+      const element *hydrogen;
+      const element *oxygen;
 
       BondGraph *BG;
Index: src/unittests/LinkedCellUnitTest.cpp
===================================================================
--- src/unittests/LinkedCellUnitTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/LinkedCellUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -38,26 +38,16 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->CovalentRadius = 0.23;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
 
   // construct molecule (water molecule)
   TestMolecule = World::getInstance().createMolecule();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
   for (double x=0.5;x<3;x+=1.)
     for (double y=0.5;y<3;y+=1.)
       for (double z=0.5;z<3;z+=1.) {
         Walker = World::getInstance().createAtom();
+        CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
         Walker->type = hydrogen;
         *Walker->node = Vector(x, y, z );
@@ -67,9 +57,8 @@
   // construct linked cell
   LC = new LinkedCell (TestMolecule, 1.);
+  CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell");
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 3*3*3 );
-  Walker = TestMolecule->start->next;
-  CPPUNIT_ASSERT( TestMolecule->end != Walker );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 3*3*3 );
 };
 
@@ -79,5 +68,4 @@
   delete(LC);
   World::purgeInstance();
-  MemoryUsageObserver::purgeInstance();
 };
 
@@ -197,23 +185,21 @@
 {
   // check all atoms
-  atom *Walker = TestMolecule->start;
-  while (Walker->next != TestMolecule->end) {
-    Walker = Walker->next;
-    CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToNode(Walker) );
+  for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end();++iter){
+    CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToNode(*iter) );
   }
 
   // check internal vectors, returns false, because this atom is not in LC-list!
-  Walker = World::getInstance().createAtom();
-  Walker->setName("test");
-  Walker->x= Vector(1,1,1);
-  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
-  World::getInstance().destroyAtom(Walker);
+  atom *newAtom = World::getInstance().createAtom();
+  newAtom->setName("test");
+  newAtom->x= Vector(1,1,1);
+  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(newAtom) );
+  World::getInstance().destroyAtom(newAtom);
 
   // check out of bounds vectors
-  Walker = World::getInstance().createAtom();
-  Walker->setName("test");
-  Walker->x = Vector(0,-1,0);
-  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
-  World::getInstance().destroyAtom(Walker);
+  newAtom = World::getInstance().createAtom();
+  newAtom->setName("test");
+  newAtom->x = Vector(0,-1,0);
+  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(newAtom) );
+  World::getInstance().destroyAtom(newAtom);
 };
 
@@ -278,5 +264,4 @@
   Vector tester;
   LinkedCell::LinkedNodes *ListOfPoints = NULL;
-  atom *Walker = NULL;
   size_t size = 0;
 
@@ -287,9 +272,7 @@
   size = ListOfPoints->size();
   CPPUNIT_ASSERT_EQUAL( (size_t)27, size );
-  Walker = TestMolecule->start;
-  Walker = TestMolecule->start;
-  while (Walker->next != TestMolecule->end) {
-    Walker = Walker->next;
-    ListOfPoints->remove(Walker);
+
+  for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end(); ++iter){
+    ListOfPoints->remove((*iter));
     size--;
     CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
@@ -306,9 +289,7 @@
   size=ListOfPoints->size();
   CPPUNIT_ASSERT_EQUAL( (size_t)8, size );
-  Walker = TestMolecule->start;
-  while (Walker->next != TestMolecule->end) {
-    Walker = Walker->next;
-    if ((Walker->x[0] <2) && (Walker->x[1] <2) && (Walker->x[2] <2)) {
-      ListOfPoints->remove(Walker);
+  for(molecule::iterator iter = TestMolecule->begin(); iter != TestMolecule->end(); ++iter){
+    if (((*iter)->x[0] <2) && ((*iter)->x[1] <2) && ((*iter)->x[2] <2)) {
+      ListOfPoints->remove(*iter);
       size--;
       CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
@@ -326,8 +307,6 @@
   size=ListOfPoints->size();
   CPPUNIT_ASSERT_EQUAL( (size_t)27, size );
-  Walker = TestMolecule->start;
-  while (Walker->next != TestMolecule->end) {
-    Walker = Walker->next;
-    ListOfPoints->remove(Walker);
+  for(molecule::iterator iter = TestMolecule->begin(); iter!=TestMolecule->end();++iter){
+    ListOfPoints->remove(*iter);
     size--;
     CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
@@ -346,5 +325,4 @@
   Vector tester;
   LinkedCell::LinkedNodes *ListOfPoints = NULL;
-  atom *Walker = NULL;
   size_t size = 0;
 
@@ -355,9 +333,7 @@
   size = ListOfPoints->size();
   CPPUNIT_ASSERT_EQUAL( (size_t)7, size );
-  Walker = TestMolecule->start;
-  while (Walker->next != TestMolecule->end) {
-    Walker = Walker->next;
-    if ((Walker->x.DistanceSquared(tester) - 1.) < MYEPSILON ) {
-      ListOfPoints->remove(Walker);
+  for(molecule::iterator iter = TestMolecule->begin(); iter!=TestMolecule->end();++iter){
+    if (((*iter)->x.DistanceSquared(tester) - 1.) < MYEPSILON ) {
+      ListOfPoints->remove(*iter);
       size--;
       CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
Index: src/unittests/LinkedCellUnitTest.hpp
===================================================================
--- src/unittests/LinkedCellUnitTest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/LinkedCellUnitTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -48,6 +48,5 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      periodentafel *tafel;
+      const element *hydrogen;
       LinkedCell *LC;
 };
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/Makefile.am	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -1,2 +1,5 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
 INCLUDES = -I$(top_srcdir)/src
 
@@ -31,6 +34,8 @@
   MemoryAllocatorUnitTest \
   MoleculeDescriptorTest \
+  ObserverTest \
+  ParserUnitTest \
+  periodentafelTest \
   PlaneUnittest \
-  ObserverTest \
   SingletonTest \
   StackClassUnitTest \
@@ -47,4 +52,5 @@
 GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
 ALLLIBS = ../libmolecuilder.a ${GSLLIBS} 
+PARSERLIBS = ../libparser.a ${ALLLIBS} 
 
 TESTSOURCES = \
@@ -73,6 +79,8 @@
   memoryusageobserverunittest.cpp \
   MoleculeDescriptorTest.cpp \
+  ObserverTest.cpp \
+  ParserUnitTest.cpp \
+  periodentafelTest.cpp \
   PlaneUnittest.cpp \
-  ObserverTest.cpp \
   SingletonTest.cpp \
   stackclassunittest.cpp \
@@ -107,4 +115,5 @@
   memoryusageobserverunittest.hpp \
   MoleculeDescriptorTest.hpp \
+  periodentafelTest.hpp \
   PlaneUnittest.hpp \
   ObserverTest.hpp \
@@ -117,4 +126,7 @@
   
 
+ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
+ActionSequenceTest_LDADD = ${ALLLIBS}
+
 ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
 ActOnAllUnitTest_LDADD = ${ALLLIBS}
@@ -135,7 +147,13 @@
 atomsCalculationTest_LDADD = ${ALLLIBS}
 
+AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp
+AtomDescriptorTest_LDADD = ${ALLLIBS}
+
 BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp
 BondGraphUnitTest_LDADD = ${ALLLIBS}
 
+CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
+CacheableTest_LDADD = ${ALLLIBS}
+
 CountBondsUnitTest_SOURCES = UnitTestMain.cpp CountBondsUnitTest.cpp CountBondsUnitTest.hpp
 CountBondsUnitTest_LDADD = ${ALLLIBS}
@@ -168,8 +186,11 @@
 LogUnitTest_LDADD = ${ALLLIBS}
 
-MemoryAllocatorUnitTest_SOURCES = UnitTestMain.cpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp 
+manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
+manipulateAtomsTest_LDADD = ${ALLLIBS}
+
+MemoryAllocatorUnitTest_SOURCES = UnitTestMain.cpp ../memoryallocator.hpp ../memoryallocator.cpp ../memoryusageobserver.cpp ../memoryusageobserver.hpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp 
 MemoryAllocatorUnitTest_LDADD = ${ALLLIBS}
 
-MemoryUsageObserverUnitTest_SOURCES = UnitTestMain.cpp memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp 
+MemoryUsageObserverUnitTest_SOURCES = UnitTestMain.cpp ../memoryallocator.hpp ../memoryusageobserver.cpp ../memoryusageobserver.hpp memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp 
 MemoryUsageObserverUnitTest_LDADD = ${ALLLIBS}
 
@@ -177,9 +198,18 @@
 MoleculeDescriptorTest_LDADD = ${ALLLIBS}
 
+ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
+ObserverTest_LDADD = ${ALLLIBS}
+
+ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp
+ParserUnitTest_LDADD = ${PARSERLIBS}
+
+periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp
+periodentafelTest_LDADD = ${ALLLIBS}
+
 PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp
 PlaneUnittest_LDADD = ${ALLLIBS}
 
 SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp
-SingletonTest_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB}
+SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB}
 
 StackClassUnitTest_SOURCES = UnitTestMain.cpp stackclassunittest.cpp stackclassunittest.hpp
@@ -195,25 +225,9 @@
 Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS}
 
+TestRunner_SOURCES = TestRunnerMain.cpp ../memoryallocator.hpp ../memoryallocator.cpp ../memoryusageobserver.cpp ../memoryusageobserver.hpp $(TESTSOURCES) $(TESTHEADERS)
+TestRunner_LDADD = ${ALLLIBS}
+
 VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp 
 VectorUnitTest_LDADD = ${ALLLIBS}
 
-ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
-ActionSequenceTest_LDADD = ${ALLLIBS}
-
-ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
-ObserverTest_LDADD = ${ALLLIBS}
-
-CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
-CacheableTest_LDADD = ${ALLLIBS}
-
-AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp
-AtomDescriptorTest_LDADD = ${ALLLIBS}
-
-manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
-manipulateAtomsTest_LDADD = ${ALLLIBS}
-
-TestRunner_SOURCES = UnitTestMain.cpp $(TESTSOURCES) $(TESTHEADERS)
-TestRunner_LDADD = ${ALLLIBS}
-
 #AUTOMAKE_OPTIONS = parallel-tests
-
Index: src/unittests/MapofActionsTest.cpp
===================================================================
--- src/unittests/MapofActionsTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
+++ src/unittests/MapofActionsTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -0,0 +1,65 @@
+/*
+ * analysisbondsunittest.cpp
+ *
+ *  Created on: Nov 7, 2009
+ *      Author: heber
+ */
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <iostream>
+#include <stdio.h>
+#include <cstring>
+
+#include "MapOfActionsTest.hpp"
+#include "Actions/MapOfActions.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( MapOfActionsTest );
+
+
+void MapOfActionsTest::setUp()
+{
+  MapOfActions *ActionData = MapOfActions::getInstance();
+};
+
+
+void MapOfActionsTest::tearDown()
+{
+  // note that all the atoms are cleaned by TestMolecule
+  MapOfActions::purgeInstance();
+};
+
+/** UnitTest: check whether each short form action also has a description (the other way round is not always true)
+ */
+void MapOfActionsTest::ShortFormConsistencyTest()
+{
+  for (map<string, string>::iterator ShortFormRunner = ActionData->ShortFormMap.begin(); ShortFormRunner = ActionData->ShortFormMap.begin(); ++ShortFormRunner) {
+    CPPUNIT_ASSERT( ActionData->DescriptionMap.find(ShortFormRunner->first) != ActionData->DescriptionMap.end() && "There is a short form without description.");
+  }
+};
+
+/** UnitTest: check whether each action appears in a list one of the option lists
+ */
+void MapOfActionsTest::OptionsListsConsistencyTest()
+{
+  bool haveFound = false;
+  for (map<string, string>::iterator ActionRunner = ActionData->DescriptionMap.begin(); ShortFormRunner = ActionData->DescriptionMap.begin(); ++ShortFormRunner) {
+    haveFound = haveFound || (ActionData->generic.find(ActionRunner->first) != ActionData->generic.end());
+    haveFound = haveFound || (ActionData->config.find(ActionRunner->first) != ActionData->config.end());
+    haveFound = haveFound || (ActionData->hidden.find(ActionRunner->first) != ActionData->hidden.end());
+    haveFound = haveFound || (ActionData->visible.find(ActionRunner->first) != ActionData->visible.end());
+    CPPUNIT_ASSERT_EQUAL( true , haveFound);
+  }
+};
+
Index: src/unittests/MapofActionsTest.hpp
===================================================================
--- src/unittests/MapofActionsTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
+++ src/unittests/MapofActionsTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -0,0 +1,37 @@
+/*
+ * analysisbondsunittest.hpp
+ *
+ *  Created on: Nov 7, 2009
+ *      Author: heber
+ */
+
+#ifndef MAPOFACTIONS_HPP_
+#define MAPOFACTIONS_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class BondGraph;
+class element;
+class molecule;
+class periodentafel;
+
+/********************************************** Test classes **************************************/
+
+class MapOfActionsTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( MapOfActionsTest) ;
+    CPPUNIT_TEST ( ShortFormConsistencyTest );
+    CPPUNIT_TEST ( OptionsListsConsistencyTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void ShortFormConsistencyTest();
+      void OptionsListsConsistencyTest();
+
+private:
+
+      MapOfActions *ActionData;
+
+#endif /* MAPOFACTIONS_HPP_ */
Index: src/unittests/ObserverTest.cpp
===================================================================
--- src/unittests/ObserverTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/ObserverTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -11,6 +11,8 @@
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
+#include <set>
 
 #include "Patterns/Observer.hpp"
+#include "Patterns/ObservedIterator.hpp"
 #include "Helpers/Assert.hpp"
 
@@ -31,4 +33,5 @@
 public:
   UpdateCountObserver() :
+    Observer("UpdateCountObserver"),
     updates(0)
   {};
@@ -43,4 +46,8 @@
 class SimpleObservable : public Observable {
 public:
+  SimpleObservable() :
+    Observable("SimpleObservable")
+  {}
+
   void changeMethod() {
     OBSERVE;
@@ -52,4 +59,8 @@
 class CallObservable : public Observable {
 public:
+  CallObservable() :
+    Observable("CallObservable")
+  {}
+
   void changeMethod1() {
     OBSERVE;
@@ -68,4 +79,8 @@
 class BlockObservable : public Observable {
 public:
+  BlockObservable() :
+    Observable("BlockObservable")
+  {}
+
   void changeMethod1(){
     OBSERVE;
@@ -102,5 +117,7 @@
 class SuperObservable : public Observable {
 public:
-  SuperObservable(){
+  SuperObservable():
+    Observable("SuperObservable")
+  {
     subObservable = new SimpleObservable();
     subObservable->signOn(this);
@@ -121,6 +138,7 @@
 public:
   NotificationObservable() :
-      notification1(new Notification(this)),
-      notification2(new Notification(this))
+    Observable("NotificationObservable"),
+    notification1(new Notification(this)),
+    notification2(new Notification(this))
   {}
 
@@ -147,4 +165,5 @@
 public:
   NotificationObserver(Notification_ptr notification) :
+    Observer("NotificationObserver"),
     requestedNotification(notification),
     wasNotified(false)
@@ -162,4 +181,43 @@
   bool wasNotified;
 };
+
+class ObservableCollection : public Observable {
+public:
+  typedef std::set<SimpleObservable*> set;
+  typedef ObservedIterator<set> iterator;
+  typedef set::const_iterator const_iterator;
+
+  ObservableCollection(int _num) :
+    Observable("ObservableCollection"),
+    num(_num)
+  {
+    for(int i=0; i<num; ++i){
+      SimpleObservable *content = new SimpleObservable();
+      content->signOn(this);
+      theSet.insert(content);
+    }
+  }
+
+  ~ObservableCollection(){
+    set::iterator iter;
+    for(iter=theSet.begin(); iter!=theSet.end(); ++iter ){
+      delete (*iter);
+    }
+  }
+
+  iterator begin(){
+    return iterator(theSet.begin(),this);
+  }
+
+  iterator end(){
+    return iterator(theSet.end(),this);
+  }
+
+  const int num;
+
+private:
+  set theSet;
+};
+
 
 /******************* actuall tests ***************/
@@ -173,4 +231,5 @@
   blockObservable = new BlockObservable();
   notificationObservable = new NotificationObservable();
+  collection = new ObservableCollection(5);
 
   observer1 = new UpdateCountObserver();
@@ -181,5 +240,4 @@
   notificationObserver1 = new NotificationObserver(notificationObservable->notification1);
   notificationObserver2 = new NotificationObserver(notificationObservable->notification2);
-
 }
 
@@ -191,4 +249,5 @@
   delete blockObservable;
   delete notificationObservable;
+  delete collection;
 
   delete observer1;
@@ -279,4 +338,38 @@
 }
 
+void ObserverTest::iteratorTest(){
+  int i = 0;
+  // test the general iterator methods
+  for(ObservableCollection::iterator iter=collection->begin(); iter!=collection->end();++iter){
+    CPPUNIT_ASSERT(i< collection->num);
+    i++;
+  }
+
+  i=0;
+  for(ObservableCollection::const_iterator iter=collection->begin(); iter!=collection->end();++iter){
+    CPPUNIT_ASSERT(i<collection->num);
+    i++;
+  }
+
+  collection->signOn(observer1);
+  {
+    // we construct this out of the loop, so the iterator dies at the end of
+    // the scope and not the end of the loop (allows more testing)
+    ObservableCollection::iterator iter;
+    for(iter=collection->begin(); iter!=collection->end(); ++iter){
+      (*iter)->changeMethod();
+    }
+    // At this point no change should have been propagated
+    CPPUNIT_ASSERT_EQUAL( 0, observer1->updates);
+  }
+  // After the Iterator has died the propagation should take place
+  CPPUNIT_ASSERT_EQUAL( 1, observer1->updates);
+
+  // when using a const_iterator no changes should be propagated
+  for(ObservableCollection::const_iterator iter = collection->begin(); iter!=collection->end();++iter);
+  CPPUNIT_ASSERT_EQUAL( 1, observer1->updates);
+  collection->signOff(observer1);
+}
+
 void ObserverTest::CircleDetectionTest() {
   cout << endl << "Warning: the next test involved methods that can produce infinite loops." << endl;
@@ -289,5 +382,9 @@
   // make this Observable its own subject. NEVER DO THIS IN ACTUAL CODE
   simpleObservable1->signOn(simpleObservable1);
+#ifndef NDEBUG
   CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure);
+#else
+  simpleObservable1->changeMethod();
+#endif
 
   // more complex test
@@ -295,5 +392,11 @@
   simpleObservable1->signOn(simpleObservable2);
   simpleObservable2->signOn(simpleObservable1);
+#ifndef NDEBUG
   CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure);
+#else
+  simpleObservable1->changeMethod();
+#endif
+
+
   simpleObservable1->signOff(simpleObservable2);
   simpleObservable2->signOff(simpleObservable1);
Index: src/unittests/ObserverTest.hpp
===================================================================
--- src/unittests/ObserverTest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/ObserverTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -17,7 +17,7 @@
 class CallObservable;
 class SuperObservable;
+class ObservableCollection;
 class BlockObservable;
 class NotificationObservable;
-
 
 class ObserverTest :  public CppUnit::TestFixture
@@ -29,4 +29,5 @@
   CPPUNIT_TEST ( doesNotifyTest );
   CPPUNIT_TEST ( doesReportTest );
+  CPPUNIT_TEST ( iteratorTest );
   CPPUNIT_TEST ( CircleDetectionTest );
   CPPUNIT_TEST_SUITE_END();
@@ -41,4 +42,5 @@
   void doesNotifyTest();
   void doesReportTest();
+  void iteratorTest();
   void CircleDetectionTest();
 
@@ -58,4 +60,6 @@
   SuperObservable *superObservable;
   NotificationObservable *notificationObservable;
+  ObservableCollection *collection;
+
 };
 
Index: src/unittests/ParserUnitTest.cpp
===================================================================
--- src/unittests/ParserUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
+++ src/unittests/ParserUnitTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -0,0 +1,326 @@
+/*
+ * ParserUnitTest.cpp
+ *
+ *  Created on: Mar 3, 2010
+ *      Author: metzler
+ */
+
+#include "ParserUnitTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "Parser/MpqcParser.hpp"
+#include "Parser/PcpParser.hpp"
+#include "Parser/TremoloParser.hpp"
+#include "Parser/XyzParser.hpp"
+#include "World.hpp"
+#include "atom.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "Descriptors/AtomTypeDescriptor.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+using namespace std;
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( ParserUnitTest );
+
+static string waterPcp = "# ParallelCarParinello - main configuration file - created with molecuilder\n\
+\n\
+mainname\tpcp\t# programm name (for runtime files)\n\
+defaultpath\not specified\t# where to put files during runtime\n\
+pseudopotpath\not specified\t# where to find pseudopotentials\n\
+\n\
+ProcPEGamma\t8\t# for parallel computing: share constants\n\
+ProcPEPsi\t1\t# for parallel computing: share wave functions\n\
+DoOutVis\t0\t# Output data for OpenDX\n\
+DoOutMes\t1\t# Output data for measurements\n\
+DoOutOrbitals\t0\t# Output all Orbitals\n\
+DoOutCurr\t0\t# Ouput current density for OpenDx\n\
+DoOutNICS\t0\t# Output Nucleus independent current shieldings\n\
+DoPerturbation\t0\t# Do perturbation calculate and determine susceptibility and shielding\n\
+DoFullCurrent\t0\t# Do full perturbation\n\
+DoConstrainedMD\t0\t# Do perform a constrained (>0, relating to current MD step) instead of unconstrained (0) MD\n\
+Thermostat\tBerendsen\t2.5\t# Which Thermostat and its parameters to use in MD case.\n\
+CommonWannier\t0\t# Put virtual centers at indivual orbits, all common, merged by variance, to grid point, to cell center\n\
+SawtoothStart\t0.01\t# Absolute value for smooth transition at cell border \n\
+VectorPlane\t0\t# Cut plane axis (x, y or z: 0,1,2) for two-dim current vector plot\n\
+VectorCut\t0\t# Cut plane axis value\n\
+AddGramSch\t1\t# Additional GramSchmidtOrtogonalization to be safe\n\
+Seed\t1\t# initial value for random seed for Psi coefficients\n\
+\n\
+MaxOuterStep\t0\t# number of MolecularDynamics/Structure optimization steps\n\
+Deltat\t0.01\t# time per MD step\n\
+OutVisStep\t10\t# Output visual data every ...th step\n\
+OutSrcStep\t5\t# Output \"restart\" data every ..th step\n\
+TargetTemp\t0.000950045\t# Target temperature\n\
+MaxPsiStep\t3\t# number of Minimisation steps per state (0 - default)\n\
+EpsWannier\t1e-07\t# tolerance value for spread minimisation of orbitals\n\
+# Values specifying when to stop\n\
+MaxMinStep\t100\t# Maximum number of steps\n\
+RelEpsTotalE\t1e-07\t# relative change in total energy\n\
+RelEpsKineticE\t1e-05\t# relative change in kinetic energy\n\
+MaxMinStopStep\t2\t# check every ..th steps\n\
+MaxMinGapStopStep\t1\t# check every ..th steps\n\
+\n\
+# Values specifying when to stop for INIT, otherwise same as above\n\
+MaxInitMinStep\t100\t# Maximum number of steps\n\
+InitRelEpsTotalE\t1e-05\t# relative change in total energy\n\
+InitRelEpsKineticE\t0.0001\t# relative change in kinetic energy\n\
+InitMaxMinStopStep\t2\t# check every ..th steps\n\
+InitMaxMinGapStopStep\t1\t# check every ..th steps\n\
+\n\
+BoxLength\t# (Length of a unit cell)\n\
+20\n\
+0\t20\n\
+0\t0\t20\n\
+\n\
+ECut\t128\t# energy cutoff for discretization in Hartrees\n\
+MaxLevel\t5\t# number of different levels in the code, >=2\n\
+Level0Factor\t2\t# factor by which node number increases from S to 0 level\n\
+RiemannTensor\t0\t# (Use metric)\n\
+PsiType\t0\t# 0 - doubly occupied, 1 - SpinUp,SpinDown\n\
+MaxPsiDouble\t2\t# here: specifying both maximum number of SpinUp- and -Down-states\n\
+PsiMaxNoUp\t2\t# here: specifying maximum number of SpinUp-states\n\
+PsiMaxNoDown\t2\t# here: specifying maximum number of SpinDown-states\n\
+AddPsis\t0\t# Additional unoccupied Psis for bandgap determination\n\
+\n\
+RCut\t20\t# R-cut for the ewald summation\n\
+StructOpt\t0\t# Do structure optimization beforehand\n\
+IsAngstroem\t1\t# 0 - Bohr, 1 - Angstroem\n\
+RelativeCoord\t0\t# whether ion coordinates are relative (1) or absolute (0)\n\
+MaxTypes\t2\t# maximum number of different ion types\n\
+\n\
+# Ion type data (PP = PseudoPotential, Z = atomic number)\n\
+#Ion_TypeNr.\tAmount\tZ\tRGauss\tL_Max(PP)L_Loc(PP)IonMass\t# chemical name, symbol\n\
+Ion_Type1\t2\t1\t1.0\t3\t3\t1.008\tHydrogen\tH\n\
+Ion_Type2\t1\t8\t1.0\t3\t3\t15.999\tOxygen\tO\n\
+#Ion_TypeNr._Nr.R[0]\tR[1]\tR[2]\tMoveType (0 MoveIon, 1 FixedIon)\n\
+Ion_Type2_1\t0.000000000\t0.000000000\t0.000000000\t0 # molecule nr 0\n\
+Ion_Type1_1\t0.758602\t0.000000000\t0.504284\t0 # molecule nr 1\n\
+Ion_Type1_2\t0.758602\t0.000000000\t-0.504284\t0 # molecule nr 2\n";
+static string waterMpqc ="% Created by MoleCuilder\n\
+mpqc: (\n\
+\tsavestate = no\n\
+\tdo_gradient = yes\n\
+\tmole<MBPT2>: (\n\
+\t\tmaxiter = 200\n\
+\t\tbasis = $:basis\n\
+\t\tmolecule = $:molecule\n\
+\t\treference<CLHF>: (\n\
+\t\t\tbasis = $:basis\n\
+\t\t\tmolecule = $:molecule\n\
+\t\t)\n\
+\t)\n\
+)\n\
+molecule<Molecule>: (\n\
+\tunit = angstrom\n\
+\t{ atoms geometry } = {\n\
+\t\tO [ -0.505735\t0\t0 ]\n\
+\t\tH [ 0.252867\t0\t0.504284 ]\n\
+\t\tH [ 0.252867\t0\t-0.504284 ]\n\
+\t}\n\
+)\n\
+basis<GaussianBasisSet>: (\n\
+\tname = \"3-21G\"\n\
+\tmolecule = $:molecule\n\
+)\n";
+static string waterXyz = "3\nH2O: water molecule\nO\t0\t0\t0\nH\t0.758602\t0\t0.504284\nH\t0.758602\t0\t-0.504284\n";
+static string Tremolo_Atomdata1 = "# ATOMDATA\tId\tname\tType\tx=3\n";
+static string Tremolo_Atomdata2 = "#\n#ATOMDATA Id name Type x=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
+static string Tremolo_invalidkey = "#\n#ATOMDATA Id name foo Type x=3\n\n\n";
+static string Tremolo_velocity = "#\n#ATOMDATA Id name Type u=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
+static string Tremolo_neighbours = "#\n#ATOMDATA Id Type neighbors=2\n1 H 3 0\n2 H 3 0\n3 O 1 2\n";
+static string Tremolo_improper = "#\n#ATOMDATA Id Type imprData\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
+static string Tremolo_torsion = "#\n#ATOMDATA Id Type torsion\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
+static string Tremolo_full = "# ATOMDATA\tx=3\tu=3\tF\tstress\tId\tneighbors=5\timprData\tGroupMeasureTypeNo\tType\textType\tname\tresName\tchainID\tresSeq\toccupancy\ttempFactor\tsegID\tCharge\tcharge\tGrpTypeNo\ttorsion\n0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t-\t0\tH\t-\t-\t-\t0\t0\t0\t0\t0\t0\t0\t0\t-\t\n";
+
+void ParserUnitTest::setUp() {
+  World::getInstance();
+
+  // we need hydrogens and oxygens in the following tests
+  CPPUNIT_ASSERT(World::getInstance().getPeriode()->FindElement(1) != NULL);
+  CPPUNIT_ASSERT(World::getInstance().getPeriode()->FindElement(8) != NULL);
+}
+
+void ParserUnitTest::tearDown() {
+  ChangeTracker::purgeInstance();
+  World::purgeInstance();
+}
+
+/************************************ tests ***********************************/
+
+void ParserUnitTest::rewriteAnXyzTest() {
+  cout << "Testing the XYZ parser." << endl;
+  XyzParser* testParser = new XyzParser();
+  stringstream input;
+  input << waterXyz;
+  testParser->load(&input);
+
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+
+  string newWaterXyz = "";
+  stringstream output;
+  testParser->save(&output);
+  newWaterXyz = output.str();
+
+  CPPUNIT_ASSERT(waterXyz == newWaterXyz);
+}
+
+void ParserUnitTest::readTremoloPreliminaryCommentsTest() {
+  cout << "Testing the tremolo parser." << endl;
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input, output;
+
+  // Atomdata beginning with "# ATOMDATA"
+  input << Tremolo_Atomdata1;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT(Tremolo_Atomdata1 == output.str());
+  input.clear();
+  output.clear();
+
+  // Atomdata beginning with "#ATOMDATA"
+  input << Tremolo_Atomdata2;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT(output.str().find("hydrogen") != string::npos);
+  input.clear();
+  output.clear();
+
+  // Invalid key in Atomdata line
+  input << Tremolo_invalidkey;
+  testParser->load(&input);
+  //TODO: proove invalidity
+  input.clear();
+}
+
+void ParserUnitTest::readTremoloCoordinatesTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input;
+
+  // One simple data line
+  input << Tremolo_Atomdata2;
+  testParser->load(&input);
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->x[0] == 3.0);
+  input.clear();
+}
+
+void ParserUnitTest::readTremoloVelocityTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input;
+
+  // One simple data line
+  input << Tremolo_velocity;
+  testParser->load(&input);
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->v[0] == 3.0);
+  input.clear();
+}
+
+void ParserUnitTest::readTremoloNeighborInformationTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input;
+
+  // Neighbor data
+  input << Tremolo_neighbours;
+  testParser->load(&input);
+
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(8))->
+      IsBondedTo(World::getInstance().getAtom(AtomByType(1))));
+  input.clear();
+}
+
+void ParserUnitTest::readAndWriteTremoloImprDataInformationTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input, output;
+
+  // Neighbor data
+  input << Tremolo_improper;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+  CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
+  input.clear();
+  output.clear();
+}
+
+void ParserUnitTest::readAndWriteTremoloTorsionInformationTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream input, output;
+
+  // Neighbor data
+  input << Tremolo_torsion;
+  testParser->load(&input);
+  testParser->save(&output);
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+  CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
+  input.clear();
+  output.clear();
+}
+
+void ParserUnitTest::writeTremoloTest() {
+  TremoloParser* testParser = new TremoloParser();
+  stringstream output;
+
+  // with the maximum number of fields and minimal information, default values are printed
+  atom* newAtom = World::getInstance().createAtom();
+  newAtom->type = World::getInstance().getPeriode()->FindElement(1);
+  testParser->setFieldsForSave("x=3 u=3 F stress Id neighbors=5 imprData GroupMeasureTypeNo Type extType name resName chainID resSeq occupancy tempFactor segID Charge charge GrpTypeNo torsion");
+  testParser->save(&output);
+  CPPUNIT_ASSERT(output.str() == Tremolo_full);
+
+  cout << "testing the tremolo parser is done" << endl;
+}
+
+void ParserUnitTest::readwritePcpTest() {
+  stringstream input(waterPcp);
+  PcpParser* testParser = new PcpParser();
+  testParser->load(&input);
+  input.clear();
+
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+
+  string newWaterPcp = "";
+  stringstream output;
+  testParser->save(&output);
+
+  input << output;
+  PcpParser* testParser2 = new PcpParser();
+  testParser2->load(&input);
+
+  CPPUNIT_ASSERT_EQUAL(6, World::getInstance().numAtoms());
+
+  CPPUNIT_ASSERT(*testParser == *testParser2);
+}
+
+void ParserUnitTest::writeMpqcTest() {
+  // build up water molecule
+  atom *Walker = NULL;
+  Walker = World::getInstance().createAtom();
+  Walker->type = World::getInstance().getPeriode()->FindElement(8);
+  Walker->x = Vector(0,0,0);
+  Walker = World::getInstance().createAtom();
+  Walker->type = World::getInstance().getPeriode()->FindElement(1);
+  Walker->x = Vector(0.758602,0,0.504284);
+  Walker = World::getInstance().createAtom();
+  Walker->type = World::getInstance().getPeriode()->FindElement(1);
+  Walker->x = Vector(0.758602,0,-0.504284);
+  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
+
+  // create two stringstreams, one stored, one created
+  stringstream input(waterMpqc);
+  MpqcParser* testParser = new MpqcParser();
+  stringstream output;
+  testParser->save(&output);
+
+  // compare both configs
+  string first = input.str();
+  string second = output.str();
+  CPPUNIT_ASSERT(first == second);
+}
Index: src/unittests/ParserUnitTest.hpp
===================================================================
--- src/unittests/ParserUnitTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
+++ src/unittests/ParserUnitTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -0,0 +1,44 @@
+/*
+ * ParserUnitTest.hpp
+ *
+ *  Created on: Mar 3, 2010
+ *      Author: metzler
+ */
+#ifndef PARSERUNITTEST_HPP_
+#define PARSERUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+
+class ParserUnitTest :  public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( ParserUnitTest ) ;
+  CPPUNIT_TEST ( rewriteAnXyzTest );
+  CPPUNIT_TEST ( readTremoloPreliminaryCommentsTest );
+  CPPUNIT_TEST ( readTremoloCoordinatesTest );
+  CPPUNIT_TEST ( readTremoloVelocityTest );
+  CPPUNIT_TEST ( readTremoloNeighborInformationTest );
+  CPPUNIT_TEST ( readAndWriteTremoloImprDataInformationTest );
+  CPPUNIT_TEST ( readAndWriteTremoloTorsionInformationTest );
+  CPPUNIT_TEST ( writeTremoloTest );
+  CPPUNIT_TEST ( readwritePcpTest );
+  CPPUNIT_TEST ( writeMpqcTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void rewriteAnXyzTest();
+  void readTremoloPreliminaryCommentsTest();
+  void readTremoloCoordinatesTest();
+  void readTremoloVelocityTest();
+  void readTremoloNeighborInformationTest();
+  void readAndWriteTremoloImprDataInformationTest();
+  void readAndWriteTremoloTorsionInformationTest();
+  void writeTremoloTest();
+  void readwritePcpTest();
+  void writeMpqcTest();
+};
+
+#endif /* PARSERUNITTEST_HPP_ */
Index: src/unittests/SingletonTest.cpp
===================================================================
--- src/unittests/SingletonTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/SingletonTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -52,5 +52,5 @@
     count1++;
   }
-  // explicit copy constructor to catch if thsi is ever called
+  // explicit copy constructor to catch if this is ever called
   SingletonStub2(const SingletonStub2&){
     CPPUNIT_FAIL    ( "Copy constructor of Singleton called" );
Index: src/unittests/TestRunnerMain.cpp
===================================================================
--- src/unittests/TestRunnerMain.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/TestRunnerMain.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -14,5 +14,4 @@
 // give the main function its correct name
 #define CPPUNIT_MAIN main
-
 // include the TestRunnerClient file containing the main class
 #include "../../../TestRunnerClient.h"
Index: src/unittests/analysisbondsunittest.cpp
===================================================================
--- src/unittests/analysisbondsunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/analysisbondsunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -25,4 +25,5 @@
 #include "molecule.hpp"
 #include "periodentafel.hpp"
+#include "World.hpp"
 
 #ifdef HAVE_TESTRUNNER
@@ -40,48 +41,35 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->Valence = 1;
-  hydrogen->NoValenceOrbitals = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  carbon = new element;
-  carbon->Z = 2;
-  carbon->Valence = 4;
-  carbon->NoValenceOrbitals = 4;
-  strcpy(carbon->name, "carbon");
-  strcpy(carbon->symbol, "C");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(carbon);
+  // get elements
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  carbon = World::getInstance().getPeriode()->FindElement(6);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
+  CPPUNIT_ASSERT(carbon != NULL && "could not find element carbon");
 
   // construct molecule (tetraeder of hydrogens)
   TestMolecule = World::getInstance().createMolecule();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1.5, 0., 1.5 );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 1.5, 1.5 );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1.5, 1.5, 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(0.5, 0.5, 0.5 );
@@ -89,19 +77,25 @@
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 5 );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 5 );
 
   // create a small file with table
   filename = new string("test.dat");
+  CPPUNIT_ASSERT(filename != NULL && "could not create string");
   ofstream test(filename->c_str());
-  test << ".\tH\tC\n";
-  test << "H\t1.\t1.2\n";
-  test << "C\t1.2\t1.5\n";
+  test << ".\tH\tHe\tLi\tBe\tB\tC\n";
+  test << "H\t1.\t1.\t1.\t1.\t1.\t1.2\n";
+  test << "He\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Li\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Be\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "B\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "C\t1.2\t1.\t1.\t1.\t1.\t1.5\n";
   test.close();
   BG = new BondGraph(true);
+  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
 
   CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
   CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
-  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
-  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
+  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
+  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
 
   BG->ConstructBondGraph(TestMolecule);
Index: src/unittests/analysisbondsunittest.hpp
===================================================================
--- src/unittests/analysisbondsunittest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/analysisbondsunittest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -34,7 +34,6 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      element *carbon;
-      periodentafel *tafel;
+      const element *hydrogen;
+      const element *carbon;
 
       BondGraph *BG;
Index: src/unittests/bondgraphunittest.cpp
===================================================================
--- src/unittests/bondgraphunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/bondgraphunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -15,4 +15,6 @@
 #include <stdio.h>
 #include <cstring>
+
+#include "Helpers/Assert.hpp"
 
 #include "World.hpp"
@@ -41,32 +43,15 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->CovalentRadius = 0.23;
-  hydrogen->VanDerWaalsRadius = 1.09;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  carbon = new element;
-  carbon->Z = 2;
-  carbon->CovalentRadius = 0.68;
-  carbon->VanDerWaalsRadius = 1.7;
-  strcpy(carbon->name, "carbon");
-  strcpy(carbon->symbol, "C");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(carbon);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  carbon = World::getInstance().getPeriode()->FindElement(6);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
+  CPPUNIT_ASSERT(carbon != NULL && "could not find element carbon");
 
   // construct molecule (tetraeder of hydrogens)
   TestMolecule = World::getInstance().createMolecule();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(1., 0., 1. );
@@ -74,4 +59,5 @@
 
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(0., 1., 1. );
@@ -79,4 +65,5 @@
 
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(1., 1., 0. );
@@ -84,4 +71,5 @@
 
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(0., 0., 0. );
@@ -89,15 +77,22 @@
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
 
   // create a small file with table
   dummyname = new string("dummy.dat");
+  CPPUNIT_ASSERT(dummyname != NULL && "could not create string");
   filename = new string("test.dat");
+  CPPUNIT_ASSERT(filename != NULL && "could not create string");
   ofstream test(filename->c_str());
-  test << ".\tH\tC\n";
-  test << "H\t1.\t1.2\n";
-  test << "C\t1.2\t1.5\n";
+  test << ".\tH\tHe\tLi\tBe\tB\tC\n";
+  test << "H\t1.\t1.\t1.\t1.\t1.\t1.2\n";
+  test << "He\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Li\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Be\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "B\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "C\t1.2\t1.\t1.\t1.\t1.\t1.5\n";
   test.close();
   BG = new BondGraph(true);
+  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
 };
 
@@ -116,6 +111,13 @@
   // are all cleaned when the world is destroyed
   World::purgeInstance();
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
+};
+
+/** Tests whether setup worked.
+ */
+void BondGraphTest::SetupTest()
+{
+  CPPUNIT_ASSERT_EQUAL (false, TestMolecule->empty());
+  CPPUNIT_ASSERT_EQUAL ((size_t)4, TestMolecule->size());
 };
 
@@ -126,6 +128,6 @@
   CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
   CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
-  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
-  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
+  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
+  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
 };
 
@@ -134,10 +136,10 @@
 void BondGraphTest::ConstructGraphFromTableTest()
 {
-  atom *Walker = TestMolecule->start->next;
-  atom *Runner = TestMolecule->end->previous;
-  CPPUNIT_ASSERT( TestMolecule->end != Walker );
+  molecule::iterator Walker = TestMolecule->begin();
+  molecule::iterator Runner = TestMolecule->begin();
+  Runner++;
   CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
   CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) );
-  CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
+  CPPUNIT_ASSERT_EQUAL( true , (*Walker)->IsBondedTo((*Runner)) );
 };
 
@@ -146,10 +148,13 @@
 void BondGraphTest::ConstructGraphFromCovalentRadiiTest()
 {
-  atom *Walker = TestMolecule->start->next;
-  atom *Runner = TestMolecule->end->previous;
-  CPPUNIT_ASSERT( TestMolecule->end != Walker );
+
+  //atom *Walker = TestMolecule->start->next;
+  //atom *Runner = TestMolecule->end->previous;
+  //CPPUNIT_ASSERT( TestMolecule->end != Walker );
   CPPUNIT_ASSERT_EQUAL( false , BG->LoadBondLengthTable(*dummyname) );
   CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) );
-  CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
+
+  // this cannot be assured using dynamic IDs
+  //CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
 };
 
Index: src/unittests/bondgraphunittest.hpp
===================================================================
--- src/unittests/bondgraphunittest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/bondgraphunittest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -22,4 +22,5 @@
 {
     CPPUNIT_TEST_SUITE( BondGraphTest) ;
+    CPPUNIT_TEST ( SetupTest );
     CPPUNIT_TEST ( LoadTableTest );
     CPPUNIT_TEST ( ConstructGraphFromTableTest );
@@ -30,4 +31,5 @@
       void setUp();
       void tearDown();
+      void SetupTest();
       void LoadTableTest();
       void ConstructGraphFromTableTest();
@@ -37,7 +39,6 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      element *carbon;
-      periodentafel *tafel;
+      const element *hydrogen;
+      const element *carbon;
 
       BondGraph *BG;
Index: src/unittests/listofbondsunittest.cpp
===================================================================
--- src/unittests/listofbondsunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/listofbondsunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -38,35 +38,28 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
 
   // construct molecule (tetraeder of hydrogens)
   TestMolecule = World::getInstance().createMolecule();
-  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
+  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 0., 0. );
@@ -74,6 +67,5 @@
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
-
+  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
 };
 
@@ -86,8 +78,16 @@
   // are all cleaned when the world is destroyed
   World::purgeInstance();
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
 };
 
+/** Tests whether setup worked correctly.
+ *
+ */
+void ListOfBondsTest::SetupTest()
+{
+  CPPUNIT_ASSERT_EQUAL( false, TestMolecule->empty() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)4, TestMolecule->size() );
+};
+
 /** Unit Test of molecule::AddBond()
  *
@@ -96,14 +96,15 @@
 {
   bond *Binder = NULL;
-  atom *atom1 = TestMolecule->start->next;
-  atom *atom2 = atom1->next;
-  CPPUNIT_ASSERT( atom1 != NULL );
-  CPPUNIT_ASSERT( atom2 != NULL );
-
-  // add bond
-  Binder = TestMolecule->AddBond(atom1, atom2, 1);
-  CPPUNIT_ASSERT( Binder != NULL );
-  bond *TestBond = TestMolecule->first->next;
-  CPPUNIT_ASSERT_EQUAL ( TestBond, Binder );
+  molecule::iterator iter = TestMolecule->begin();
+  atom *atom1 = *iter;
+  iter++;
+  atom *atom2 = *iter;
+  CPPUNIT_ASSERT( atom1 != NULL );
+  CPPUNIT_ASSERT( atom2 != NULL );
+
+  // add bond
+  Binder = TestMolecule->AddBond(atom1, atom2, 1);
+  CPPUNIT_ASSERT( Binder != NULL );
+  CPPUNIT_ASSERT_EQUAL ( true, TestMolecule->hasBondStructure() );
 
   // check that bond contains the two atoms
@@ -124,6 +125,8 @@
 {
   bond *Binder = NULL;
-  atom *atom1 = TestMolecule->start->next;
-  atom *atom2 = atom1->next;
+  molecule::iterator iter = TestMolecule->begin();
+  atom *atom1 = *iter;
+  iter++;
+  atom *atom2 = *iter;
   CPPUNIT_ASSERT( atom1 != NULL );
   CPPUNIT_ASSERT( atom2 != NULL );
@@ -141,5 +144,5 @@
 
   // check if removed from molecule
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->first->next, TestMolecule->last );
+  CPPUNIT_ASSERT_EQUAL( false, TestMolecule->hasBondStructure() );
 };
 
@@ -150,7 +153,10 @@
 {
   bond *Binder = NULL;
-  atom *atom1 = TestMolecule->start->next;
-  atom *atom2 = atom1->next;
-  atom *atom3 = atom2->next;
+  molecule::iterator iter = TestMolecule->begin();
+  atom *atom1 = *iter;
+  iter++;
+  atom *atom2 = *iter;
+  iter++;
+  atom *atom3 = *iter;
   CPPUNIT_ASSERT( atom1 != NULL );
   CPPUNIT_ASSERT( atom2 != NULL );
@@ -179,6 +185,6 @@
 
   // check if removed from molecule
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->first->next, Binder );
-  CPPUNIT_ASSERT_EQUAL( Binder->next, TestMolecule->last );
+  CPPUNIT_ASSERT_EQUAL( true, TestMolecule->hasBondStructure() );
+  CPPUNIT_ASSERT_EQUAL( (unsigned int)1, TestMolecule->CountBonds() );
 };
 
@@ -189,6 +195,8 @@
 {
   bond *Binder = NULL;
-  atom *atom1 = TestMolecule->start->next;
-  atom *atom2 = atom1->next;
+  molecule::iterator iter = TestMolecule->begin();
+  atom *atom1 = *iter;
+  iter++;
+  atom *atom2 = *iter;
   CPPUNIT_ASSERT( atom1 != NULL );
   CPPUNIT_ASSERT( atom2 != NULL );
@@ -206,5 +214,5 @@
 
   // check if removed from molecule
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->first->next, TestMolecule->last );
+  CPPUNIT_ASSERT_EQUAL( false, TestMolecule->hasBondStructure() );
 };
 
@@ -215,6 +223,8 @@
 {
   bond *Binder = NULL;
-  atom *atom1 = TestMolecule->start->next;
-  atom *atom2 = atom1->next;
+  molecule::iterator iter = TestMolecule->begin();
+  atom *atom1 = *iter;
+  iter++;
+  atom *atom2 = *iter;
   CPPUNIT_ASSERT( atom1 != NULL );
   CPPUNIT_ASSERT( atom2 != NULL );
@@ -231,5 +241,5 @@
 
   // check if removed from molecule
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->first->next, TestMolecule->last );
+  CPPUNIT_ASSERT_EQUAL( false, TestMolecule->hasBondStructure() );
 };
 
@@ -239,13 +249,24 @@
 void ListOfBondsTest::DeleteAtomTest()
 {
-  bond *Binder = NULL;
-  atom *atom1 = TestMolecule->start->next;
-  atom *atom2 = atom1->next;
-  CPPUNIT_ASSERT( atom1 != NULL );
-  CPPUNIT_ASSERT( atom2 != NULL );
-
-  // add bond
-  Binder = TestMolecule->AddBond(atom1, atom2, 1);
-  CPPUNIT_ASSERT( Binder != NULL );
+  atom *atom1 = NULL;
+  atom *atom2 = NULL;
+  bond *Binder = NULL;
+  {
+    molecule::iterator iter = TestMolecule->begin();
+    atom1 = *iter;
+    iter++;
+    atom2 = *iter;
+  }
+  CPPUNIT_ASSERT( atom1 != NULL );
+  CPPUNIT_ASSERT( atom2 != NULL );
+
+  // add bond
+  Binder = TestMolecule->AddBond(atom1, atom2, 1);
+  CPPUNIT_ASSERT( Binder != NULL );
+
+  CPPUNIT_ASSERT_EQUAL( (size_t) 1, atom1->ListOfBonds.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t) 1, atom2->ListOfBonds.size() );
+
+  CPPUNIT_ASSERT_EQUAL( true, TestMolecule->hasBondStructure() );
 
   // remove atom2
@@ -256,4 +277,4 @@
 
   // check if removed from molecule
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->first->next, TestMolecule->last );
-};
+  CPPUNIT_ASSERT_EQUAL( false, TestMolecule->hasBondStructure() );
+};
Index: src/unittests/listofbondsunittest.hpp
===================================================================
--- src/unittests/listofbondsunittest.hpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/listofbondsunittest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -20,4 +20,5 @@
 {
     CPPUNIT_TEST_SUITE( ListOfBondsTest) ;
+    CPPUNIT_TEST ( SetupTest );
     CPPUNIT_TEST ( AddingBondTest );
     CPPUNIT_TEST ( RemovingBondTest );
@@ -31,4 +32,5 @@
       void setUp();
       void tearDown();
+      void SetupTest();
       void AddingBondTest();
       void RemovingBondTest();
@@ -41,6 +43,5 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      periodentafel *tafel;
+      const element *hydrogen;
 };
 
Index: src/unittests/manipulateAtomsTest.cpp
===================================================================
--- src/unittests/manipulateAtomsTest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/manipulateAtomsTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -55,4 +55,5 @@
 public:
   countObserver() :
+    Observer("countObserver"),
     count(0)
     {}
@@ -86,5 +87,5 @@
 static void operation(atom* _atom){
   AtomStub *atom = dynamic_cast<AtomStub*>(_atom);
-  assert(atom);
+  CPPUNIT_ASSERT(atom);
   atom->doSomething();
 }
@@ -99,5 +100,5 @@
     AtomStub *atom;
     atom = dynamic_cast<AtomStub*>(*iter);
-    assert(atom);
+    CPPUNIT_ASSERT(atom);
     CPPUNIT_ASSERT(atom->manipulated);
   }
@@ -113,5 +114,5 @@
     AtomStub *atom;
     atom = dynamic_cast<AtomStub*>(*iter);
-    assert(atom);
+    CPPUNIT_ASSERT(atom);
     if(atom->getId()!=(int)ATOM_COUNT/2)
       CPPUNIT_ASSERT(atom->manipulated);
Index: src/unittests/memoryallocatorunittest.cpp
===================================================================
--- src/unittests/memoryallocatorunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/memoryallocatorunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -12,4 +12,5 @@
 #include "memoryallocator.hpp"
 #include "memoryallocatorunittest.hpp"
+#include "memoryusageobserver.hpp"
 #include "helpers.hpp"
 #include "log.hpp"
Index: src/unittests/periodentafelTest.cpp
===================================================================
--- src/unittests/periodentafelTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
+++ src/unittests/periodentafelTest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -0,0 +1,78 @@
+/*
+ * periodentafelTest.cpp
+ *
+ *  Created on: May 18, 2010
+ *      Author: heber
+ */
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "Helpers/Assert.hpp"
+
+#include "World.hpp"
+#include "periodentafelTest.hpp"
+#include "element.hpp"
+#include "elements_db.hpp"
+#include "periodentafel.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( periodentafelTest );
+
+
+void periodentafelTest::setUp()
+{
+  // make sure world is present
+  tafel = World::getInstance().getPeriode();
+  CPPUNIT_ASSERT(tafel != NULL && "could not obtain periodentafel");
+};
+
+
+void periodentafelTest::tearDown()
+{
+  World::purgeInstance();
+};
+
+/** UnitTest for AddRemoveTest().
+ */
+void periodentafelTest::AddRemoveTest()
+{
+  // copy the element
+  const element * ElementPtr = tafel->FindElement(3);
+  CPPUNIT_ASSERT( ElementPtr != NULL && "could not find element lithium");
+  element *Elemental = new element(*ElementPtr);
+  // remove element
+  tafel->RemoveElement((element * const)ElementPtr);
+  ElementPtr = tafel->FindElement(3);
+  CPPUNIT_ASSERT_EQUAL( (const element *)NULL, ElementPtr );
+  // add element again
+  tafel->AddElement((element * const)Elemental);
+  ElementPtr = tafel->FindElement(3);
+  CPPUNIT_ASSERT( ElementPtr != NULL && "could not find re-added element lithium");
+};
+
+/** UnitTest for LoadStoreTest().
+ * TODO: periodentafelTest::LoadStoreTest() not implemented yet
+ */
+void periodentafelTest::LoadStoreTest()
+{
+  // reload all databases
+  CPPUNIT_ASSERT(tafel->LoadElementsDatabase(new stringstream(elementsDB,ios_base::in)) && "General element initialization failed");
+  CPPUNIT_ASSERT(tafel->LoadValenceDatabase(new stringstream(valenceDB,ios_base::in)) && "Valence entry of element initialization failed");
+  CPPUNIT_ASSERT(tafel->LoadOrbitalsDatabase(new stringstream(orbitalsDB,ios_base::in)) && "Orbitals entry of element initialization failed");
+  CPPUNIT_ASSERT(tafel->LoadHBondAngleDatabase(new stringstream(HbondangleDB,ios_base::in)) && "HBond angle entry of element initialization failed");
+  CPPUNIT_ASSERT(tafel->LoadHBondLengthsDatabase(new stringstream(HbonddistanceDB,ios_base::in)) && "HBond distance entry of element initialization failed");
+  // check presence of elements
+  atomicNumber_t Z = 1;
+  for(periodentafel::const_iterator ElementRunner = tafel->begin(); ElementRunner != tafel->end(); ++ElementRunner)
+    CPPUNIT_ASSERT( (ElementRunner->second->getNumber() == Z++) && "element is missing in sequence");
+};
Index: src/unittests/periodentafelTest.hpp
===================================================================
--- src/unittests/periodentafelTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
+++ src/unittests/periodentafelTest.hpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -0,0 +1,39 @@
+/*
+ * periodentafelTest.hpp
+ *
+ *  Created on: May 18, 2010
+ *      Author: heber
+ */
+
+#ifndef ANALYSISBONDSUNITTEST_HPP_
+#define ANALYSISBONDSUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class element;
+class periodentafel;
+
+/********************************************** Test classes **************************************/
+
+class periodentafelTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( periodentafelTest) ;
+    CPPUNIT_TEST ( AddRemoveTest );
+    CPPUNIT_TEST ( LoadStoreTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void AddRemoveTest();
+      void LoadStoreTest();
+
+private:
+
+      element *hydrogen;
+      element *carbon;
+      periodentafel *tafel;
+
+};
+
+#endif /* ANALYSISBONDSUNITTEST_HPP_ */
Index: src/unittests/stackclassunittest.cpp
===================================================================
--- src/unittests/stackclassunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/stackclassunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -37,5 +37,4 @@
   Stack->ClearStack();
   delete(Stack);
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
 };
Index: src/unittests/tesselation_boundarytriangleunittest.cpp
===================================================================
--- src/unittests/tesselation_boundarytriangleunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/tesselation_boundarytriangleunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -70,5 +70,4 @@
     delete tesselpoints[i];
   }
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
   errorLogger::purgeInstance();
Index: src/unittests/tesselation_insideoutsideunittest.cpp
===================================================================
--- src/unittests/tesselation_insideoutsideunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/tesselation_insideoutsideunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -134,5 +134,4 @@
   }
   Corners.clear();
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
   errorLogger::purgeInstance();
Index: src/unittests/tesselationunittest.cpp
===================================================================
--- src/unittests/tesselationunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/tesselationunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -106,5 +106,4 @@
   }
   Corners.clear();
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
   errorLogger::purgeInstance();
Index: src/unittests/vectorunittest.cpp
===================================================================
--- src/unittests/vectorunittest.cpp	(revision c39cc4a287829a1c0da6147754970a5045cfb269)
+++ src/unittests/vectorunittest.cpp	(revision bdb143247eccc7c91b16ff0f4b58e8e1946856d2)
@@ -49,5 +49,4 @@
 void VectorTest::tearDown()
 {
-  MemoryUsageObserver::purgeInstance();
   logger::purgeInstance();
   errorLogger::purgeInstance();
