- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/analysisbondsunittest.cpp
rcbc5fb read4e6 26 26 #include "periodentafel.hpp" 27 27 28 #ifdef HAVE_TESTRUNNER 29 #include "UnitTestMain.hpp" 30 #endif /*HAVE_TESTRUNNER*/ 31 28 32 /********************************************** Test classes **************************************/ 29 33 … … 49 53 strcpy(hydrogen->symbol, "H"); 50 54 carbon = new element; 51 carbon->Z = 1;55 carbon->Z = 2; 52 56 carbon->Valence = 4; 53 57 carbon->NoValenceOrbitals = 4; … … 57 61 58 62 // construct periodentafel 59 tafel = World::get ()->getPeriode();63 tafel = World::getInstance().getPeriode(); 60 64 tafel->AddElement(hydrogen); 61 65 tafel->AddElement(carbon); 62 66 63 67 // 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(); 66 70 Walker->type = hydrogen; 67 71 Walker->node->Init(1.5, 0., 1.5 ); 68 72 TestMolecule->AddAtom(Walker); 69 Walker = World::get ()->createAtom();73 Walker = World::getInstance().createAtom(); 70 74 Walker->type = hydrogen; 71 75 Walker->node->Init(0., 1.5, 1.5 ); 72 76 TestMolecule->AddAtom(Walker); 73 Walker = World::get ()->createAtom();77 Walker = World::getInstance().createAtom(); 74 78 Walker->type = hydrogen; 75 79 Walker->node->Init(1.5, 1.5, 0. ); 76 80 TestMolecule->AddAtom(Walker); 77 Walker = World::get ()->createAtom();81 Walker = World::getInstance().createAtom(); 78 82 Walker->type = hydrogen; 79 83 Walker->node->Init(0., 0., 0. ); 80 84 TestMolecule->AddAtom(Walker); 81 Walker = World::get ()->createAtom();85 Walker = World::getInstance().createAtom(); 82 86 Walker->type = carbon; 83 87 Walker->node->Init(0.5, 0.5, 0.5 ); … … 113 117 114 118 // remove molecule 115 World::get ()->destroyMolecule(TestMolecule);119 World::getInstance().destroyMolecule(TestMolecule); 116 120 // note that all the atoms are cleaned by TestMolecule 117 World:: destroy();121 World::purgeInstance(); 118 122 }; 119 123 … … 163 167 CPPUNIT_ASSERT_EQUAL( 0. , Max ); 164 168 }; 165 166 167 /********************************************** Main routine **************************************/168 169 int main(int argc, char **argv)170 {171 // Get the top level suite from the registry172 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();173 174 // Adds the test to the list of test to run175 CppUnit::TextUi::TestRunner runner;176 runner.addTest( suite );177 178 // Change the default outputter to a compiler error format outputter179 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.