Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/analysisbondsunittest.cpp

    rcbc5fb read4e6  
    2626#include "periodentafel.hpp"
    2727
     28#ifdef HAVE_TESTRUNNER
     29#include "UnitTestMain.hpp"
     30#endif /*HAVE_TESTRUNNER*/
     31
    2832/********************************************** Test classes **************************************/
    2933
     
    4953  strcpy(hydrogen->symbol, "H");
    5054  carbon = new element;
    51   carbon->Z = 1;
     55  carbon->Z = 2;
    5256  carbon->Valence = 4;
    5357  carbon->NoValenceOrbitals = 4;
     
    5761
    5862  // construct periodentafel
    59   tafel = World::get()->getPeriode();
     63  tafel = World::getInstance().getPeriode();
    6064  tafel->AddElement(hydrogen);
    6165  tafel->AddElement(carbon);
    6266
    6367  // construct molecule (tetraeder of hydrogens)
    64   TestMolecule = World::get()->createMolecule();
    65   Walker = World::get()->createAtom();
     68  TestMolecule = World::getInstance().createMolecule();
     69  Walker = World::getInstance().createAtom();
    6670  Walker->type = hydrogen;
    6771  Walker->node->Init(1.5, 0., 1.5 );
    6872  TestMolecule->AddAtom(Walker);
    69   Walker = World::get()->createAtom();
     73  Walker = World::getInstance().createAtom();
    7074  Walker->type = hydrogen;
    7175  Walker->node->Init(0., 1.5, 1.5 );
    7276  TestMolecule->AddAtom(Walker);
    73   Walker = World::get()->createAtom();
     77  Walker = World::getInstance().createAtom();
    7478  Walker->type = hydrogen;
    7579  Walker->node->Init(1.5, 1.5, 0. );
    7680  TestMolecule->AddAtom(Walker);
    77   Walker = World::get()->createAtom();
     81  Walker = World::getInstance().createAtom();
    7882  Walker->type = hydrogen;
    7983  Walker->node->Init(0., 0., 0. );
    8084  TestMolecule->AddAtom(Walker);
    81   Walker = World::get()->createAtom();
     85  Walker = World::getInstance().createAtom();
    8286  Walker->type = carbon;
    8387  Walker->node->Init(0.5, 0.5, 0.5 );
     
    113117
    114118  // remove molecule
    115   World::get()->destroyMolecule(TestMolecule);
     119  World::getInstance().destroyMolecule(TestMolecule);
    116120  // note that all the atoms are cleaned by TestMolecule
    117   World::destroy();
     121  World::purgeInstance();
    118122};
    119123
     
    163167  CPPUNIT_ASSERT_EQUAL( 0. , Max );
    164168};
    165 
    166 
    167 /********************************************** Main routine **************************************/
    168 
    169 int 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.