AP_Math: tests: define hal where requirerd for custom rotaitons

This commit is contained in:
Iampete1 2021-11-20 23:54:22 +00:00 committed by Andrew Tridgell
parent 2b9421c4db
commit 15326a8d90
7 changed files with 14 additions and 0 deletions

View File

@ -20,6 +20,8 @@
#include "math_test.h"
#include <AP_Math/AP_GeodesicGrid.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
class TestParam {
public:
/**

View File

@ -17,6 +17,8 @@
#include "math_test.h"
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
// given we are in the Math library, you're epected to know what
// you're doing when directly comparing floats:
#pragma GCC diagnostic push

View File

@ -3,6 +3,8 @@
#include <AP_Math/vector2.h>
#include <AP_Math/vector3.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
#define EXPECT_VECTOR2F_EQ(v1, v2) \
do { \
EXPECT_FLOAT_EQ(v1[0], v2[0]); \

View File

@ -2,6 +2,8 @@
#include <AP_Math/AP_Math.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
// Tests that quaternion multiplication obeys Hamilton's quaternion multiplication convention
// i*i == j*j == k*k == i*j*k == -1
TEST(QuaternionTest, QuaternionMultiplicationOfBases) {

View File

@ -2,6 +2,8 @@
#include <AP_Math/vector2.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
#define EXPECT_VECTOR2F_EQ(v1, v2) \
do { \
EXPECT_FLOAT_EQ(v1[0], v2[0]); \

View File

@ -2,6 +2,8 @@
#include <AP_Math/AP_Math.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
TEST(Vector2Test, Operator)
{
Vector2f v_float0{1.0f, 1.0f};

View File

@ -2,6 +2,8 @@
#define ALLOW_DOUBLE_MATH_FUNCTIONS
#include <AP_Math/AP_Math.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
TEST(Vector3Test, Operator)
{
Vector3f v_float0{1.0f, 1.0f,1.0f};