--- trunk/OOPSE-3.0/test/math/RectMatrixTestCase.cpp 2004/10/19 04:34:35 1597 +++ trunk/OOPSE-3.0/test/math/RectMatrixTestCase.cpp 2004/10/21 21:31:39 1630 @@ -237,6 +237,7 @@ void RectMatrixTestCase::testDiv() { CPPUNIT_ASSERT(m1 / 2.0 * 2.0 == m1); + } void RectMatrixTestCase::testAccessEntries(){ @@ -250,8 +251,9 @@ void RectMatrixTestCase::testRowColOperations() { //test getRow row = e.getRow(0); - CPPUNIT_ASSERT(row[0] == 2.0 && row[1] == 4.0 && row[2] == 1.0); - + CPPUNIT_ASSERT_DOUBLES_EQUAL(row[0], 2.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(row[1], 4.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(row[2], 1.0, oopse::epsilon); //test setRow row[0] = 2.0; row[1] = 4.0; @@ -269,8 +271,9 @@ void RectMatrixTestCase::testRowColOperations() { //test getCol col = e.getColum(1); - CPPUNIT_ASSERT(col[0] == 4.0 && col[1] == 0.0 && col[2] == 6.0); - + CPPUNIT_ASSERT_DOUBLES_EQUAL(col[0], 4.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(col[1], 0.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(col[2], 6.0, oopse::epsilon); //test setCol col[0] = 2.0; col[1] = 0.0; @@ -311,7 +314,20 @@ void RectMatrixTestCase::testRowColOperations() { s.swapColum(0, 1); CPPUNIT_ASSERT(s == e); - + + double* p = s.getArrayPointer(); + + p[0] = 2.0; + p[1] = 4.0; + p[2] = 1.0; + p[3] = 0.0; + p[4] = 6.0; + p[5] = 5.0; + p[6] = 0.0; + p[7] = 0.0; + p[8] = 3.0; + + CPPUNIT_ASSERT(s == f); } void RectMatrixTestCase::testOtherMemberFunctions(){