summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-05-27 13:44:08 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-05-27 13:44:08 +0100
commitad85d0843dc80d195120dd53dd4a8deee004af4b (patch)
tree420723815ac6753441f14fe51836555de5551a19 /test
parentMerge branch 'separate-water' (diff)
parentSurface asset test doesn't need render dump (diff)
downloadilt-ad85d0843dc80d195120dd53dd4a8deee004af4b.tar.bz2
ilt-ad85d0843dc80d195120dd53dd4a8deee004af4b.tar.xz
ilt-ad85d0843dc80d195120dd53dd4a8deee004af4b.zip
Merge remote-tracking branch 'origin/terrain-surfaces'
Diffstat (limited to 'test')
-rw-r--r--test/test-assetFactory.cpp15
-rw-r--r--test/test-geoData.cpp4
2 files changed, 18 insertions, 1 deletions
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp
index 8341fbf..73370c8 100644
--- a/test/test-assetFactory.cpp
+++ b/test/test-assetFactory.cpp
@@ -12,6 +12,7 @@
#include "game/scenary/illuminator.h"
#include "game/scenary/light.h"
#include "game/scenary/plant.h"
+#include "game/surface.h"
#include "game/vehicles/railVehicle.h"
#include "game/vehicles/railVehicleClass.h"
#include "gfx/gl/sceneRenderer.h"
@@ -78,6 +79,20 @@ private:
SceneRenderer sceneRenderer;
};
+BOOST_AUTO_TEST_CASE(surfaces, *boost::unit_test::timeout(5))
+{
+ auto mf = AssetFactory::loadXML(RESDIR "/surfaces.xml");
+ BOOST_REQUIRE(mf);
+ BOOST_CHECK_EQUAL(4, mf->assets.size());
+ auto gravelAsset = mf->assets.at("terrain.surface.gravel");
+ BOOST_REQUIRE(gravelAsset);
+ auto gravel = std::dynamic_pointer_cast<Surface>(gravelAsset);
+ BOOST_REQUIRE(gravel);
+ BOOST_REQUIRE_EQUAL(gravel->name, "Gravel");
+ BOOST_REQUIRE_EQUAL(gravel->colorBias, RGB {.9F});
+ BOOST_REQUIRE_EQUAL(gravel->quality, 1.F);
+}
+
BOOST_FIXTURE_TEST_SUITE(m, FactoryFixture);
BOOST_AUTO_TEST_CASE(brush47xml, *boost::unit_test::timeout(5))
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp
index fb9aba0..11d634d 100644
--- a/test/test-geoData.cpp
+++ b/test/test-geoData.cpp
@@ -229,8 +229,10 @@ BOOST_TEST_DECORATOR(*boost::unit_test::timeout(2));
BOOST_DATA_TEST_CASE(deform, loadFixtureJson<DeformTerrainData>("geoData/deform/1.json"), points, cams)
{
+ 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));
+ BOOST_CHECK_NO_THROW(gd->setHeights(points, surface));
ApplicationBase ab;
TestMainWindow tmw;