summaryrefslogtreecommitdiff
path: root/test/test-assetFactory.cpp
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/test-assetFactory.cpp
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/test-assetFactory.cpp')
-rw-r--r--test/test-assetFactory.cpp15
1 files changed, 15 insertions, 0 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))