Skip to content

Commit 69c4a68

Browse files
committed
Merge branch 'fix_test_2' into 'master'
Reduce precision for random point distance comparison (#8260) See merge request OpenMW/openmw!4486
2 parents 3e8ea80 + a00909d commit 69c4a68

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/components_tests/detournavigator/navigator.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,13 @@ namespace
610610
const auto result = findRandomPointAroundCircle(
611611
*mNavigator, mAgentBounds, mStart, 100.0, Flag_walk, []() { return Misc::Rng::rollClosedProbability(); });
612612

613-
ASSERT_THAT(result, Optional(Vec3fEq(70.35845947265625, 335.592041015625, -2.6667339801788330078125, 1)))
614-
<< (result ? *result : osg::Vec3f());
613+
ASSERT_TRUE(result.has_value());
614+
615+
EXPECT_THAT(*result, Vec3fEq(70.35845947265625, 335.592041015625, -2.6667339801788330078125, 1)) << *result;
615616

616617
const auto distance = (*result - mStart).length();
617618

618-
EXPECT_FLOAT_EQ(distance, 125.80865478515625) << distance;
619+
EXPECT_NEAR(distance, 125.80865478515625, 1) << distance;
619620
}
620621

621622
TEST_F(DetourNavigatorNavigatorTest, multiple_threads_should_lock_tiles)

0 commit comments

Comments
 (0)