- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/analysisbondsunittest.cpp
read4e6 rcbc5fb 26 26 #include "periodentafel.hpp" 27 27 28 #ifdef HAVE_TESTRUNNER29 #include "UnitTestMain.hpp"30 #endif /*HAVE_TESTRUNNER*/31 32 28 /********************************************** Test classes **************************************/ 33 29 … … 53 49 strcpy(hydrogen->symbol, "H"); 54 50 carbon = new element; 55 carbon->Z = 2;51 carbon->Z = 1; 56 52 carbon->Valence = 4; 57 53 carbon->NoValenceOrbitals = 4; … … 61 57 62 58 // construct periodentafel 63 tafel = World::get Instance().getPeriode();59 tafel = World::get()->getPeriode(); 64 60 tafel->AddElement(hydrogen); 65 61 tafel->AddElement(carbon); 66 62 67 63 // construct molecule (tetraeder of hydrogens) 68 TestMolecule = World::get Instance().createMolecule();69 Walker = World::get Instance().createAtom();64 TestMolecule = World::get()->createMolecule(); 65 Walker = World::get()->createAtom(); 70 66 Walker->type = hydrogen; 71 67 Walker->node->Init(1.5, 0., 1.5 ); 72 68 TestMolecule->AddAtom(Walker); 73 Walker = World::get Instance().createAtom();69 Walker = World::get()->createAtom(); 74 70 Walker->type = hydrogen; 75 71 Walker->node->Init(0., 1.5, 1.5 ); 76 72 TestMolecule->AddAtom(Walker); 77 Walker = World::get Instance().createAtom();73 Walker = World::get()->createAtom(); 78 74 Walker->type = hydrogen; 79 75 Walker->node->Init(1.5, 1.5, 0. ); 80 76 TestMolecule->AddAtom(Walker); 81 Walker = World::get Instance().createAtom();77 Walker = World::get()->createAtom(); 82 78 Walker->type = hydrogen; 83 79 Walker->node->Init(0., 0., 0. ); 84 80 TestMolecule->AddAtom(Walker); 85 Walker = World::get Instance().createAtom();81 Walker = World::get()->createAtom(); 86 82 Walker->type = carbon; 87 83 Walker->node->Init(0.5, 0.5, 0.5 ); … … 117 113 118 114 // remove molecule 119 World::get Instance().destroyMolecule(TestMolecule);115 World::get()->destroyMolecule(TestMolecule); 120 116 // note that all the atoms are cleaned by TestMolecule 121 World:: purgeInstance();117 World::destroy(); 122 118 }; 123 119 … … 167 163 CPPUNIT_ASSERT_EQUAL( 0. , Max ); 168 164 }; 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.