mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 20:10:35 +08:00
Fix testing mechanism.
This commit is contained in:
+4
-8
@@ -1,7 +1,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <matrix/math.hpp>
|
||||
#include "test_macros.hpp"
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
@@ -13,22 +13,18 @@ int main()
|
||||
Matrix3f A_I(data_check);
|
||||
Matrix3f I;
|
||||
I.setIdentity();
|
||||
A.print();
|
||||
A_I.print();
|
||||
Matrix3f R = A * A_I;
|
||||
R.print();
|
||||
assert(R == I);
|
||||
TEST(isEqual(R, I));
|
||||
|
||||
Matrix3f R2 = A;
|
||||
R2 *= A_I;
|
||||
R2.print();
|
||||
assert(R2 == I);
|
||||
TEST(isEqual(R2, I));
|
||||
|
||||
|
||||
Matrix3f A2 = eye<float, 3>()*2;
|
||||
Matrix3f B = A2.emult(A2);
|
||||
Matrix3f B_check = eye<float, 3>()*4;
|
||||
assert(B == B_check);
|
||||
TEST(isEqual(B, B_check));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user