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