Test for class MatfileIO. More...

#include <matfileIOTest.hh>

Inheritance diagram for test::MatfileIOTest:
test::TestCase

Public Member Functions

void _succeed ()
 Explicitly succeds a test. More...
 
long getNumFailed () const
 Returns number of failed tests. More...
 
long getNumPassed () const
 Returns number of passed tests. More...
 
const ostream * getStream () const
 Returns output stream. More...
 
 MatfileIOTest ()
 
long report () const
 Prints a report on the number of passed and failed tests to the output stream. More...
 
virtual void reset ()
 Resets the counters for the failed and passed tests. More...
 
virtual void run ()
 Runs the tests. Must be overwritten by the specialization. More...
 
void setStream (ostream *osptr)
 Sets the output stream. More...
 
virtual ~MatfileIOTest ()
 

Protected Member Functions

void do_fail (const string &lbl, const char *fname, long lineno)
 Internal function to report a failed test (besides increasing the failed counter) More...
 
bool do_numtest (double num, double orig, const string &lbl, const string &lbl2, const char *fname, long lineno, const double tol=1e-10)
 Internal function to do a numerical test. More...
 
bool do_numtest (std::complex< double > num, std::complex< double > orig, const string &lbl, const string &lbl2, const char *fname, long lineno, const double tol=1e-10)
 
bool do_test (bool cond, const string &lbl, const char *fname, long lineno)
 Internal function to do a test. More...
 

Private Member Functions

void createMATfile () const
 
template<class F >
bool isEqual_ (concepts::Array< F > &m1, concepts::Array< F > &m2)
 
bool isEqual_ (concepts::Cmplx &m1, concepts::Cmplx &m2)
 
template<class F >
bool isEqual_ (concepts::DiagonalMatrix< F > &m1, concepts::DiagonalMatrix< F > &m2)
 
template<class F >
bool isEqual_ (concepts::ElementMatrix< F > &m1, concepts::ElementMatrix< F > &m2)
 
template<class F , uint dim1, uint dim2>
bool isEqual_ (concepts::Mapping< F, dim1 > &m1, concepts::Mapping< F, dim2 > &m2)
 
template<class F , uint dim1, uint dim2>
bool isEqual_ (concepts::Point< F, dim1 > &m1, concepts::Point< F, dim2 > &m2)
 
bool isEqual_ (concepts::Real &m1, concepts::Real &m2)
 
template<class F >
bool isEqual_ (concepts::Sequence< F > &m1, concepts::Sequence< F > &m2)
 
template<class F >
bool isEqual_ (concepts::SparseMatrix< F > &m1, concepts::SparseMatrix< F > &m2)
 
template<class F >
bool isEqual_ (concepts::Vector< F > &m1, concepts::Vector< F > &m2)
 
template<typename F >
void testAddSth_ (F &obj)
 Test for adding ElementMatrix, SparseMatrix, DiagonalMatrix, Sequence, Vector, Array, Mapping, Point, Scalars. More...
 
template<typename F , typename G >
void testAddSthOtherCmp_ (F &obj_F, G &obj_G)
 Test for adding Array<Point> More...
 
void testBasics_ ()
 Test for public methods. More...
 
void testClearAll_ ()
 Test for clearing the MAT file. More...
 
void testGetSth_ ()
 Test for getting ElementMatrix, SparseMatrix, DiagonalMatrix, Sequence, Vector, Sequence<Vector> Array, Mapping, Point, Scalars. More...
 

Private Attributes

long m_nFail
 
long m_nPass
 
ostream * m_osptr
 

Detailed Description

Test for class MatfileIO.

Author
Robert Gruhlke 2013

Definition at line 22 of file matfileIOTest.hh.

Constructor & Destructor Documentation

◆ MatfileIOTest()

test::MatfileIOTest::MatfileIOTest ( )
inline

Definition at line 25 of file matfileIOTest.hh.

◆ ~MatfileIOTest()

virtual test::MatfileIOTest::~MatfileIOTest ( )
inlinevirtual

Definition at line 27 of file matfileIOTest.hh.

Member Function Documentation

◆ _succeed()

void test::TestCase::_succeed ( )
inlineinherited

Explicitly succeds a test.

Definition at line 112 of file testcase.hh.

◆ createMATfile()

void test::MatfileIOTest::createMATfile ( ) const
private

◆ do_fail()

void test::TestCase::do_fail ( const string &  lbl,
const char *  fname,
long  lineno 
)
protectedinherited

Internal function to report a failed test (besides increasing the failed counter)

◆ do_numtest() [1/2]

bool test::TestCase::do_numtest ( double  num,
double  orig,
const string &  lbl,
const string &  lbl2,
const char *  fname,
long  lineno,
const double  tol = 1e-10 
)
protectedinherited

Internal function to do a numerical test.

◆ do_numtest() [2/2]

bool test::TestCase::do_numtest ( std::complex< double >  num,
std::complex< double >  orig,
const string &  lbl,
const string &  lbl2,
const char *  fname,
long  lineno,
const double  tol = 1e-10 
)
protectedinherited

