APM:Libraries
Macros | Functions
test_math.cpp File Reference
#include <AP_gtest.h>
#include <AP_Math/AP_Math.h>
Include dependency graph for test_math.cpp:

Go to the source code of this file.

Macros

#define SQRT_2   1.4142135623730951f
 
#define TEST_ROTATION(rotation, _x, _y, _z)
 

Functions

 TEST (VectorTest, Rotations)
 
 TEST (MathTest, IsZero)
 
 TEST (MathTest, IsEqual)
 
 TEST (MathTest, Square)
 
 TEST (MathTest, Norm)
 
 TEST (MathTest, Constrain)
 
 TEST (MathWrapTest, Angle180)
 
 TEST (MathWrapTest, Angle360)
 
 TEST (MathWrapTest, AnglePI)
 
 TEST (MathWrapTest, Angle2PI)
 

Macro Definition Documentation

◆ SQRT_2

#define SQRT_2   1.4142135623730951f

Definition at line 5 of file test_math.cpp.

Referenced by TEST().

◆ TEST_ROTATION

#define TEST_ROTATION (   rotation,
  _x,
  _y,
  _z 
)
Value:
{ \
const float accuracy = 1.0e-6; \
Vector3f v(1, 1, 1); \
v.rotate(rotation); \
Vector3f expected(_x, _y, _z); \
EXPECT_NEAR(expected.length(), v.length(), accuracy); \
EXPECT_FLOAT_EQ(expected.x, v.x); \
EXPECT_FLOAT_EQ(expected.y, v.y); \
EXPECT_FLOAT_EQ(expected.z, v.z); \
rotation_count++; \
}
float v
Definition: Printf.cpp:15

Referenced by TEST().

Function Documentation

◆ TEST() [1/10]

TEST ( VectorTest  ,
Rotations   
)

Definition at line 7 of file test_math.cpp.

◆ TEST() [2/10]

TEST ( MathTest  ,
IsZero   
)

Definition at line 68 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [3/10]

TEST ( MathTest  ,
IsEqual   
)

Definition at line 77 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [4/10]

TEST ( MathTest  ,
Square   
)

Definition at line 95 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [5/10]

TEST ( MathTest  ,
Norm   
)

Definition at line 106 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [6/10]

TEST ( MathTest  ,
Constrain   
)

Definition at line 124 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [7/10]

TEST ( MathWrapTest  ,
Angle180   
)

Definition at line 186 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [8/10]

TEST ( MathWrapTest  ,
Angle360   
)

Definition at line 225 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [9/10]

TEST ( MathWrapTest  ,
AnglePI   
)

Definition at line 262 of file test_math.cpp.

Here is the call graph for this function:

◆ TEST() [10/10]

TEST ( MathWrapTest  ,
Angle2PI   
)

Definition at line 271 of file test_math.cpp.

Here is the call graph for this function: