From 47f1a754c5357dee6c680bf5be78ed804832cf38 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Sat, 17 Dec 2016 19:18:56 +0100 Subject: [PATCH] AP_Math: add some test for vector2 equality test --- libraries/AP_Math/tests/test_vector2.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 libraries/AP_Math/tests/test_vector2.cpp diff --git a/libraries/AP_Math/tests/test_vector2.cpp b/libraries/AP_Math/tests/test_vector2.cpp new file mode 100644 index 0000000000..28ddf47420 --- /dev/null +++ b/libraries/AP_Math/tests/test_vector2.cpp @@ -0,0 +1,18 @@ +#include + +#include + +TEST(Vector2Test, IsEqual) +{ + Vector2l v_int1(1, 1); + Vector2l v_int2(1, 0); + Vector2f v_float1(1.0f, 1.0f); + Vector2f v_float2(1.0f, 0.0f); + + EXPECT_FALSE(v_int1 == v_int2); + EXPECT_TRUE(v_int1 == v_int1); + EXPECT_FALSE(v_float1 == v_float2); + EXPECT_TRUE(v_float1 == v_float1); +} + +AP_GTEST_MAIN()