mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 06:27:24 +00:00
a0d51e21ca
* allow usage of NiPoint3 and NiQuaternion in constexpr context * removed .cpp files entirely * moving circular dependency circumvention stuff to an .inl file * real world usage!!!!! * reverting weird branch cross-pollination * removing more weird branch cross-pollination * remove comment * added inverse header guard to inl file * Update NiPoint3.inl * trying different constructor syntax * reorganize into .inl files for readability * uncomment include * moved non-constexpr definitions to cpp file * moved static definitions back to inl files * testing fix * moved constants into seperate namespace * Undo change in build-and-test.yml * nodiscard
24 lines
540 B
C++
24 lines
540 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include "NiPoint3.h"
|
|
|
|
/**
|
|
* @brief Basic test for NiPoint3 functionality
|
|
*
|
|
*/
|
|
TEST(dCommonTests, NiPoint3Test) {
|
|
// Check that Unitize works
|
|
ASSERT_EQ(NiPoint3(3, 0, 0).Unitize(), NiPoint3Constant::UNIT_X);
|
|
// Check what unitize does to a vector of length 0
|
|
ASSERT_EQ(NiPoint3Constant::ZERO.Unitize(), NiPoint3Constant::ZERO);
|
|
}
|
|
|
|
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);
|
|
}
|