mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 17:39:42 +00:00
Make test for navmeshdb limit less strict
To avoid rare test failures when tiles are added into the database in different order.
This commit is contained in:
parent
e32bcb4ba0
commit
b56de5bcf9
1 changed files with 12 additions and 21 deletions
|
@ -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…
Reference in a new issue