summaryrefslogtreecommitdiff
path: root/test/test-geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-12-02 16:38:12 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-12-02 16:38:12 +0000
commit9ae29335b72b6db037a78428ff8493d1fb587103 (patch)
tree5186de52cfd70a6ebb05dfadc1e9b25d20d7040f /test/test-geoData.cpp
parentHandle the case where the ray never enters the map (diff)
downloadilt-9ae29335b72b6db037a78428ff8493d1fb587103.tar.bz2
ilt-9ae29335b72b6db037a78428ff8493d1fb587103.tar.xz
ilt-9ae29335b72b6db037a78428ff8493d1fb587103.zip
Test case for finding ray entry points
Diffstat (limited to 'test/test-geoData.cpp')
-rw-r--r--test/test-geoData.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp
index 164a6a5..d1c6b8b 100644
--- a/test/test-geoData.cpp
+++ b/test/test-geoData.cpp
@@ -186,3 +186,16 @@ BOOST_DATA_TEST_CASE(walkTerrainUntil,
}));
BOOST_CHECK_EQUAL_COLLECTIONS(visited.begin(), visited.end(), visits.begin(), visits.end());
}
+
+using FindEntiesData = std::tuple<GlobalPosition2D, GlobalPosition2D, int>;
+
+BOOST_DATA_TEST_CASE(findEntries,
+ boost::unit_test::data::make<FindEntiesData>({
+ {{307739360, 494851616}, {314056992, 500079744}, 160667},
+ {{308597952, 498417056}, {315154144, 504671456}, 233623},
+ {{302690592, 502270912}, {311585184, 497868064}, 207311},
+ }),
+ from, to, heh)
+{
+ BOOST_CHECK_EQUAL(fixedTerrtain.findEntry(from, to).idx(), heh);
+}