diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-04 19:09:58 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-04 19:09:58 +0000 |
commit | 9ab1214aca7d77e1083476b05c6ddc2bb351bbac (patch) | |
tree | 24fe57b5a21a9ca3f0bd15f1ed47ae6bd261f92b /test/test-geoData.cpp | |
parent | Simplify some logic with the triangle construct (diff) | |
download | ilt-9ab1214aca7d77e1083476b05c6ddc2bb351bbac.tar.bz2 ilt-9ab1214aca7d77e1083476b05c6ddc2bb351bbac.tar.xz ilt-9ab1214aca7d77e1083476b05c6ddc2bb351bbac.zip |
More tests can just use the global fixed data
Diffstat (limited to 'test/test-geoData.cpp')
-rw-r--r-- | test/test-geoData.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp index b33c61e..258bd9c 100644 --- a/test/test-geoData.cpp +++ b/test/test-geoData.cpp @@ -49,27 +49,27 @@ BOOST_AUTO_TEST_CASE(trianglesContainsPoints) } } +BOOST_AUTO_TEST_SUITE_END(); + +static const TestTerrainMesh fixedTerrtain; + BOOST_AUTO_TEST_CASE(locatePointFace) { - const PointFace pf {{310002, 490003}}; + const GeoData::PointFace pf {{310002, 490003}}; BOOST_CHECK(!pf.isLocated()); - BOOST_CHECK(pf.face(this).is_valid()); - BOOST_CHECK_EQUAL(pf.face(this).idx(), 0); + BOOST_CHECK(pf.face(&fixedTerrtain).is_valid()); + BOOST_CHECK_EQUAL(pf.face(&fixedTerrtain).idx(), 0); } BOOST_AUTO_TEST_CASE(preLocatePointFace) { - const PointFace pf {{310002, 490003}, this}; + const GeoData::PointFace pf {{310002, 490003}, &fixedTerrtain}; BOOST_CHECK(pf.isLocated()); - BOOST_CHECK_EQUAL(pf.face(this).idx(), 0); + BOOST_CHECK_EQUAL(pf.face(&fixedTerrtain).idx(), 0); } -BOOST_AUTO_TEST_SUITE_END(); - using FindPointData = std::tuple<glm::vec2, int>; -static const TestTerrainMesh fixedTerrtain; - // No boundary cases as these can produce different valid results depending on starting point BOOST_DATA_TEST_CASE(findPointOnTerrain, boost::unit_test::data::make<FindPointData>({ |