mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 17:10:34 +08:00
clang-tidy trivial cleanup
This commit is contained in:
+12
-13
@@ -1,35 +1,34 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#include <matrix/math.hpp>
|
||||
|
||||
#include "test_macros.hpp"
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
template class Vector<float, 2>;
|
||||
using matrix::Vector2f;
|
||||
using matrix::Matrix;
|
||||
|
||||
int main()
|
||||
{
|
||||
Vector2f a(1, 0);
|
||||
Vector2f b(0, 1);
|
||||
TEST(fabs(a % b - 1.0f) < 1e-5);
|
||||
TEST(fabsf(a % b - 1.0f) < 1e-5);
|
||||
|
||||
Vector2f c;
|
||||
TEST(fabs(c(0) - 0) < 1e-5);
|
||||
TEST(fabs(c(1) - 0) < 1e-5);
|
||||
TEST(fabsf(c(0) - 0) < 1e-5);
|
||||
TEST(fabsf(c(1) - 0) < 1e-5);
|
||||
|
||||
Matrix<float, 2, 1> d(a);
|
||||
TEST(fabs(d(0,0) - 1) < 1e-5);
|
||||
TEST(fabs(d(1,0) - 0) < 1e-5);
|
||||
TEST(fabsf(d(0,0) - 1) < 1e-5);
|
||||
TEST(fabsf(d(1,0) - 0) < 1e-5);
|
||||
|
||||
Vector2f e(d);
|
||||
TEST(fabs(e(0) - 1) < 1e-5);
|
||||
TEST(fabs(e(1) - 0) < 1e-5);
|
||||
TEST(fabsf(e(0) - 1) < 1e-5);
|
||||
TEST(fabsf(e(1) - 0) < 1e-5);
|
||||
|
||||
float data[] = {4,5};
|
||||
Vector2f f(data);
|
||||
TEST(fabs(f(0) - 4) < 1e-5);
|
||||
TEST(fabs(f(1) - 5) < 1e-5);
|
||||
TEST(fabsf(f(0) - 4) < 1e-5);
|
||||
TEST(fabsf(f(1) - 5) < 1e-5);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user