Changeset 6a314f for molecuilder/src/unittests/vectorunittest.cpp
- Timestamp:
- Apr 29, 2010, 4:03:30 PM (16 years ago)
- Children:
- 465abf
- Parents:
- 16eb32
- File:
-
- 1 edited
-
molecuilder/src/unittests/vectorunittest.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/unittests/vectorunittest.cpp
r16eb32 r6a314f 43 43 notunit = Vector(0.,1.,1.); 44 44 two = Vector(2.,1.,0.); 45 three = Vector(1,2,3); 45 46 }; 46 47 … … 185 186 CPPUNIT_ASSERT_EQUAL( Vector(0.,1.,0.), two.Projection(otherunit) ); 186 187 }; 188 189 /** 190 * Unittest for operation with normals 191 */ 192 void VectorTest::NormalsTest(){ 193 Vector testVector; 194 // the zero Vector should produce an error 195 CPPUNIT_ASSERT(!testVector.GetOneNormalVector(zero)); 196 197 // first one-component system 198 CPPUNIT_ASSERT(testVector.GetOneNormalVector(unit)); 199 CPPUNIT_ASSERT(testVector.ScalarProduct(unit) < MYEPSILON); 200 201 // second one-component system 202 CPPUNIT_ASSERT(testVector.GetOneNormalVector(otherunit)); 203 CPPUNIT_ASSERT(testVector.ScalarProduct(otherunit) < MYEPSILON); 204 205 // first two-component system 206 CPPUNIT_ASSERT(testVector.GetOneNormalVector(notunit)); 207 CPPUNIT_ASSERT(testVector.ScalarProduct(notunit) < MYEPSILON); 208 209 // second two-component system 210 CPPUNIT_ASSERT(testVector.GetOneNormalVector(two)); 211 CPPUNIT_ASSERT(testVector.ScalarProduct(two) < MYEPSILON); 212 213 // three component system 214 CPPUNIT_ASSERT(testVector.GetOneNormalVector(three)); 215 CPPUNIT_ASSERT(testVector.ScalarProduct(three) < MYEPSILON); 216 } 187 217 188 218 /** UnitTest for line intersections.
Note:
See TracChangeset
for help on using the changeset viewer.
