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

Comparing trunk/OOPSE-3.0/test/math/RectMatrixTestCase.cpp (file contents):
Revision 1603 by tim, Tue Oct 19 21:28:55 2004 UTC vs.
Revision 1644 by tim, Mon Oct 25 22:46:19 2004 UTC

# Line 166 | Line 166 | void RectMatrixTestCase::testConstructor(){
166      tmp4 = tmp4;
167      CPPUNIT_ASSERT(tmp4 == m2);
168      
169 +    double tmp5[4];
170 +    tmp5[0] = 1.0;
171 +    tmp5[1] = 1.0;
172 +    tmp5[2] = 3.0;
173 +    tmp5[3] = 1.0;
174 +
175 +    RMat2x2 tmp6(tmp5);
176 +    CPPUNIT_ASSERT(tmp6 == m1);
177 +  
178      
179   }
180  
# Line 314 | Line 323 | void RectMatrixTestCase::testRowColOperations() {
323  
324      s.swapColum(0, 1);
325      CPPUNIT_ASSERT(s == e);
326 <    
326 >
327 >    double* p = s.getArrayPointer();
328 >
329 >    p[0] = 2.0;
330 >    p[1] = 4.0;
331 >    p[2] = 1.0;
332 >    p[3] = 0.0;
333 >    p[4] = 6.0;
334 >    p[5] = 5.0;    
335 >    p[6] = 0.0;
336 >    p[7] = 0.0;
337 >    p[8] = 3.0;  
338 >
339 >    CPPUNIT_ASSERT(s == f);    
340   }    
341  
342   void RectMatrixTestCase::testOtherMemberFunctions(){
# Line 322 | Line 344 | void RectMatrixTestCase::testOtherMemberFunctions(){
344      CPPUNIT_ASSERT((a.transpose()).transpose() == a);
345      
346      CPPUNIT_ASSERT(a.transpose() == b);
347 +
348 +    //test getArray
349 +
350 +    double tmp[4];
351 +    m4.getArray(tmp);
352 +    CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[0], -1.0, oopse::epsilon);    
353 +    CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[1], -1.0, oopse::epsilon);
354 +    CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[2], -3.0, oopse::epsilon);    
355 +    CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[3], -1.0, oopse::epsilon);    
356 +    
357   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines