diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-09 18:25:39 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-09 18:25:39 +0000 |
commit | 001be698401ef488cb3d30fb71c1a13c809407c8 (patch) | |
tree | 25f2f2634fcd7432092aa07f644dd00d1293f8d9 /test | |
parent | Add a generic persistence perf test (diff) | |
parent | Rewrite asset factory cylinder generator (diff) | |
download | ilt-001be698401ef488cb3d30fb71c1a13c809407c8.tar.bz2 ilt-001be698401ef488cb3d30fb71c1a13c809407c8.tar.xz ilt-001be698401ef488cb3d30fb71c1a13c809407c8.zip |
Merge branch 'model-factory-fixup'
Diffstat (limited to 'test')
-rw-r--r-- | test/test-assetFactory.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp index ae5a88a..204ffb3 100644 --- a/test/test-assetFactory.cpp +++ b/test/test-assetFactory.cpp @@ -21,7 +21,7 @@ BOOST_GLOBAL_FIXTURE(ApplicationBase); BOOST_GLOBAL_FIXTURE(TestMainWindow); const std::filesystem::path TMP {"/tmp"}; -class FactoryFixture : public TestRenderOutputSize<glm::ivec2 {2048, 2048}>, public SceneProvider { +class FactoryFixture : public TestRenderOutputSize<glm::ivec2 {2048, 1024}>, public SceneProvider { public: FactoryFixture() : sceneRenderer {size, output} { } ~FactoryFixture() @@ -45,8 +45,8 @@ public: void environment(const SceneShader &, const SceneRenderer & sceneRenderer) const override { - sceneRenderer.setAmbientLight({.2, .2, .2}); - sceneRenderer.setDirectionalLight({.3, .3, .3}, east + south + south + down, *this); + sceneRenderer.setAmbientLight({.4, .4, .4}); + sceneRenderer.setDirectionalLight({.6, .6, .6}, east + south + south + down, *this); } void shadows(const ShadowMapper & mapper) const override @@ -57,7 +57,7 @@ public: void render(float dist = 10.f) { - sceneRenderer.camera.setView({dist, dist, dist}, south + west + down); + sceneRenderer.camera.setView({-dist, dist * 1.2f, dist * 1.2f}, south + east + down); sceneRenderer.render(*this); } Collection<const Renderable> objects; @@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE(brush47xml) { auto mf = AssetFactory::loadXML(RESDIR "/brush47.xml"); BOOST_REQUIRE(mf); - BOOST_REQUIRE_EQUAL(6, mf->shapes.size()); + BOOST_REQUIRE_GE(mf->shapes.size(), 6); BOOST_CHECK(mf->shapes.at("plane")); BOOST_CHECK(mf->shapes.at("cylinder")); BOOST_CHECK(mf->shapes.at("cuboid")); @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(brush47xml) auto bogie = mf->shapes.at("bogie"); BOOST_REQUIRE(bogie); auto bogieObj = std::dynamic_pointer_cast<const Object>(bogie); - BOOST_CHECK_EQUAL(3, bogieObj->uses.size()); + BOOST_CHECK_GE(bogieObj->uses.size(), 3); BOOST_CHECK_EQUAL(1, mf->assets.size()); auto brush47 = mf->assets.at("brush-47"); BOOST_REQUIRE(brush47); @@ -93,7 +93,7 @@ BOOST_AUTO_TEST_CASE(brush47xml) auto railVehicle = std::make_shared<RailVehicle>(brush47rvc); objects.objects.push_back(railVehicle); - render(20); + render(); } BOOST_AUTO_TEST_SUITE_END(); |