/* * MatrixUnitTest.cpp * * Created on: Mar 3, 2010 * Author: metzler */ #include "MatrixUnitTest.hpp" #include #include #include #include #ifdef HAVE_TESTRUNNER #include "UnitTestMain.hpp" #endif /*HAVE_TESTRUNNER*/ // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION( MatrixUnitTest ); void MatrixUnitTest::setUp() { // testMatrix = new Matrix(3, 4); } void MatrixUnitTest::tearDown() { // delete(testMatrix); } /************************************ tests ***********************************/ void MatrixUnitTest::setAndGetHeaderTest() { // testMatrix->setHeader("foo bar"); // CPPUNIT_ASSERT_EQUAL( "foo bar", testMatrix->getHeader() ); } void MatrixUnitTest::assignAndGetValuesTest() { // testMatrix->setField(0, 0, (void*) "foo bar"); // CPPUNIT_ASSERT_TRUE( strcmp("foo bar", (char*) testMatrix->getField(0, 0)) == 0 ); // testMatrix->setField(0, 1, (void*) "12.25"); // CPPUNIT_ASSERT_EQUAL( 12.25, (float) testMatrix->getField(0,1) ); // testMatrix->setField(0, 2, (void*) "3"); // CPPUNIT_ASSERT_EQUAL( 3, (int) testMatrix->getField(0, 2) ); }