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 1816 by tim, Wed Dec 1 19:10:51 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 270 | Line 279 | void RectMatrixTestCase::testRowColOperations() {
279      CPPUNIT_ASSERT(m == e);
280      
281      //test getCol
282 <    col = e.getColum(1);
282 >    col = e.getColumn(1);
283      CPPUNIT_ASSERT_DOUBLES_EQUAL(col[0], 4.0, oopse::epsilon);    
284      CPPUNIT_ASSERT_DOUBLES_EQUAL(col[1], 0.0, oopse::epsilon);
285      CPPUNIT_ASSERT_DOUBLES_EQUAL(col[2], 6.0, oopse::epsilon);
# Line 278 | Line 287 | void RectMatrixTestCase::testRowColOperations() {
287      col[0] = 2.0;    
288      col[1] = 0.0;    
289      col[2] = 0.0;    
290 <    m.setColum(0, col);
290 >    m.setColumn(0, col);
291      col[0] = 4.0;    
292      col[1] = 0.0;    
293      col[2] = 6.0;    
294 <    m.setColum(1, col);
294 >    m.setColumn(1, col);
295      col[0] = 1.0;    
296      col[1] = 3.0;    
297      col[2] = 5.0;    
298 <    m.setColum(2, col);
298 >    m.setColumn(2, col);
299      CPPUNIT_ASSERT(m == e);
300  
301      //test swapRow
# Line 312 | Line 321 | void RectMatrixTestCase::testRowColOperations() {
321      s(2, 1) = 0.0;
322      s(2, 2) = 5.0;
323  
324 <    s.swapColum(0, 1);
324 >    s.swapColumn(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