Changeset d50264 for molecuilder/src/unittests/analysisbondsunittest.cpp
- Timestamp:
- Feb 26, 2010, 2:01:57 PM (16 years ago)
- Children:
- db6b872
- Parents:
- f467c6 (diff), dc5413 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/unittests/analysisbondsunittest.cpp
rf467c6 rd50264 25 25 #include "molecule.hpp" 26 26 #include "periodentafel.hpp" 27 28 #ifdef HAVE_TESTRUNNER 29 #include "UnitTestMain.hpp" 30 #endif /*HAVE_TESTRUNNER*/ 27 31 28 32 /********************************************** Test classes **************************************/ … … 57 61 58 62 // construct periodentafel 59 tafel = new periodentafel;63 tafel = World::get()->getPeriode(); 60 64 tafel->AddElement(hydrogen); 61 65 tafel->AddElement(carbon); 62 66 63 67 // construct molecule (tetraeder of hydrogens) 64 TestMolecule = new molecule(tafel);68 TestMolecule = World::get()->createMolecule(); 65 69 Walker = World::get()->createAtom(); 66 70 Walker->type = hydrogen; … … 113 117 114 118 // remove molecule 115 delete(TestMolecule);119 World::get()->destroyMolecule(TestMolecule); 116 120 // note that all the atoms are cleaned by TestMolecule 117 delete(tafel); 118 // note that element is cleaned by periodentafel 121 World::destroy(); 119 122 }; 120 123 … … 164 167 CPPUNIT_ASSERT_EQUAL( 0. , Max ); 165 168 }; 166 167 168 /********************************************** Main routine **************************************/169 170 int main(int argc, char **argv)171 {172 // Get the top level suite from the registry173 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();174 175 // Adds the test to the list of test to run176 CppUnit::TextUi::TestRunner runner;177 runner.addTest( suite );178 179 // Change the default outputter to a compiler error format outputter180 runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),181 std::cerr ) );182 // Run the tests.183 bool wasSucessful = runner.run();184 185 // Return error code 1 if the one of test failed.186 return wasSucessful ? 0 : 1;187 };
Note:
See TracChangeset
for help on using the changeset viewer.