mirror of https://github.com/OpenRCT2/OpenRCT2.git
![]() Introduce some basic scenario-style tests for the pathfinding AI. There are two tests: * Test that a peep can get from a given start position to a given end position, and that it takes them an expected number of ticks to do so. Also test that they did not walk on any 'forbidden' tiles in the process, e.g. tiles that are completely the wrong direction from the goal etc. * Test that a peep can *not* get from a given start position to a given end position after a given number of ticks. Each test is parametric, and instantiated for multiple different start/end positions within the provided test park. If we find a new situation that needs a test, it should just be a matter of building that situation in the saved game and then adding a line to the code to set it up. Indicating 'forbidden' tiles is done using terrain surface type IDs: tiles that the pathfinder should never send the peep into should be painted with the red neon surface type (index 8). This means we have no way to forbid some path elements on a tile while allowing others, but we don't need that right now. Similarly, to help ensure that the test data and code are kept in sync, the tests also require that peep start tiles are painted with the green neon surface type (index 11) and that goal tiles are painted with the yellow neon surface type (index 9). |
||
---|---|---|
.. | ||
helpers | ||
testdata | ||
AssertHelpers.hpp | ||
CMakeLists.txt | ||
CryptTests.cpp | ||
ImageImporterTests.cpp | ||
IniReaderTest.cpp | ||
IniWriterTest.cpp | ||
LanguagePackTest.cpp | ||
Localisation.cpp | ||
MultiLaunch.cpp | ||
Pathfinding.cpp | ||
ReplayTests.cpp | ||
RideRatings.cpp | ||
StringTest.cpp | ||
TestData.cpp | ||
TestData.h | ||
TileElements.cpp | ||
sawyercoding_test.cpp | ||
tests.cpp | ||
tests.vcxproj |