MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / TEST

Function TEST

tests/T_Matrix4d.cpp:8–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace LNLib;
7
8TEST(Test_Matrix4d, Construct)
9{
10 Matrix4d m = Matrix4d();
11 EXPECT_TRUE(m.IsIdentity());
12 XYZ x = XYZ(1, 0, 0);
13 XYZ y = XYZ(0, 1, 0);
14 XYZ z = XYZ(0, 0, 1);
15 XYZ w = XYZ(0, 0, 0);
16 Matrix4d m1 = Matrix4d(x,y,z,w);
17 EXPECT_TRUE(m1.IsIdentity());
18 Matrix4d m2 = Matrix4d(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
19 m = m2;
20 bool result = true;
21 for (int i = 0; i <= 3; i++)
22 {
23 if (!result) break;
24 for (int j = 0; j <= 3; j++)
25 {
26 if (!MathUtils::IsAlmostEqualTo(m.GetElement(i, j), 1))
27 {
28 result = false;
29 break;
30 }
31 }
32 }
33 EXPECT_TRUE(result);
34}
35
36TEST(Test_Matrix4d, Creation)
37{

Callers

nothing calls this directly

Calls 15

GetElementMethod · 0.80
OfWeightedPointMethod · 0.80
SetElementMethod · 0.80
Matrix4dClass · 0.50
XYZClass · 0.50
XYZWClass · 0.50
IsIdentityMethod · 0.45
IsTranslationMethod · 0.45
OfPointMethod · 0.45
IsAlmostEqualToMethod · 0.45
GetScaleMethod · 0.45
ToXYZMethod · 0.45

Tested by

no test coverage detected