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 1595 by tim, Tue Oct 19 04:21:07 2004 UTC vs.
Revision 1630 by tim, Thu Oct 21 21:31:39 2004 UTC

# Line 237 | Line 237 | void RectMatrixTestCase::testDiv() {
237  
238      CPPUNIT_ASSERT(m1 / 2.0 * 2.0 == m1);
239  
240 +
241   }
242  
243   void RectMatrixTestCase::testAccessEntries(){
# Line 250 | Line 251 | void RectMatrixTestCase::testRowColOperations() {
251      
252      //test getRow
253      row = e.getRow(0);
254 <    CPPUNIT_ASSERT(row[0] == 2.0 && row[1] == 4.0 && row[2] == 1.0)
255 <
254 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(row[0], 2.0, oopse::epsilon);
255 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(row[1], 4.0, oopse::epsilon);
256 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(row[2], 1.0, oopse::epsilon);
257      //test setRow
258      row[0] = 2.0;    
259      row[1] = 4.0;    
# Line 268 | Line 270 | void RectMatrixTestCase::testRowColOperations() {
270      CPPUNIT_ASSERT(m == e);
271      
272      //test getCol
273 <    col = e.getCol(1);
274 <    CPPUNIT_ASSERT(col[0] == 4.0 && col[1] == 0.0 && col[2] == 6.0)    
275 <
273 >    col = e.getColum(1);
274 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(col[0], 4.0, oopse::epsilon);    
275 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(col[1], 0.0, oopse::epsilon);
276 >    CPPUNIT_ASSERT_DOUBLES_EQUAL(col[2], 6.0, oopse::epsilon);
277      //test setCol
278      col[0] = 2.0;    
279      col[1] = 0.0;    
280      col[2] = 0.0;    
281 <    m.setCol(0, col);
281 >    m.setColum(0, col);
282      col[0] = 4.0;    
283      col[1] = 0.0;    
284      col[2] = 6.0;    
285 <    m.setCol(1, col);
285 >    m.setColum(1, col);
286      col[0] = 1.0;    
287      col[1] = 3.0;    
288      col[2] = 5.0;    
289 <    m.setCol(2, col);
289 >    m.setColum(2, col);
290      CPPUNIT_ASSERT(m == e);
291  
292      //test swapRow
# Line 309 | Line 312 | void RectMatrixTestCase::testRowColOperations() {
312      s(2, 1) = 0.0;
313      s(2, 2) = 5.0;
314  
315 <    s.swapCol(0, 1);
315 >    s.swapColum(0, 1);
316      CPPUNIT_ASSERT(s == e);
317 <    
317 >
318 >    double* p = s.getArrayPointer();
319 >
320 >    p[0] = 2.0;
321 >    p[1] = 4.0;
322 >    p[2] = 1.0;
323 >    p[3] = 0.0;
324 >    p[4] = 6.0;
325 >    p[5] = 5.0;    
326 >    p[6] = 0.0;
327 >    p[7] = 0.0;
328 >    p[8] = 3.0;  
329 >
330 >    CPPUNIT_ASSERT(s == f);    
331   }    
332  
333   void RectMatrixTestCase::testOtherMemberFunctions(){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines