Changeset 0d111b for molecuilder/src/unittests/CountBondsUnitTest.cpp
- Timestamp:
- Apr 29, 2010, 1:55:21 PM (16 years ago)
- Children:
- 070651, 5d1a94
- Parents:
- 90c4460 (diff), 32842d8 (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
-
molecuilder/src/unittests/CountBondsUnitTest.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/unittests/CountBondsUnitTest.cpp
r90c4460 r0d111b 72 72 Walker = World::getInstance().createAtom(); 73 73 Walker->type = hydrogen; 74 Walker->node->Init(-0.2418, 0.9350, 0. );74 *Walker->node = Vector(-0.2418, 0.9350, 0. ); 75 75 TestMolecule1->AddAtom(Walker); 76 76 Walker = World::getInstance().createAtom(); 77 77 Walker->type = hydrogen; 78 Walker->node->Init(0.9658, 0., 0. );78 *Walker->node = Vector(0.9658, 0., 0. ); 79 79 TestMolecule1->AddAtom(Walker); 80 80 Walker = World::getInstance().createAtom(); 81 81 Walker->type = oxygen; 82 Walker->node->Init(0., 0., 0. );82 *Walker->node = Vector(0., 0., 0. ); 83 83 TestMolecule1->AddAtom(Walker); 84 84 … … 86 86 Walker = World::getInstance().createAtom(); 87 87 Walker->type = hydrogen; 88 Walker->node->Init(-0.2418, 0.9350, 0. );88 *Walker->node = Vector(-0.2418, 0.9350, 0. ); 89 89 TestMolecule2->AddAtom(Walker); 90 90 Walker = World::getInstance().createAtom(); 91 91 Walker->type = hydrogen; 92 Walker->node->Init(0.9658, 0., 0. );92 *Walker->node = Vector(0.9658, 0., 0. ); 93 93 TestMolecule2->AddAtom(Walker); 94 94 Walker = World::getInstance().createAtom(); 95 95 Walker->type = oxygen; 96 Walker->node->Init(0., 0., 0. );96 *Walker->node = Vector(0., 0., 0. ); 97 97 TestMolecule2->AddAtom(Walker); 98 98 … … 165 165 166 166 cout << "Case 1: offset of (3,0,0), hence angles are (104.5, 0, 75.5, 180) < 30." << endl; 167 Translator .Init(3,0,0);167 Translator = Vector(3,0,0); 168 168 TestMolecule2->Translate(&Translator); 169 169 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) ); 170 170 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen) ); 171 171 //OutputTestMolecule(TestMolecule2, "testmolecule2-1.xyz"); 172 Translator .Init(-3,0,0);172 Translator = Vector(-3,0,0); 173 173 TestMolecule2->Translate(&Translator); 174 174 175 175 cout << "Case 2: offset of (0,3,0), hence angle are (14.5, 165.5, 90) < 30 (only three, because other 90 is missing due to first H01 only fulfilling H-bond criteria)." << endl; 176 Translator .Init(0,3,0);176 Translator = Vector(0,3,0); 177 177 TestMolecule2->Translate(&Translator); 178 178 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) ); 179 179 //OutputTestMolecule(TestMolecule2, "testmolecule2-2.xyz"); 180 Translator .Init(0,-3,0);180 Translator = Vector(0,-3,0); 181 181 TestMolecule2->Translate(&Translator); 182 182 183 183 cout << "Case 3: offset of (0,-3,0) and mirror, hence angle are (165.5, 90, 165.5, 90) > 30." << endl; 184 Translator .Init(0,-3,0);184 Translator = Vector(0,-3,0); 185 185 TestMolecule2->Scale((const double ** const)&mirror); 186 186 TestMolecule2->Translate(&Translator); 187 187 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 188 188 //OutputTestMolecule(TestMolecule2, "testmolecule2-3.xyz"); 189 Translator .Init(0,3,0);189 Translator = Vector(0,3,0); 190 190 TestMolecule2->Translate(&Translator); 191 191 TestMolecule2->Scale((const double ** const)&mirror); 192 192 193 193 cout << "Case 4: offset of (2,1,0), hence angle are (78, 26.6, 102, 153.4) < 30." << endl; 194 Translator .Init(2,1,0);194 Translator = Vector(2,1,0); 195 195 TestMolecule2->Translate(&Translator); 196 196 CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) ); 197 197 //OutputTestMolecule(TestMolecule2, "testmolecule2-4.xyz"); 198 Translator .Init(-2,-1,0);198 Translator = Vector(-2,-1,0); 199 199 TestMolecule2->Translate(&Translator); 200 200 201 201 cout << "Case 5: offset of (0,0,3), hence angle are (90, 90, 90, 90) > 30." << endl; 202 Translator .Init(0,0,3);202 Translator = Vector(0,0,3); 203 203 TestMolecule2->Translate(&Translator); 204 204 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 205 205 //OutputTestMolecule(TestMolecule2, "testmolecule2-5.xyz"); 206 Translator .Init(0,0,-3);206 Translator = Vector(0,0,-3); 207 207 TestMolecule2->Translate(&Translator); 208 208 209 209 cout << "Case 6: offset of (-3,0,0) and mirror, hence angle are (75.5, 180, 104.5, 180) > 30." << endl; 210 Translator .Init(-3,0,0);210 Translator = Vector(-3,0,0); 211 211 TestMolecule2->Scale((const double ** const)&mirror); 212 212 TestMolecule2->Translate(&Translator); 213 213 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 214 214 //OutputTestMolecule(TestMolecule2, "testmolecule2-6.xyz"); 215 Translator .Init(3,0,0);215 Translator = Vector(3,0,0); 216 216 TestMolecule2->Translate(&Translator); 217 217 TestMolecule2->Scale((const double ** const)&mirror); 218 218 219 219 cout << "Case 7: offset of (3,0,0) and mirror, hence angles are (104.5, 0, 104.5, 0) < 30, but interfering hydrogens." << endl; 220 Translator .Init(3,0,0);220 Translator = Vector(3,0,0); 221 221 TestMolecule2->Scale((const double ** const)&mirror); 222 222 TestMolecule2->Translate(&Translator); 223 223 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 224 224 //OutputTestMolecule(TestMolecule2, "testmolecule2-7.xyz"); 225 Translator .Init(-3,0,0);225 Translator = Vector(-3,0,0); 226 226 TestMolecule2->Translate(&Translator); 227 227 TestMolecule2->Scale((const double ** const)&mirror); 228 228 229 229 cout << "Case 8: offset of (0,3,0), hence angle are (14.5, 90, 14.5, 90) < 30, but interfering hydrogens." << endl; 230 Translator .Init(0,3,0);230 Translator = Vector(0,3,0); 231 231 TestMolecule2->Scale((const double ** const)&mirror); 232 232 TestMolecule2->Translate(&Translator); 233 233 //OutputTestMolecule(TestMolecule2, "testmolecule2-8.xyz"); 234 234 CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) ); 235 Translator .Init(0,-3,0);235 Translator = Vector(0,-3,0); 236 236 TestMolecule2->Translate(&Translator); 237 237 TestMolecule2->Scale((const double ** const)&mirror);
Note:
See TracChangeset
for help on using the changeset viewer.
