FunctionsTest: add isFinite() tests with Vector3f arguments

This commit is contained in:
Matthias Grob 2022-10-18 17:28:57 +02:00
parent 5ca28dd6dc
commit 870229ef49
1 changed files with 14 additions and 0 deletions

View File

@ -224,3 +224,17 @@ TEST(FunctionsTest, countSetBits)
EXPECT_EQ(countSetBits(0xffffffffu), 32);
EXPECT_EQ(countSetBits(754323), 9);
}
TEST(FunctionsTest, isFiniteVector3f)
{
EXPECT_TRUE(isFinite(matrix::Vector3f()));
EXPECT_TRUE(isFinite(matrix::Vector3f(0.f, 1.f, 2.f)));
EXPECT_FALSE(isFinite(matrix::Vector3f(0.f, 0.f, INFINITY)));
EXPECT_FALSE(isFinite(matrix::Vector3f(0.f, 0.f, NAN)));
EXPECT_FALSE(isFinite(matrix::Vector3f(0.f, NAN, 0.f)));
EXPECT_FALSE(isFinite(matrix::Vector3f(0.f, NAN, NAN)));
EXPECT_FALSE(isFinite(matrix::Vector3f(NAN, 0.f, 0.f)));
EXPECT_FALSE(isFinite(matrix::Vector3f(NAN, 0.f, NAN)));
EXPECT_FALSE(isFinite(matrix::Vector3f(NAN, NAN, 0.f)));
EXPECT_FALSE(isFinite(matrix::Vector3f(NAN, NAN, NAN)));
}