summaryrefslogtreecommitdiff
path: root/test/test-geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-12-18 17:24:02 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-12-18 17:24:02 +0000
commita007ffeed3cfa6af2cbe1053c330ad11927d58de (patch)
tree8b97f30bda1e49ee12191e11f68145b2c4dc5e88 /test/test-geoData.cpp
parentMidpoint for integral vectors (diff)
downloadilt-a007ffeed3cfa6af2cbe1053c330ad11927d58de.tar.bz2
ilt-a007ffeed3cfa6af2cbe1053c330ad11927d58de.tar.xz
ilt-a007ffeed3cfa6af2cbe1053c330ad11927d58de.zip
Add sanity checking logic to GeoData
Diffstat (limited to 'test/test-geoData.cpp')
-rw-r--r--test/test-geoData.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp
index 5998789..9ec4656 100644
--- a/test/test-geoData.cpp
+++ b/test/test-geoData.cpp
@@ -29,11 +29,9 @@ BOOST_AUTO_TEST_CASE(loadSuccess)
BOOST_CHECK_EQUAL(upper, GlobalPosition3D(319950000, 499950000, 571600));
}
-BOOST_AUTO_TEST_CASE(normalsAllPointUp)
+BOOST_AUTO_TEST_CASE(sanityCheck)
{
- BOOST_CHECK(std::ranges::all_of(vertices(), [this](auto && vertex) {
- return normal(vertex).z > 0;
- }));
+ BOOST_CHECK_NO_THROW(sanityCheck());
}
BOOST_AUTO_TEST_CASE(trianglesContainsPoints)
@@ -214,9 +212,7 @@ BOOST_DATA_TEST_CASE(deform, loadFixtureJson<DeformTerrainData>("geoData/deform/
surface.colorBias = RGB {0, 0, 1};
auto gd = std::make_shared<GeoData>(GeoData::createFlat({0, 0}, {1000000, 1000000}, 100));
BOOST_CHECK_NO_THROW(gd->setHeights(points, {.surface = surface}));
- BOOST_CHECK(std::ranges::all_of(gd->vertices(), [&gd](auto && vertex) {
- return gd->normal(vertex).z > 0;
- }));
+ BOOST_CHECK_NO_THROW(gd->sanityCheck());
ApplicationBase ab;
TestMainWindow tmw;