MatrixHelperTest: don't rely on FLOAT_EQ accepting FLT_EPSILON inaccuracy

This commit is contained in:
Matthias Grob 2022-03-18 12:12:16 +01:00
parent 144697bb6a
commit 9ab99a7689
1 changed files with 4 additions and 4 deletions

View File

@ -48,11 +48,11 @@ TEST(MatrixHelperTest, Helper)
EXPECT_FLOAT_EQ(wrap(-1., 30., 40.), 39.);
EXPECT_FLOAT_EQ(wrap(-8000., -555., 1.), -216.);
EXPECT_FLOAT_EQ(wrap(0., 0., 360.), 0.);
EXPECT_FLOAT_EQ(wrap(0. - FLT_EPSILON, 0., 360.), 360.);
EXPECT_FLOAT_EQ(wrap(0. + FLT_EPSILON, 0., 360.), 0.);
EXPECT_FLOAT_EQ(wrap(0. - FLT_EPSILON, 0., 360.), 360. - FLT_EPSILON);
EXPECT_FLOAT_EQ(wrap(0. + FLT_EPSILON, 0., 360.), FLT_EPSILON);
EXPECT_FLOAT_EQ(wrap(360., 0., 360.), 0.);
EXPECT_FLOAT_EQ(wrap(360. - FLT_EPSILON, 0., 360.), 360.);
EXPECT_FLOAT_EQ(wrap(360. + FLT_EPSILON, 0., 360.), 0.);
EXPECT_FLOAT_EQ(wrap(360. - FLT_EPSILON, 0., 360.), 360. - FLT_EPSILON);
EXPECT_FLOAT_EQ(wrap(360. + FLT_EPSILON, 0., 360.), FLT_EPSILON);
// integer wraps
EXPECT_EQ(wrap(-10, 0, 10), 0);