1 |
#ifndef TEST_RECTMATRIXTEST_HPP |
2 |
#define TEST_RECTMATRIXTEST_HPP |
3 |
|
4 |
#include <cppunit/extensions/HelperMacros.h> |
5 |
#include "math/RectMatrix.hpp" |
6 |
|
7 |
/** |
8 |
* @namespace oopse |
9 |
*/ |
10 |
using namespace oopse; |
11 |
|
12 |
typedef RectMatrix<double, 2, 2> RMat2x2; |
13 |
typedef RectMatrix<double, 2, 3> RMat2x3; |
14 |
typedef RectMatrix<double, 3, 2> RMat3x2; |
15 |
|
16 |
class RectMatrixTestCase : public CPPUNIT_NS::TestFixture { |
17 |
CPPUNIT_TEST_SUITE( RectMatrixTestCase ); |
18 |
CPPUNIT_TEST(testConstructor); |
19 |
CPPUNIT_TEST(testNegate); |
20 |
CPPUNIT_TEST(testAdd); |
21 |
CPPUNIT_TEST(testSub); |
22 |
CPPUNIT_TEST(testMul); |
23 |
CPPUNIT_TEST(testDiv); |
24 |
CPPUNIT_TEST(testAccessEntries); |
25 |
CPPUNIT_TEST(testTranspose); |
26 |
CPPUNIT_TEST_SUITE_END(); |
27 |
|
28 |
public: |
29 |
|
30 |
virtual void setUp(); |
31 |
|
32 |
void testConstructor(); |
33 |
void testEqual(); |
34 |
void testNegate(); |
35 |
void testAdd(); |
36 |
void testSub(); |
37 |
void testMul(); |
38 |
void testDiv(); |
39 |
void testAccessEntries(); |
40 |
void testTranspose(); |
41 |
|
42 |
private: |
43 |
RMat2x2 m1; |
44 |
RMat2x2 m2; |
45 |
RMat2x2 m3; |
46 |
RMat2x2 m4; |
47 |
RMat2x2 zero; |
48 |
RMat2x2 one; |
49 |
RMat2x2 two; |
50 |
|
51 |
|
52 |
RMat2x3 a; |
53 |
RMat3x2 b; |
54 |
|
55 |
double s1; |
56 |
|
57 |
double s2; |
58 |
|
59 |
}; |
60 |
#endif //TEST_RECTMATRIXTEST_HPP |