diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-02-09 20:14:51 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-02-09 20:14:54 +0000 |
commit | 42e16ad8ad853c6e97d7eb6718ee0f78b868be30 (patch) | |
tree | 3a91a5922b3557132da271339a665576a7ad714a /test/test-geoData.cpp | |
parent | Split GeoData mesh basics into a subclass (diff) | |
download | ilt-42e16ad8ad853c6e97d7eb6718ee0f78b868be30.tar.bz2 ilt-42e16ad8ad853c6e97d7eb6718ee0f78b868be30.tar.xz ilt-42e16ad8ad853c6e97d7eb6718ee0f78b868be30.zip |
Combine GeoData and Terrain class hierarchies
Diffstat (limited to 'test/test-geoData.cpp')
-rw-r--r-- | test/test-geoData.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp index dbf5f29..4979327 100644 --- a/test/test-geoData.cpp +++ b/test/test-geoData.cpp @@ -244,15 +244,13 @@ BOOST_DATA_TEST_CASE(deform, loadFixtureJson<DeformTerrainData>("geoData/deform/ { Surface surface; 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})); ApplicationBase ab; TestMainWindow tmw; TestRenderOutput tro {{640, 480}}; struct TestTerrain : public SceneProvider { - explicit TestTerrain(std::shared_ptr<GeoData> gd) : terrain(std::move(gd)) { } + explicit TestTerrain(GeoData gd) : terrain(std::move(gd)) { } const Terrain terrain; @@ -281,7 +279,11 @@ BOOST_DATA_TEST_CASE(deform, loadFixtureJson<DeformTerrainData>("geoData/deform/ } }; - TestTerrain t {gd}; + TestTerrain t {[&points, &surface]() { + auto gd = GeoData::createFlat({0, 0}, {1000000, 1000000}, 100); + BOOST_CHECK_NO_THROW(gd.setHeights(points, {.surface = &surface})); + return gd; + }()}; SceneRenderer ss {tro.size, tro.output}; std::for_each(cams.begin(), cams.end(), [&ss, &t, &tro](const auto & cam) { ss.camera.setView(cam.first.first, glm::normalize(cam.first.second)); |