summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test-assetFactory.cpp14
-rw-r--r--test/test-geo.cpp10
-rw-r--r--test/test-render.cpp26
3 files changed, 25 insertions, 25 deletions
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp
index 9af08cb..c8183df 100644
--- a/test/test-assetFactory.cpp
+++ b/test/test-assetFactory.cpp
@@ -64,7 +64,7 @@ public:
}
void
- render(float dist = 10.f)
+ render(float dist)
{
sceneRenderer.camera.setView({-dist, dist * 1.2f, dist * 1.2f}, south + east + down);
sceneRenderer.render(*this);
@@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE(brush47xml, *boost::unit_test::timeout(5))
auto railVehicle = std::make_shared<RailVehicle>(brush47rvc);
objects.objects.push_back(brush47rvc);
- render();
+ render(10000);
}
BOOST_AUTO_TEST_CASE(foliage, *boost::unit_test::timeout(5))
@@ -116,13 +116,13 @@ BOOST_AUTO_TEST_CASE(foliage, *boost::unit_test::timeout(5))
auto tree_01_1_f = std::dynamic_pointer_cast<Foliage>(tree_01_1);
BOOST_REQUIRE(tree_01_1_f);
- auto plant1 = std::make_shared<Plant>(tree_01_1_f, Location {{-2, 2, 0}, {0, 0, 0}});
- auto plant2 = std::make_shared<Plant>(tree_01_1_f, Location {{3, -4, 0}, {0, 1, 0}});
- auto plant3 = std::make_shared<Plant>(tree_01_1_f, Location {{-2, -4, 0}, {0, 2, 0}});
- auto plant4 = std::make_shared<Plant>(tree_01_1_f, Location {{3, 2, 0}, {0, 3, 0}});
+ auto plant1 = std::make_shared<Plant>(tree_01_1_f, Location {{-2000, 2000, 0}, {0, 0, 0}});
+ auto plant2 = std::make_shared<Plant>(tree_01_1_f, Location {{3000, -4000, 0}, {0, 1, 0}});
+ auto plant3 = std::make_shared<Plant>(tree_01_1_f, Location {{-2000, -4000, 0}, {0, 2, 0}});
+ auto plant4 = std::make_shared<Plant>(tree_01_1_f, Location {{3000, 2000, 0}, {0, 3, 0}});
objects.objects.push_back(tree_01_1_f);
- render(5);
+ render(6000);
}
BOOST_AUTO_TEST_SUITE_END();
diff --git a/test/test-geo.cpp b/test/test-geo.cpp
index 9874fb7..7404d32 100644
--- a/test/test-geo.cpp
+++ b/test/test-geo.cpp
@@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(initialize)
BOOST_CHECK_EQUAL(size, glm::uvec2(41, 46));
BOOST_CHECK_EQUAL(nodes.size(), 1886);
BOOST_CHECK(std::all_of(nodes.begin(), nodes.end(), [](const auto & n) {
- return n.height == -1.5F;
+ return n.height == -1500.F;
}));
}
@@ -63,12 +63,12 @@ BOOST_AUTO_TEST_CASE(gen_random)
}));
// Still an island
for (int x = limit.first.x; x <= limit.second.x; x += 1) {
- BOOST_CHECK_EQUAL(nodes[at(x, limit.first.y)].height, -1.5F);
- BOOST_CHECK_EQUAL(nodes[at(x, limit.second.y)].height, -1.5F);
+ BOOST_CHECK_EQUAL(nodes[at(x, limit.first.y)].height, -1500.F);
+ BOOST_CHECK_EQUAL(nodes[at(x, limit.second.y)].height, -1500.F);
}
for (int y = limit.first.y; y <= limit.second.y; y += 1) {
- BOOST_CHECK_EQUAL(nodes[at(limit.first.x, y)].height, -1.5F);
- BOOST_CHECK_EQUAL(nodes[at(limit.second.x, y)].height, -1.5F);
+ BOOST_CHECK_EQUAL(nodes[at(limit.first.x, y)].height, -1500.F);
+ BOOST_CHECK_EQUAL(nodes[at(limit.second.x, y)].height, -1500.F);
}
}
diff --git a/test/test-render.cpp b/test/test-render.cpp
index b16f241..766bb74 100644
--- a/test/test-render.cpp
+++ b/test/test-render.cpp
@@ -26,7 +26,7 @@ class TestScene : public SceneProvider {
std::shared_ptr<RailVehicle> train1, train2;
Terrain terrain {[]() {
- auto gd = std::make_shared<GeoData>(GeoData::Limits {{0, 0}, {100, 100}});
+ auto gd = std::make_shared<GeoData>(GeoData::Limits {{0, 0}, {100, 100}}, 10000);
gd->generateRandom();
return gd;
}()};
@@ -35,11 +35,11 @@ public:
TestScene()
{
train1 = std::make_shared<RailVehicle>(brush47rvc);
- train1->location.setPosition({52, 50, 2});
+ train1->location.setPosition({52000, 50000, 2000});
train1->bogies.front().setPosition(train1->bogies.front().position() + train1->location.position());
train1->bogies.back().setPosition(train1->bogies.back().position() + train1->location.position());
train2 = std::make_shared<RailVehicle>(brush47rvc);
- train2->location.setPosition({52, 30, 2});
+ train2->location.setPosition({52000, 30000, 2000});
train2->bogies.front().setPosition(train2->bogies.front().position() + train2->location.position());
train2->bogies.back().setPosition(train2->bogies.back().position() + train2->location.position());
}
@@ -88,7 +88,7 @@ BOOST_FIXTURE_TEST_SUITE(w, TestRenderOutput);
BOOST_AUTO_TEST_CASE(basic)
{
SceneRenderer ss {size, output};
- ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F}));
+ ss.camera.setView({-10000, -10000, 60000}, glm::normalize(glm::vec3 {1, 1, -0.5F}));
const TestScene scene;
ss.render(scene);
Texture::save(outImage, "/tmp/basic.tga");
@@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(basic)
BOOST_AUTO_TEST_CASE(pointlight)
{
SceneRenderer ss {size, output};
- ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F}));
+ ss.camera.setView({-10000, -10000, 60000}, glm::normalize(glm::vec3 {1, 1, -0.5F}));
class PointLightScene : public TestScene {
public:
@@ -111,9 +111,9 @@ BOOST_AUTO_TEST_CASE(pointlight)
void
lights(const SceneShader & shader) const override
{
- for (int x = 50; x < 100; x += 20) {
- for (int y = 50; y < 2000; y += 20) {
- shader.pointLight.add({x, y, 4}, {1.0, 1.0, 1.0}, 0.1F);
+ for (int x = 50000; x < 100000; x += 20000) {
+ for (int y = 50000; y < 2000000; y += 20000) {
+ shader.pointLight.add({x, y, 4000}, {1.0, 1.0, 1.0}, 0.1F);
}
}
}
@@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE(pointlight)
BOOST_AUTO_TEST_CASE(spotlight)
{
SceneRenderer ss {size, output};
- ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F}));
+ ss.camera.setView({-10000, -10000, 60000}, glm::normalize(glm::vec3 {1, 1, -0.5F}));
class PointLightScene : public TestScene {
public:
@@ -141,10 +141,10 @@ BOOST_AUTO_TEST_CASE(spotlight)
void
lights(const SceneShader & shader) const override
{
- shader.spotLight.add({50, 50, 15}, down, {1.0, 1.0, 1.0}, 0.01F, 1);
- shader.spotLight.add({51, 59.5, 1}, north, {1.0, 1.0, 1.0}, 0.001F, .5);
- shader.spotLight.add({53, 59.5, 1}, north, {1.0, 1.0, 1.0}, 0.001F, .5);
- shader.spotLight.add({60, 50, 3}, north + east, {1.0, 1.0, 1.0}, 0.0001F, .7F);
+ shader.spotLight.add({50000, 50000, 15000}, down, {1.0, 1.0, 1.0}, 0.01F, 1);
+ shader.spotLight.add({51000, 59500, 1000}, north, {1.0, 1.0, 1.0}, 0.001F, .5);
+ shader.spotLight.add({53000, 59500, 1000}, north, {1.0, 1.0, 1.0}, 0.001F, .5);
+ shader.spotLight.add({60000, 50000, 3000}, north + east, {1.0, 1.0, 1.0}, 0.0001F, .7F);
}
};