summaryrefslogtreecommitdiff
path: root/test/test-terrain.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-10-31 02:40:03 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-10-31 02:40:03 +0000
commita4f1c55ad34f6be9adc9573fd7f26507ae2c59b0 (patch)
tree3c326fd8196ac87254bfa5fb4290a0f1a8142909 /test/test-terrain.cpp
parentHelper type for storing/passing/returning a point and its containing face (diff)
downloadilt-a4f1c55ad34f6be9adc9573fd7f26507ae2c59b0.tar.bz2
ilt-a4f1c55ad34f6be9adc9573fd7f26507ae2c59b0.tar.xz
ilt-a4f1c55ad34f6be9adc9573fd7f26507ae2c59b0.zip
Update walk/walkUntil to work on PointFace from parameter
Diffstat (limited to 'test/test-terrain.cpp')
-rw-r--r--test/test-terrain.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test-terrain.cpp b/test/test-terrain.cpp
index f737f4f..bf30179 100644
--- a/test/test-terrain.cpp
+++ b/test/test-terrain.cpp
@@ -96,6 +96,20 @@ BOOST_DATA_TEST_CASE(walkTerrain,
BOOST_CHECK_EQUAL_COLLECTIONS(visited.begin(), visited.end(), visits.begin(), visits.end());
}
+BOOST_DATA_TEST_CASE(walkTerrainSetsFromFace,
+ boost::unit_test::data::make<WalkTerrainData>({
+ {{310002, 490003}, {310002, 490003}, {0}},
+ {{310003, 490002}, {310003, 490002}, {1}},
+ {{310002, 490003}, {310003, 490002}, {0, 1}},
+ {{310003, 490002}, {310002, 490003}, {1, 0}},
+ }),
+ from, to, visits)
+{
+ TerrainMesh::PointFace pf {from};
+ BOOST_CHECK_NO_THROW(fixedTerrtain.walk(pf, to, [](auto) {}));
+ BOOST_CHECK_EQUAL(pf.face.idx(), visits.front());
+}
+
BOOST_DATA_TEST_CASE(walkTerrainUntil,
boost::unit_test::data::make<WalkTerrainData>({
{{310002, 490003}, {310002, 490003}, {0}},