MCPcopy Create free account
hub / github.com/cinder/Cinder / TestMatrix22

Function TestMatrix22

test/mathTest/src/TestMatrix22.h:3–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#pragma once
2
3template <typename T> void TestMatrix22( std::ostream& os )
4{
5 typedef Matrix22<T> MatT;
6
7 // Matrix22();
8 {
9 bool result = false;
10 MatT c0( 1, 0, 0, 1 );
11 result = ( c0 == MatT() );
12 os << (result ? "passed" : "FAILED") << " : " << "Matrix22();" << "\n";
13 }
14
15
16 // explicit Matrix22( T s );
17 {
18 bool result = false;
19 MatT c0( 3, 3, 3, 3 );
20 result = ( c0 == MatT( 3 ) );
21 os << (result ? "passed" : "FAILED") << " : " << "explicit Matrix22( T s );" << "\n";
22 }
23
24
25 // Matrix22( const T *dt );
26 {
27 bool result = false;
28 T data[4] = { 1, 2, 3, 4 };
29 MatT c0( 1, 2, 3, 4 );
30 result = ( c0 == MatT( data ) );
31 os << (result ? "passed" : "FAILED") << " : " << "Matrix22( const T *dt );" << "\n";
32 }
33
34
35 // Matrix22( T d0, T d1, T d2, T d3 );
36 {
37 bool result = false;
38 T data[4] = { 1, 2, 3, 4 };
39 MatT c0( 1, 2, 3, 4 );
40 result = ( ( data[0] == c0.m[0] ) &&
41 ( data[1] == c0.m[1] ) &&
42 ( data[2] == c0.m[2] ) &&
43 ( data[3] == c0.m[3] ) );
44 os << (result ? "passed" : "FAILED") << " : " << "Matrix22( T d0, T d1, T d2, T d3 );" << "\n";
45 }
46
47
48 // Matrix22( const Vec2<T> &vx, const Vec2<T> &vy );
49 {
50 bool result = false;
51 MatT c0( 1, 2, 3, 4 );
52 result = ( c0 == MatT( Vec2<T>( 1, 2 ), Vec2<T>( 3, 4 ) ) );
53 os << (result ? "passed" : "FAILED") << " : " << "Matrix22( const Vec2<T> &vx, const Vec2<T> &vy );" << "\n";
54 }
55
56
57 // template< typename FromT > Matrix22( const Matrix22<FromT>& src );
58 {
59 bool result = false;
60 Matrix22<double> dmat0( 1, 2, 3, 4 );

Callers

nothing calls this directly

Calls 6

toRadiansFunction · 0.85
atMethod · 0.80
invertMethod · 0.80
rotateMethod · 0.80
zeroFunction · 0.50
scaleMethod · 0.45

Tested by

no test coverage detected