ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/math/Vector3TestCase.cpp
(Generate patch)

Comparing trunk/OOPSE-3.0/test/math/Vector3TestCase.cpp (file contents):
Revision 1595 by tim, Tue Oct 19 04:21:07 2004 UTC vs.
Revision 1644 by tim, Mon Oct 25 22:46:19 2004 UTC

# Line 36 | Line 36 | void Vector3TestCase::testConstructors(){
36   }
37  
38   void Vector3TestCase::testConstructors(){
39 +    double b[] = {2.9, 3.2, 1.2};
40 +    Vector3d v(b);
41 +    CPPUNIT_ASSERT_DOUBLES_EQUAL(v.x(), 2.9, oopse::epsilon);
42 +    CPPUNIT_ASSERT_DOUBLES_EQUAL(v.y(), 3.2, oopse::epsilon);
43 +    CPPUNIT_ASSERT_DOUBLES_EQUAL(v.z(), 1.2, oopse::epsilon);    
44   }
45  
46   void Vector3TestCase::testArithmetic(){
# Line 70 | Line 75 | void Vector3TestCase::testOperators(){
75      //test /=
76      tmp = two;
77      tmp *= 2.0;
78 <    CPPUNIT_ASSERT(tmp == one);    
74 <    //test /
75 <    CPPUNIT_ASSERT( two /2 == one);
76 <    CPPUNIT_ASSERT( two /4 == one * 0.5);
78 >    CPPUNIT_ASSERT(tmp == one * 4.0);    
79      
80 +    //test /
81 +    CPPUNIT_ASSERT( two /2.0 == one);
82 +    CPPUNIT_ASSERT( two /4.0 == one * 0.5);
83 +
84   }
85  
86   void Vector3TestCase::testAccessEntries(){
87  
88 <    CPPUNIT_ASSERT(v1.z() == 3.0);
89 <    CPPUNIT_ASSERT(v2.x() == 4.0);
90 <    CPPUNIT_ASSERT(v3.y() == 10.0);
88 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(v1.z(), 3.0, oopse::epsilon);
89 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(v2.x(), 4.0, oopse::epsilon);
90 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(v3.y(), 10.0, oopse::epsilon);
91  
92      Vector3d tmp;
93      tmp.x() = 78.01;
94      tmp.y() = 21.0;
95      tmp.z() =133.12;
96 <    CPPUNIT_ASSERT(tmp[0] == 78.01 && tmp[1] == 21.0 && tmp[2] == 133.12);
97 <    
96 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp.x(), 78.01, oopse::epsilon);
97 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp.y(), 21.0, oopse::epsilon);
98 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp.z(), 133.12, oopse::epsilon);
99 >
100   }
101  
102   void Vector3TestCase::testOtherTemplateFunctions(){      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines