summaryrefslogtreecommitdiff
path: root/test/test-geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-12-30 17:18:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-12-30 17:18:26 +0000
commit89068c56f3236b65e392cdc8794c5bc1977e5556 (patch)
tree1f500606ea7754dd1a62afee984e88b473c085b2 /test/test-geoData.cpp
parentFix naming style of getSurface (diff)
downloadilt-89068c56f3236b65e392cdc8794c5bc1977e5556.tar.bz2
ilt-89068c56f3236b65e392cdc8794c5bc1977e5556.tar.xz
ilt-89068c56f3236b65e392cdc8794c5bc1977e5556.zip
Pass lots more information during GeoData::walk
Diffstat (limited to 'test/test-geoData.cpp')
-rw-r--r--test/test-geoData.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp
index 589f675..dd68375 100644
--- a/test/test-geoData.cpp
+++ b/test/test-geoData.cpp
@@ -148,8 +148,11 @@ BOOST_DATA_TEST_CASE(walkTerrain,
from, to, visits)
{
std::vector<int> visited;
- BOOST_CHECK_NO_THROW(fixedTerrtain.walk(from, to, [&visited](auto fh) {
- visited.emplace_back(fh.idx());
+ BOOST_CHECK_NO_THROW(fixedTerrtain.walk(from, to, [&visited](auto step) {
+ if (!visited.empty()) {
+ BOOST_CHECK_EQUAL(step.previous.idx(), visited.back());
+ }
+ visited.emplace_back(step.current.idx());
}));
BOOST_CHECK_EQUAL_COLLECTIONS(visited.begin(), visited.end(), visits.begin(), visits.end());
}
@@ -181,8 +184,8 @@ BOOST_DATA_TEST_CASE(walkTerrainUntil,
from, to, visits)
{
std::vector<int> visited;
- BOOST_CHECK_NO_THROW(fixedTerrtain.walkUntil(from, to, [&visited](auto fh) {
- visited.emplace_back(fh.idx());
+ BOOST_CHECK_NO_THROW(fixedTerrtain.walkUntil(from, to, [&visited](const auto & step) {
+ visited.emplace_back(step.current.idx());
return visited.size() >= 5;
}));
BOOST_CHECK_EQUAL_COLLECTIONS(visited.begin(), visited.end(), visits.begin(), visits.end());