diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-06 20:32:32 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-06 20:32:32 +0000 |
| commit | f6fc7a1edc5fe93bf67278f23734dd7d698789f8 (patch) | |
| tree | 94eb0a812b66d3e88703f77615a4616df2d64820 /test | |
| parent | Merge branch 'glmax' (diff) | |
| download | ilt-f6fc7a1edc5fe93bf67278f23734dd7d698789f8.tar.bz2 ilt-f6fc7a1edc5fe93bf67278f23734dd7d698789f8.tar.xz ilt-f6fc7a1edc5fe93bf67278f23734dd7d698789f8.zip | |
Diffstat (limited to 'test')
| -rw-r--r-- | test/fixtures/geoData/deform/1.json | 14 | ||||
| -rw-r--r-- | test/test-geoData-counts.cpp | 3 | ||||
| -rw-r--r-- | test/test-geoData.cpp | 7 | ||||
| -rw-r--r-- | test/test-render.cpp | 8 | ||||
| -rw-r--r-- | test/test-ui.cpp | 3 |
5 files changed, 20 insertions, 15 deletions
diff --git a/test/fixtures/geoData/deform/1.json b/test/fixtures/geoData/deform/1.json index 6930238..06d97c4 100644 --- a/test/fixtures/geoData/deform/1.json +++ b/test/fixtures/geoData/deform/1.json @@ -36,7 +36,7 @@ -1.5 ] ], - "/tmp/geoData0.tga" + "geoData0.tga" ], [ [ @@ -51,7 +51,7 @@ -1.5 ] ], - "/tmp/geoData1.tga" + "geoData1.tga" ], [ [ @@ -66,7 +66,7 @@ -1.5 ] ], - "/tmp/geoData2.tga" + "geoData2.tga" ] ] ], @@ -102,7 +102,7 @@ -1.5 ] ], - "/tmp/geoData3.tga" + "geoData3.tga" ], [ [ @@ -117,7 +117,7 @@ -0.5 ] ], - "/tmp/geoData4.tga" + "geoData4.tga" ] ] ], @@ -153,7 +153,7 @@ -1.5 ] ], - "/tmp/geoData5.tga" + "geoData5.tga" ] ] ], @@ -194,7 +194,7 @@ -1.5 ] ], - "/tmp/geoData6.tga" + "geoData6.tga" ] ] ] diff --git a/test/test-geoData-counts.cpp b/test/test-geoData-counts.cpp index 89f9633..f67c5e9 100644 --- a/test/test-geoData-counts.cpp +++ b/test/test-geoData-counts.cpp @@ -4,6 +4,7 @@ #include <boost/test/unit_test_suite.hpp> #include "game/geoData.h" +#include "test/testHelpers.h" using GeoMutation = std::function<void(GeoData &)>; using Something = std::tuple<const char *, GeoMutation, size_t, size_t, size_t>; @@ -57,7 +58,7 @@ BOOST_DATA_TEST_CASE(DeformLogical, auto geoData = GeoData::createFlat({0, 0}, {30'000, 30'000}, 1000); BOOST_REQUIRE_NO_THROW(func(geoData)); - OpenMesh::IO::write_mesh(geoData, std::format("/tmp/mesh-{}.obj", name)); + OpenMesh::IO::write_mesh(geoData, ANALYSIS_DIRECTORY / std::format("mesh-{}.obj", name)); BOOST_CHECK_EQUAL(geoData.n_vertices(), expVertices); BOOST_CHECK_EQUAL(geoData.n_edges(), expEdges); diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp index a697578..b3a6ad4 100644 --- a/test/test-geoData.cpp +++ b/test/test-geoData.cpp @@ -63,7 +63,10 @@ using FindPointData = std::tuple<GlobalPosition2D, int>; // 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>({ - {{0, 0}, -1}, {{XLLCORNER, 0}, -1}, {{0, YLLCORNER}, -1}, {{XLLCORNER + 1, YLLCORNER + 2}, 0}, + {{0, 0}, -1}, + {{XLLCORNER, 0}, -1}, + {{0, YLLCORNER}, -1}, + {{XLLCORNER + 1, YLLCORNER + 2}, 0}, {{XLLCORNER + (CELLSIZE * (NROWS - 1)) - 2, YLLCORNER + (CELLSIZE * (NCOLS - 1)) - 1}, 79200}, {{315555000, 495556000}, 44400}, // perf test target }) @@ -291,7 +294,7 @@ BOOST_DATA_TEST_CASE(Deform, loadFixtureJson<DeformTerrainData>("geoData/deform/ std::for_each(cams.begin(), cams.end(), [&renderer, &terrain, &tro](const auto & cam) { renderer.camera.setView(cam.first.first, glm::normalize(cam.first.second)); BOOST_CHECK_NO_THROW(renderer.render(terrain)); - Texture::save(tro.outImage, cam.second.c_str()); + Texture::save(tro.outImage, (ANALYSIS_DIRECTORY / cam.second).c_str()); }); } diff --git a/test/test-render.cpp b/test/test-render.cpp index 90fa894..073239f 100644 --- a/test/test-render.cpp +++ b/test/test-render.cpp @@ -163,8 +163,8 @@ BOOST_AUTO_TEST_CASE(Basic) renderer.camera.setView({-10000, -10000, 60000}, glm::normalize(glm::vec3 {1, 1, -0.5F})); const TestScene scene; renderer.render(scene); - renderer.saveBuffers("/tmp/basic"); - Texture::save(outImage, "/tmp/basic/final.tga"); + renderer.saveBuffers(ANALYSIS_DIRECTORY / "basic"); + Texture::save(outImage, (ANALYSIS_DIRECTORY / "basic/final.tga").c_str()); } BOOST_AUTO_TEST_CASE(TerrainSD19) @@ -204,7 +204,7 @@ BOOST_AUTO_TEST_CASE(TerrainSD19) }; renderer.render(TestTerrain {}); - Texture::save(outImage, "/tmp/terrain.tga"); + Texture::save(outImage, (ANALYSIS_DIRECTORY / "terrain.tga").c_str()); } BOOST_AUTO_TEST_CASE(RailNetwork) @@ -250,7 +250,7 @@ BOOST_AUTO_TEST_CASE(RailNetwork) }; renderer.render(TestRail {}); - Texture::save(outImage, "/tmp/railnet.tga"); + Texture::save(outImage, (ANALYSIS_DIRECTORY / "railnet.tga").c_str()); } BOOST_AUTO_TEST_SUITE_END(); diff --git a/test/test-ui.cpp b/test/test-ui.cpp index 2810cda..40c041a 100644 --- a/test/test-ui.cpp +++ b/test/test-ui.cpp @@ -2,6 +2,7 @@ #include <boost/test/unit_test.hpp> #include <stream_support.h> +#include "testHelpers.h" #include "testMainWindow.h" #include <gfx/models/texture.h> #include <resource.h> @@ -16,5 +17,5 @@ BOOST_AUTO_TEST_CASE(LoadFromFile) SvgIcon svg(ImageDimensions {RENDER_SIZE}, Resource::mapPath("ui/icon/rails.svg")); const auto size = Texture::getSize(svg.texture); BOOST_CHECK_EQUAL(size, TextureDimensions(RENDER_SIZE, RENDER_SIZE, 1)); - Texture::save(svg.texture, "/tmp/rails.tga"); + Texture::save(svg.texture, (ANALYSIS_DIRECTORY / "rails.tga").c_str()); } |
