summaryrefslogtreecommitdiff
path: root/test/test-geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-11-27 02:50:06 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-11-27 02:50:06 +0000
commit2e1a91564c4765dbdc3f633ba0ff8a4af7164503 (patch)
tree9b7d9890df268a2766a3aa880ccd8d8489cd8b8c /test/test-geoData.cpp
parentSurface walk to set face surface property (diff)
downloadilt-2e1a91564c4765dbdc3f633ba0ff8a4af7164503.tar.bz2
ilt-2e1a91564c4765dbdc3f633ba0ff8a4af7164503.tar.xz
ilt-2e1a91564c4765dbdc3f633ba0ff8a4af7164503.zip
Update new/moved vertex normals
Diffstat (limited to 'test/test-geoData.cpp')
-rw-r--r--test/test-geoData.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp
index 17e1741..2f3d215 100644
--- a/test/test-geoData.cpp
+++ b/test/test-geoData.cpp
@@ -31,11 +31,9 @@ BOOST_AUTO_TEST_CASE(loadSuccess)
BOOST_AUTO_TEST_CASE(normalsAllPointUp)
{
- BOOST_CHECK_EQUAL(std::count_if(vertices_begin(), vertices_end(),
- [this](auto && vh) {
- return normal(vh).z > 0;
- }),
- n_vertices());
+ BOOST_CHECK(std::ranges::all_of(vertices(), [this](auto && vertex) {
+ return normal(vertex).z > 0;
+ }));
}
BOOST_AUTO_TEST_CASE(trianglesContainsPoints)
@@ -233,6 +231,9 @@ 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;
+ }));
ApplicationBase ab;
TestMainWindow tmw;