◆ do_test()

bool test::TestCase::do_test ( bool  cond,
const string &  lbl,
const char *  fname,
long  lineno 
)
protectedinherited

Internal function to do a test.

◆ getNumFailed()

long test::TestCase::getNumFailed ( ) const
inlineinherited

Returns number of failed tests.

Definition at line 105 of file testcase.hh.

◆ getNumPassed()

long test::TestCase::getNumPassed ( ) const
inlineinherited

Returns number of passed tests.

Definition at line 103 of file testcase.hh.

◆ getStream()

const ostream* test::TestCase::getStream ( ) const
inlineinherited

Returns output stream.

Definition at line 107 of file testcase.hh.

◆ isEqual_() [1/10]

template<class F >
bool test::MatfileIOTest::isEqual_ ( concepts::Array< F > &  m1,
concepts::Array< F > &  m2 
)
private

◆ isEqual_() [2/10]

bool test::MatfileIOTest::isEqual_ ( concepts::Cmplx m1,
concepts::Cmplx m2 
)
private

◆ isEqual_() [3/10]

template<class F >
bool test::MatfileIOTest::isEqual_ ( concepts::DiagonalMatrix< F > &  m1,
concepts::DiagonalMatrix< F > &  m2 
)
private

◆ isEqual_() [4/10]

template<class F >
bool test::MatfileIOTest::isEqual_ ( concepts::ElementMatrix< F > &  m1,
concepts::ElementMatrix< F > &  m2 
)
private

◆ isEqual_() [5/10]

template<class F , uint dim1, uint dim2>
bool test::MatfileIOTest::isEqual_ ( concepts::Mapping< F, dim1 > &  m1,
concepts::Mapping< F, dim2 > &  m2 
)
inlineprivate

Definition at line 91 of file matfileIOTest.hh.

◆ isEqual_() [6/10]

template<class F , uint dim1, uint dim2>
bool test::MatfileIOTest::isEqual_ ( concepts::Point< F, dim1 > &  m1,
concepts::Point< F, dim2 > &  m2 
)
inlineprivate

Definition at line 107 of file matfileIOTest.hh.

◆ isEqual_() [7/10]

bool test::MatfileIOTest::isEqual_ ( concepts::Real m1,
concepts::Real m2 
)
private

◆ isEqual_() [8/10]

template<class F >
bool test::MatfileIOTest::isEqual_ ( concepts::Sequence< F > &  m1,
concepts::Sequence< F > &  m2 
)
private

◆ isEqual_() [9/10]

template<class F >
bool test::MatfileIOTest::isEqual_ ( concepts::SparseMatrix< F > &  m1,
concepts::SparseMatrix< F > &  m2 
)
private

◆ isEqual_() [10/10]

template<class F >
bool test::MatfileIOTest::isEqual_ ( concepts::Vector< F > &  m1,
concepts::Vector< F > &  m2 
)
private

◆ report()

long test::TestCase::report ( ) const
inherited

Prints a report on the number of passed and failed tests to the output stream.

Returns
Number of failed tests.

◆ reset()

virtual void test::TestCase::reset ( )
inlinevirtualinherited

Resets the counters for the failed and passed tests.

Definition at line 119 of file testcase.hh.

◆ run()

virtual void test::MatfileIOTest::run ( )
virtual

Runs the tests. Must be overwritten by the specialization.

Implements test::TestCase.

◆ setStream()

void test::TestCase::setStream ( ostream *  osptr)
inlineinherited

Sets the output stream.

Definition at line 109 of file testcase.hh.

◆ testAddSth_()

template<typename F >
void test::MatfileIOTest::testAddSth_ ( F &  obj)
private

Test for adding ElementMatrix, SparseMatrix, DiagonalMatrix, Sequence, Vector, Array, Mapping, Point, Scalars.

◆ testAddSthOtherCmp_()

template<typename F , typename G >
void test::MatfileIOTest::testAddSthOtherCmp_ ( F &  obj_F,
G &  obj_G 
)
private

Test for adding Array<Point>

◆ testBasics_()

void test::MatfileIOTest::testBasics_ ( )
private

Test for public methods.

◆ testClearAll_()

void test::MatfileIOTest::testClearAll_ ( )
private

Test for clearing the MAT file.

◆ testGetSth_()

void test::MatfileIOTest::testGetSth_ ( )
private

Test for getting ElementMatrix, SparseMatrix, DiagonalMatrix, Sequence, Vector, Sequence<Vector> Array, Mapping, Point, Scalars.

Member Data Documentation

◆ m_nFail

long test::TestCase::m_nFail
privateinherited

Definition at line 139 of file testcase.hh.

◆ m_nPass

long test::TestCase::m_nPass
privateinherited

Definition at line 138 of file testcase.hh.

◆ m_osptr

ostream* test::TestCase::m_osptr
privateinherited

Definition at line 137 of file testcase.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich