From f39019c7f12d2eaa90f8b56709df47bb35773e8e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 9 Mar 2023 01:01:52 +0000 Subject: Hugely more detailed Brush47 model and revision to test case details Specifically, this includes the buffer block, which is a rotated cuboid with an extrusion. This feature breaks the current mesh creation code... Fix coming up. --- test/test-assetFactory.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test') 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, public SceneProvider { +class FactoryFixture : public TestRenderOutputSize, 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 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(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(brush47rvc); objects.objects.push_back(railVehicle); - render(20); + render(); } BOOST_AUTO_TEST_SUITE_END(); -- cgit v1.2.3