- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/listofbondsunittest.cpp
r1bd79e r920c70 38 38 atom *Walker = NULL; 39 39 40 // init private all pointers to zero41 TestMolecule = NULL;42 hydrogen = NULL;43 tafel = NULL;44 45 40 // construct element 46 hydrogen = new element; 47 hydrogen->Z = 1; 48 strcpy(hydrogen->name, "hydrogen"); 49 strcpy(hydrogen->symbol, "H"); 50 51 52 // construct periodentafel 53 tafel = World::getInstance().getPeriode(); 54 tafel->AddElement(hydrogen); 41 hydrogen = World::getInstance().getPeriode()->FindElement(1); 42 CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen"); 55 43 56 44 // construct molecule (tetraeder of hydrogens) 57 45 TestMolecule = World::getInstance().createMolecule(); 58 Walker = World::getInstance().createAtom(); 46 CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule"); 47 Walker = World::getInstance().createAtom(); 48 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 59 49 Walker->type = hydrogen; 60 50 *Walker->node = Vector(1., 0., 1. ); 61 51 TestMolecule->AddAtom(Walker); 62 52 Walker = World::getInstance().createAtom(); 53 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 63 54 Walker->type = hydrogen; 64 55 *Walker->node = Vector(0., 1., 1. ); 65 56 TestMolecule->AddAtom(Walker); 66 57 Walker = World::getInstance().createAtom(); 58 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 67 59 Walker->type = hydrogen; 68 60 *Walker->node = Vector(1., 1., 0. ); 69 61 TestMolecule->AddAtom(Walker); 70 62 Walker = World::getInstance().createAtom(); 63 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 71 64 Walker->type = hydrogen; 72 65 *Walker->node = Vector(0., 0., 0. ); … … 75 68 // check that TestMolecule was correctly constructed 76 69 CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 ); 77 78 70 }; 79 71 … … 86 78 // are all cleaned when the world is destroyed 87 79 World::purgeInstance(); 88 MemoryUsageObserver::purgeInstance();89 80 logger::purgeInstance(); 90 81 };
Note:
See TracChangeset
for help on using the changeset viewer.