summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-08-18 16:05:05 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-18 16:05:05 +0100
commit1bbbdfe0d9e9e7a4e42241a2eb596b46ac02c65b (patch)
tree1791a51d47d4547b92317f68a6752a458a1542c1 /test
parentOffset shaded position to reduce chance of self-shadowing (diff)
downloadilt-1bbbdfe0d9e9e7a4e42241a2eb596b46ac02c65b.tar.bz2
ilt-1bbbdfe0d9e9e7a4e42241a2eb596b46ac02c65b.tar.xz
ilt-1bbbdfe0d9e9e7a4e42241a2eb596b46ac02c65b.zip
Populate GameState::assets in appropriate tests
Diffstat (limited to 'test')
-rw-r--r--test/test-assetFactory.cpp3
-rw-r--r--test/testRenderOutput.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp
index 1c2c417..0b5b278 100644
--- a/test/test-assetFactory.cpp
+++ b/test/test-assetFactory.cpp
@@ -97,6 +97,7 @@ BOOST_AUTO_TEST_CASE(brush47xml, *boost::unit_test::timeout(5))
{
auto mf = AssetFactory::loadXML(RESDIR "/brush47.xml");
BOOST_REQUIRE(mf);
+ gameState.assets = mf->assets;
BOOST_REQUIRE_GE(mf->shapes.size(), 6);
BOOST_CHECK(mf->shapes.at("plane"));
BOOST_CHECK(mf->shapes.at("cylinder"));
@@ -126,6 +127,7 @@ BOOST_AUTO_TEST_CASE(foliage, *boost::unit_test::timeout(5))
{
auto mf = AssetFactory::loadXML(RESDIR "/foliage.xml");
BOOST_REQUIRE(mf);
+ gameState.assets = mf->assets;
auto tree_01_1 = mf->assets.at("Tree-01-1");
BOOST_REQUIRE(tree_01_1);
auto tree_01_1_f = std::dynamic_pointer_cast<Foliage>(tree_01_1);
@@ -144,6 +146,7 @@ BOOST_AUTO_TEST_CASE(lights, *boost::unit_test::timeout(5))
{
auto mf = AssetFactory::loadXML(RESDIR "/lights.xml");
BOOST_REQUIRE(mf);
+ gameState.assets = mf->assets;
auto rlight = mf->assets.at("r-light");
BOOST_REQUIRE(rlight);
auto oldlamp = mf->assets.at("old-lamp");
diff --git a/test/testRenderOutput.h b/test/testRenderOutput.h
index 056d029..79908b1 100644
--- a/test/testRenderOutput.h
+++ b/test/testRenderOutput.h
@@ -1,6 +1,7 @@
#pragma once
#include "config/types.h"
+#include "game/gamestate.h"
#include "glArrays.h"
#include <glm/vec2.hpp>
#include <special_members.h>
@@ -17,6 +18,7 @@ public:
glFrameBuffer output;
glRenderBuffer depth;
glTexture outImage;
+ GameState gameState;
};
template<TextureAbsCoord Size> class TestRenderOutputSize : public TestRenderOutput {