Ignore:
Timestamp:
May 18, 2010, 3:20:52 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
108d38
Parents:
7a6fd9
Message:

"-e <db path>" not necessary anymore.

Removed necessity of specifying path to databases (this was one check of molecuilder/test/testsuite.at which cannot be fulfilled anymore with boost::program_options)
For this to work a great number of small changes have been necessary:

class periodentafel:

  • all .db files merged into const char * arrays in elements_db.cpp
  • periodentafel rewritten:
  • FindElement(), AskElement() and EnterElement return element * const instead of const element * (i.e. the contents of the pointer is const (the element) not the pointer itself which is very vexatious (i.e. FindElement() yields const element * which can subsequently not be used for RemoveElement(), ...)
  • parsedElems is not needed anymore. Instead we operate on map elements directly
  • new unittest periodentafelTest which is made friend of periodentafel to be able to access private loading functions directly

A number of unit tests had to be changed (all that create elements during setUp() which is now unnecessary)

Some of the analysis_bonds function's signatures were changed in the process:

Finally, the respective tests are removed from molecuilder/tests/testsuite.at.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r7a6fd9 r06f141  
    1717#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
    1818
    19 #include "World.hpp"
    2019#include "atom.hpp"
    2120#include "boundary.hpp"
     
    4746  TestList = NULL;
    4847  TestSurfaceMolecule = NULL;
    49   hydrogen = NULL;
    50   tafel = NULL;
    5148  surfacemap = NULL;
    5249  binmap = NULL;
     
    5451  LC = NULL;
    5552
    56   // construct element
    57   hydrogen = new element;
    58   hydrogen->Z = 1;
    59   strcpy(hydrogen->name, "hydrogen");
    60   strcpy(hydrogen->symbol, "H");
    61   carbon = new element;
    62   carbon->Z = 6;
    63   strcpy(carbon->name, "carbon");
    64   strcpy(carbon->symbol, "C");
    65 
    66   // construct periodentafel
    67   tafel = World::getInstance().getPeriode();
    68   tafel->AddElement(hydrogen);
    69   tafel->AddElement(carbon);
    70 
    7153  // construct molecule (tetraeder of hydrogens) base
     54  hydrogen = World::getInstance().getPeriode()->FindElement(1);
    7255  TestSurfaceMolecule = World::getInstance().createMolecule();
    7356  Walker = World::getInstance().createAtom();
     
    10285
    10386  // add outer atoms
     87  carbon = World::getInstance().getPeriode()->FindElement(6);
    10488  TestSurfaceMolecule = World::getInstance().createMolecule();
    10589  Walker = World::getInstance().createAtom();
Note: See TracChangeset for help on using the changeset viewer.