--- trunk/test/math/RectMatrixTestCase.cpp 2004/10/19 21:28:55 110 +++ trunk/test/math/RectMatrixTestCase.cpp 2004/10/25 22:46:19 151 @@ -166,6 +166,15 @@ void RectMatrixTestCase::testConstructor(){ tmp4 = tmp4; CPPUNIT_ASSERT(tmp4 == m2); + double tmp5[4]; + tmp5[0] = 1.0; + tmp5[1] = 1.0; + tmp5[2] = 3.0; + tmp5[3] = 1.0; + + RMat2x2 tmp6(tmp5); + CPPUNIT_ASSERT(tmp6 == m1); + } @@ -314,7 +323,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(){ @@ -322,4 +344,14 @@ void RectMatrixTestCase::testOtherMemberFunctions(){ CPPUNIT_ASSERT((a.transpose()).transpose() == a); CPPUNIT_ASSERT(a.transpose() == b); + + //test getArray + + double tmp[4]; + m4.getArray(tmp); + CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[0], -1.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[1], -1.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[2], -3.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp[3], -1.0, oopse::epsilon); + }