2022-11-07 08:12:35 +00:00
|
|
|
#include <gtest/gtest.h>
|
2022-01-03 15:00:21 +00:00
|
|
|
|
|
|
|
#include "NiPoint3.h"
|
|
|
|
|
2022-11-07 08:12:35 +00:00
|
|
|
/**
|
|
|
|
* @brief Basic test for NiPoint3 functionality
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
TEST(dCommonTests, NiPoint3Test) {
|
2022-01-03 15:00:21 +00:00
|
|
|
// Check that Unitize works
|
2024-01-29 07:53:12 +00:00
|
|
|
ASSERT_EQ(NiPoint3(3, 0, 0).Unitize(), NiPoint3Constant::UNIT_X);
|
2022-01-03 15:00:21 +00:00
|
|
|
// Check what unitize does to a vector of length 0
|
2024-01-29 07:53:12 +00:00
|
|
|
ASSERT_EQ(NiPoint3Constant::ZERO.Unitize(), NiPoint3Constant::ZERO);
|
2022-01-03 15:00:21 +00:00
|
|
|
}
|
2023-07-31 07:22:56 +00:00
|
|
|
|
|
|
|
TEST(dCommonTests, NiPoint3OperatorTest) {
|
|
|
|
NiPoint3 a(1, 2, 3);
|
|
|
|
NiPoint3 b(4, 5, 6);
|
|
|
|
a += b;
|
|
|
|
EXPECT_FLOAT_EQ(a.x, 5);
|
|
|
|
EXPECT_FLOAT_EQ(a.y, 7);
|
|
|
|
EXPECT_FLOAT_EQ(a.z, 9);
|
|
|
|
}
|