Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/analysisbondsunittest.cpp

    read4e6 rcbc5fb  
    2626#include "periodentafel.hpp"
    2727
    28 #ifdef HAVE_TESTRUNNER
    29 #include "UnitTestMain.hpp"
    30 #endif /*HAVE_TESTRUNNER*/
    31 
    3228/********************************************** Test classes **************************************/
    3329
     
    5349  strcpy(hydrogen->symbol, "H");
    5450  carbon = new element;
    55   carbon->Z = 2;
     51  carbon->Z = 1;
    5652  carbon->Valence = 4;
    5753  carbon->NoValenceOrbitals = 4;
     
    6157
    6258  // construct periodentafel
    63   tafel = World::getInstance().getPeriode();
     59  tafel = World::get()->getPeriode();
    6460  tafel->AddElement(hydrogen);
    6561  tafel->AddElement(carbon);
    6662
    6763  // construct molecule (tetraeder of hydrogens)
    68   TestMolecule = World::getInstance().createMolecule();
    69   Walker = World::getInstance().createAtom();
     64  TestMolecule = World::get()->createMolecule();
     65  Walker = World::get()->createAtom();
    7066  Walker->type = hydrogen;
    7167  Walker->node->Init(1.5, 0., 1.5 );
    7268  TestMolecule->AddAtom(Walker);
    73   Walker = World::getInstance().createAtom();
     69  Walker = World::get()->createAtom();
    7470  Walker->type = hydrogen;
    7571  Walker->node->Init(0., 1.5, 1.5 );
    7672  TestMolecule->AddAtom(Walker);
    77   Walker = World::getInstance().createAtom();
     73  Walker = World::get()->createAtom();
    7874  Walker->type = hydrogen;
    7975  Walker->node->Init(1.5, 1.5, 0. );
    8076  TestMolecule->AddAtom(Walker);
    81   Walker = World::getInstance().createAtom();
     77  Walker = World::get()->createAtom();
    8278  Walker->type = hydrogen;
    8379  Walker->node->Init(0., 0., 0. );
    8480  TestMolecule->AddAtom(Walker);
    85   Walker = World::getInstance().createAtom();
     81  Walker = World::get()->createAtom();
    8682  Walker->type = carbon;
    8783  Walker->node->Init(0.5, 0.5, 0.5 );
     
    117113
    118114  // remove molecule
    119   World::getInstance().destroyMolecule(TestMolecule);
     115  World::get()->destroyMolecule(TestMolecule);
    120116  // note that all the atoms are cleaned by TestMolecule
    121   World::purgeInstance();
     117  World::destroy();
    122118};
    123119
     
    167163  CPPUNIT_ASSERT_EQUAL( 0. , Max );
    168164};
     165
     166
     167/********************************************** Main routine **************************************/
     168
     169int main(int argc, char **argv)
     170{
     171  // Get the top level suite from the registry
     172  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
     173
     174  // Adds the test to the list of test to run
     175  CppUnit::TextUi::TestRunner runner;
     176  runner.addTest( suite );
     177
     178  // Change the default outputter to a compiler error format outputter
     179  runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
     180                                                       std::cerr ) );
     181  // Run the tests.
     182  bool wasSucessful = runner.run();
     183
     184  // Return error code 1 if the one of test failed.
     185  return wasSucessful ? 0 : 1;
     186};
Note: See TracChangeset for help on using the changeset viewer.