- File:
-
- 1 edited
-
src/unittests/CountBondsUnitTest.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/CountBondsUnitTest.cpp
rd74077 r920c70 54 54 Walker = World::getInstance().createAtom(); 55 55 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 56 Walker-> setType(hydrogen);57 Walker->setPosition(Vector(-0.2418, 0.9350, 0. ));56 Walker->type = hydrogen; 57 *Walker->node = Vector(-0.2418, 0.9350, 0. ); 58 58 TestMolecule1->AddAtom(Walker); 59 59 Walker = World::getInstance().createAtom(); 60 60 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 61 Walker-> setType(hydrogen);62 Walker->setPosition(Vector(0.9658, 0., 0. ));61 Walker->type = hydrogen; 62 *Walker->node = Vector(0.9658, 0., 0. ); 63 63 TestMolecule1->AddAtom(Walker); 64 64 Walker = World::getInstance().createAtom(); 65 65 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 66 Walker-> setType(oxygen);67 Walker->setPosition(Vector(0., 0., 0. ));66 Walker->type = oxygen; 67 *Walker->node = Vector(0., 0., 0. ); 68 68 TestMolecule1->AddAtom(Walker); 69 69 … … 72 72 Walker = World::getInstance().createAtom(); 73 73 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 74 Walker-> setType(hydrogen);75 Walker->setPosition(Vector(-0.2418, 0.9350, 0. ));74 Walker->type = hydrogen; 75 *Walker->node = Vector(-0.2418, 0.9350, 0. ); 76 76 TestMolecule2->AddAtom(Walker); 77 77 Walker = World::getInstance().createAtom(); 78 78 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 79 Walker-> setType(hydrogen);80 Walker->setPosition(Vector(0.9658, 0., 0. ));79 Walker->type = hydrogen; 80 *Walker->node = Vector(0.9658, 0., 0. ); 81 81 TestMolecule2->AddAtom(Walker); 82 82 Walker = World::getInstance().createAtom(); 83 83 CPPUNIT_ASSERT(Walker != NULL && "could not create atom"); 84 Walker-> setType(oxygen);85 Walker->setPosition(Vector(0., 0., 0. ));84 Walker->type = oxygen; 85 *Walker->node = Vector(0., 0., 0. ); 86 86 TestMolecule2->AddAtom(Walker); 87 87 … … 92 92 93 93 // check that TestMolecule was correctly constructed 94 CPPUNIT_ASSERT_EQUAL( TestMolecule1->getAtomCount(), 3 ); 95 CPPUNIT_ASSERT_EQUAL( TestMolecule2->getAtomCount(), 3 ); 94 CPPUNIT_ASSERT_EQUAL( TestMolecule1->AtomCount, 3 ); 95 Walker = TestMolecule1->start->next; 96 CPPUNIT_ASSERT( TestMolecule1->end != Walker ); 97 CPPUNIT_ASSERT_EQUAL( TestMolecule2->AtomCount, 3 ); 98 Walker = TestMolecule2->start->next; 99 CPPUNIT_ASSERT( TestMolecule2->end != Walker ); 96 100 97 101 // create a small file with table … … 154 158 Translator = Vector(3,0,0); 155 159 TestMolecule2->Translate(&Translator); 156 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );157 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen , NULL) );160 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) ); 161 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen) ); 158 162 //OutputTestMolecule(TestMolecule2, "testmolecule2-1.xyz"); 159 163 Translator = Vector(-3,0,0); … … 163 167 Translator = Vector(0,3,0); 164 168 TestMolecule2->Translate(&Translator); 165 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );169 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) ); 166 170 //OutputTestMolecule(TestMolecule2, "testmolecule2-2.xyz"); 167 171 Translator = Vector(0,-3,0); … … 172 176 TestMolecule2->Scale((const double ** const)&mirror); 173 177 TestMolecule2->Translate(&Translator); 174 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );178 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 175 179 //OutputTestMolecule(TestMolecule2, "testmolecule2-3.xyz"); 176 180 Translator = Vector(0,3,0); … … 181 185 Translator = Vector(2,1,0); 182 186 TestMolecule2->Translate(&Translator); 183 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );187 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) ); 184 188 //OutputTestMolecule(TestMolecule2, "testmolecule2-4.xyz"); 185 189 Translator = Vector(-2,-1,0); … … 189 193 Translator = Vector(0,0,3); 190 194 TestMolecule2->Translate(&Translator); 191 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );195 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 192 196 //OutputTestMolecule(TestMolecule2, "testmolecule2-5.xyz"); 193 197 Translator = Vector(0,0,-3); … … 198 202 TestMolecule2->Scale((const double ** const)&mirror); 199 203 TestMolecule2->Translate(&Translator); 200 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );204 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 201 205 //OutputTestMolecule(TestMolecule2, "testmolecule2-6.xyz"); 202 206 Translator = Vector(3,0,0); … … 208 212 TestMolecule2->Scale((const double ** const)&mirror); 209 213 TestMolecule2->Translate(&Translator); 210 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );214 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 211 215 //OutputTestMolecule(TestMolecule2, "testmolecule2-7.xyz"); 212 216 Translator = Vector(-3,0,0); … … 219 223 TestMolecule2->Translate(&Translator); 220 224 //OutputTestMolecule(TestMolecule2, "testmolecule2-8.xyz"); 221 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL , NULL) );225 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 222 226 Translator = Vector(0,-3,0); 223 227 TestMolecule2->Translate(&Translator);
Note:
See TracChangeset
for help on using the changeset viewer.
