Skip to content

Commit 356c530

Browse files
committed
Merge branch 'fix_test' into 'master'
Reduce precision for random point position comparison (#8260) Closes #8260 See merge request OpenMW/openmw!4483
2 parents 82a8e63 + 054d5ec commit 356c530

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/components_tests/detournavigator/navigator.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ MATCHER_P3(Vec3fEq, x, y, z, "")
3333
return std::abs(arg.x() - x) < 1e-3 && std::abs(arg.y() - y) < 1e-3 && std::abs(arg.z() - z) < 1e-3;
3434
}
3535

36+
MATCHER_P4(Vec3fEq, x, y, z, precision, "")
37+
{
38+
return std::abs(arg.x() - x) < precision && std::abs(arg.y() - y) < precision && std::abs(arg.z() - z) < precision;
39+
}
40+
3641
namespace
3742
{
3843
using namespace testing;
@@ -605,7 +610,7 @@ namespace
605610
const auto result = findRandomPointAroundCircle(
606611
*mNavigator, mAgentBounds, mStart, 100.0, Flag_walk, []() { return Misc::Rng::rollClosedProbability(); });
607612

608-
ASSERT_THAT(result, Optional(Vec3fEq(70.35845947265625, 335.592041015625, -2.6667339801788330078125)))
613+
ASSERT_THAT(result, Optional(Vec3fEq(70.35845947265625, 335.592041015625, -2.6667339801788330078125, 1)))
609614
<< (result ? *result : osg::Vec3f());
610615

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

0 commit comments

Comments
 (0)