Changes in src/unittests/PlaneUnittest.cpp [27ac00:fa5a6a]
- File:
-
- 1 edited
-
src/unittests/PlaneUnittest.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/PlaneUnittest.cpp
r27ac00 rfa5a6a 17 17 18 18 #include "vector.hpp" 19 #include "Line.hpp"20 19 21 20 CPPUNIT_TEST_SUITE_REGISTRATION( PlaneUnittest ); … … 154 153 CPPUNIT_ASSERT(fabs(p4->distance(e1)-1) < MYEPSILON); 155 154 CPPUNIT_ASSERT_EQUAL(zeroVec,p4->getClosestPoint(e1)); 155 156 156 157 } 157 158 void PlaneUnittest::mirrorTest(){159 Vector fixture;160 161 // some Vectors that lie on the planes162 fixture = p1->mirrorVector(e1);163 CPPUNIT_ASSERT_EQUAL(fixture,e1);164 fixture = p1->mirrorVector(e2);165 CPPUNIT_ASSERT_EQUAL(fixture,e2);166 fixture = p1->mirrorVector(e3);167 CPPUNIT_ASSERT_EQUAL(fixture,e3);168 169 fixture = p2->mirrorVector(zeroVec);170 CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);171 fixture = p2->mirrorVector(e1);172 CPPUNIT_ASSERT_EQUAL(fixture,e1);173 fixture = p2->mirrorVector(e2);174 CPPUNIT_ASSERT_EQUAL(fixture,e2);175 176 fixture = p3->mirrorVector(zeroVec);177 CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);178 fixture = p3->mirrorVector(e1);179 CPPUNIT_ASSERT_EQUAL(fixture,e1);180 fixture = p3->mirrorVector(e3);181 CPPUNIT_ASSERT_EQUAL(fixture,e3);182 183 fixture = p4->mirrorVector(zeroVec);184 CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);185 fixture = p4->mirrorVector(e2);186 CPPUNIT_ASSERT_EQUAL(fixture,e2);187 fixture = p4->mirrorVector(e3);188 CPPUNIT_ASSERT_EQUAL(fixture,e3);189 190 // some Vectors outside of the planes191 {192 Vector t = (2./3.)*(e1+e2+e3);193 fixture = p1->mirrorVector(zeroVec);194 CPPUNIT_ASSERT_EQUAL(fixture,t);195 }196 197 fixture = p2->mirrorVector(e3);198 CPPUNIT_ASSERT_EQUAL(fixture,-1*e3);199 fixture = p3->mirrorVector(e2);200 CPPUNIT_ASSERT_EQUAL(fixture,-1*e2);201 fixture = p4->mirrorVector(e1);202 CPPUNIT_ASSERT_EQUAL(fixture,-1*e1);203 }204 205 void PlaneUnittest::LineIntersectionTest(){206 Vector fixture;207 // plane at (0,0,0) normal to (1,0,0) cuts line from (0,0,0) to (2,1,0) at ???208 Line l1 = makeLineThrough(zeroVec,Vector(2,1,0));209 CPPUNIT_ASSERT_NO_THROW(fixture = Plane(e1, zeroVec).GetIntersection(l1) );210 CPPUNIT_ASSERT_EQUAL( zeroVec, fixture );211 212 // plane at (2,1,0) normal to (0,1,0) cuts line from (1,0,0) to (0,1,1) at ???213 Line l2 = makeLineThrough(e1,Vector(0,1,1));214 CPPUNIT_ASSERT_NO_THROW(fixture = Plane(e2, Vector(2,1,0)).GetIntersection(l2) );215 CPPUNIT_ASSERT_EQUAL( Vector(0., 1., 1.), fixture );216 }
Note:
See TracChangeset
for help on using the changeset viewer.
