Merge branch 'less_strict_test' into 'master'

Make test for navmeshdb limit less strict

See merge request OpenMW/openmw!4306
pull/3236/head
psi29a 5 months ago
commit 761957d28c

@ -266,20 +266,11 @@ namespace
updater.post(mAgentBounds, navMeshCacheItem, mPlayerTile, mWorldspace, changedTiles); updater.post(mAgentBounds, navMeshCacheItem, mPlayerTile, mWorldspace, changedTiles);
updater.wait(WaitConditionType::allJobsDone, &mListener); updater.wait(WaitConditionType::allJobsDone, &mListener);
updater.stop(); updater.stop();
const std::set<TilePosition> present{
TilePosition(-1, -1), std::size_t present = 0;
TilePosition(-1, 0),
TilePosition(-1, 1),
TilePosition(0, -2),
TilePosition(0, -1),
TilePosition(0, 0),
TilePosition(0, 1),
TilePosition(0, 2),
TilePosition(1, -1),
TilePosition(1, 0),
TilePosition(1, 1),
};
for (int x = -5; x <= 5; ++x) for (int x = -5; x <= 5; ++x)
{
for (int y = -5; y <= 5; ++y) for (int y = -5; y <= 5; ++y)
{ {
const TilePosition tilePosition(x, y); const TilePosition tilePosition(x, y);
@ -289,15 +280,15 @@ namespace
recastMesh->getMeshSources(), [&](const MeshSource& v) { return resolveMeshSource(*dbPtr, v); }); recastMesh->getMeshSources(), [&](const MeshSource& v) { return resolveMeshSource(*dbPtr, v); });
if (std::holds_alternative<MeshSource>(objects)) if (std::holds_alternative<MeshSource>(objects))
continue; continue;
EXPECT_EQ(dbPtr present += dbPtr
->findTile(mWorldspace, tilePosition, ->findTile(mWorldspace, tilePosition,
serialize(mSettings.mRecast, mAgentBounds, *recastMesh, serialize(mSettings.mRecast, mAgentBounds, *recastMesh,
std::get<std::vector<DbRefGeometryObject>>(objects))) std::get<std::vector<DbRefGeometryObject>>(objects)))
.has_value(), .has_value();
present.find(tilePosition) != present.end())
<< tilePosition.x() << " " << tilePosition.y()
<< " present=" << (present.find(tilePosition) != present.end());
} }
}
EXPECT_EQ(present, 11);
} }
TEST_F(DetourNavigatorAsyncNavMeshUpdaterTest, next_tile_id_should_be_updated_on_duplicate) TEST_F(DetourNavigatorAsyncNavMeshUpdaterTest, next_tile_id_should_be_updated_on_duplicate)

Loading…
Cancel
Save