mirror of https://github.com/ArduPilot/ardupilot
AP_Math: tests: define hal where requirerd for custom rotaitons
This commit is contained in:
parent
2b9421c4db
commit
15326a8d90
|
@ -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:
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]); \
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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]); \
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Reference in New Issue