Ocean
Loading...
Searching...
No Matches
TestRotation.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TESTMATH_TEST_ROTATION_H
9#define META_OCEAN_TEST_TESTMATH_TEST_ROTATION_H
10
12
14
15namespace Ocean
16{
17
18namespace Test
19{
20
21namespace TestMath
22{
23
24/**
25 * This class implements a rotation test.
26 * @ingroup testmath
27 */
28class OCEAN_TEST_MATH_EXPORT TestRotation
29{
30 public:
31
32 /**
33 * Executes all rotation tests.
34 * @param testDuration Number of seconds for each test
35 * @param selector The test selector
36 * @return True, if succeeded
37 */
38 static bool test(const double testDuration, const TestSelector& selector);
39
40 /**
41 * Tests the default and basic constructors.
42 * @param testDuration Number of seconds for each test
43 * @return True, if succeeded
44 * @tparam T The data type of the scalar value to be used
45 */
46 template <typename T>
47 static bool testConstructors(const double testDuration);
48
49 /**
50 * Tests the matrix constructors (SquareMatrix3 and HomogenousMatrix4).
51 * This test is critical for finding the maximum-finding bug.
52 * @param testDuration Number of seconds for each test
53 * @return True, if succeeded
54 * @tparam T The data type of the scalar value to be used
55 */
56 template <typename T>
57 static bool testMatrixConstructors(const double testDuration);
58
59 /**
60 * Tests the array constructor.
61 * @param testDuration Number of seconds for each test
62 * @return True, if succeeded
63 * @tparam T The data type of the scalar value to be used
64 */
65 template <typename T>
66 static bool testArrayConstructor(const double testDuration);
67
68 /**
69 * Tests angle normalization (setAngle and constructors).
70 * @param testDuration Number of seconds for each test
71 * @return True, if succeeded
72 * @tparam T The data type of the scalar value to be used
73 */
74 template <typename T>
75 static bool testAngleNormalization(const double testDuration);
76
77 /**
78 * Tests the conversion from a rotation to a quaternion.
79 * @param testDuration Number of seconds for each test, with range (0, infinity)
80 * @return True, if succeeded
81 * @tparam T The data type of the scalar value to be used
82 */
83 template <typename T>
84 static bool testConversionToQuaterion(const double testDuration);
85
86 /**
87 * Tests the conversion from a rotation to a homogenous matrix.
88 * @param testDuration Number of seconds for each test, with range (0, infinity)
89 * @return True, if succeeded
90 * @tparam T The data type of the scalar value to be used
91 */
92 template <typename T>
93 static bool testConversionToHomogenousMatrix(const double testDuration);
94
95 /**
96 * Tests the reference-offset constructor.
97 * @param testDuration Number of seconds for each test
98 * @return True, if succeeded
99 * @tparam T The data type of the scalar value to be used
100 */
101 template <typename T>
102 static bool testReferenceOffsetConstructor(const double testDuration);
103
104 /**
105 * Tests the left_R_right functions.
106 * @param testDuration Number of seconds for each test
107 * @return True, if succeeded
108 * @tparam T The data type of the scalar value to be used
109 */
110 template <typename T>
111 static bool testLeft_R_right(const double testDuration);
112
113 /**
114 * Tests the invert and inverted functions.
115 * @param testDuration Number of seconds for each test
116 * @return True, if succeeded
117 * @tparam T The data type of the scalar value to be used
118 */
119 template <typename T>
120 static bool testInversion(const double testDuration);
121
122 /**
123 * Tests the comparison operators (== and !=).
124 * @param testDuration Number of seconds for each test
125 * @return True, if succeeded
126 * @tparam T The data type of the scalar value to be used
127 */
128 template <typename T>
129 static bool testComparisonOperators(const double testDuration);
130
131 /**
132 * Tests the multiplication operators.
133 * @param testDuration Number of seconds for each test
134 * @return True, if succeeded
135 * @tparam T The data type of the scalar value to be used
136 */
137 template <typename T>
138 static bool testMultiplicationOperators(const double testDuration);
139
140 /**
141 * Tests the element access operators.
142 * @param testDuration Number of seconds for each test
143 * @return True, if succeeded
144 * @tparam T The data type of the scalar value to be used
145 */
146 template <typename T>
147 static bool testElementAccess(const double testDuration);
148};
149
150}
151
152}
153
154}
155
156#endif // META_OCEAN_TEST_TESTMATH_TEST_ROTATION_H
This class implements a rotation test.
Definition TestRotation.h:29
static bool testElementAccess(const double testDuration)
Tests the element access operators.
static bool testArrayConstructor(const double testDuration)
Tests the array constructor.
static bool testMultiplicationOperators(const double testDuration)
Tests the multiplication operators.
static bool testAngleNormalization(const double testDuration)
Tests angle normalization (setAngle and constructors).
static bool testInversion(const double testDuration)
Tests the invert and inverted functions.
static bool testConstructors(const double testDuration)
Tests the default and basic constructors.
static bool testConversionToHomogenousMatrix(const double testDuration)
Tests the conversion from a rotation to a homogenous matrix.
static bool testReferenceOffsetConstructor(const double testDuration)
Tests the reference-offset constructor.
static bool testComparisonOperators(const double testDuration)
Tests the comparison operators (== and !=).
static bool test(const double testDuration, const TestSelector &selector)
Executes all rotation tests.
static bool testConversionToQuaterion(const double testDuration)
Tests the conversion from a rotation to a quaternion.
static bool testLeft_R_right(const double testDuration)
Tests the left_R_right functions.
static bool testMatrixConstructors(const double testDuration)
Tests the matrix constructors (SquareMatrix3 and HomogenousMatrix4).
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15