]> git.localhorst.tv Git - blobs.git/blob - tst/app/MasterTest.cpp
c9ab2d90d672ea60febbe8b3e2775a31c93f8db6
[blobs.git] / tst / app / MasterTest.cpp
1 #include "MasterTest.hpp"
2
3 #include "app/Application.hpp"
4 #include "app/Assets.hpp"
5 #include "app/init.hpp"
6 #include "app/MasterState.hpp"
7 #include "creature/Creature.hpp"
8 #include "world/Simulation.hpp"
9
10 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(blobs::app::test::MasterTest, "headed");
11
12
13 namespace blobs {
14 namespace app {
15 namespace test {
16
17 void MasterTest::setUp() {
18 }
19
20 void MasterTest::tearDown() {
21 }
22
23
24 void MasterTest::testOneSecond() {
25         Init init(false, 1);
26         Assets assets;
27
28         world::Simulation sim(assets);
29         assets.LoadUniverse("universe", sim);
30
31         auto blob = new creature::Creature(sim);
32         blob->Name(assets.name.Sequential());
33         Spawn(*blob, sim.PlanetByName("Planet"));
34         // decrease chances of ur-blob dying without splitting
35         blob->GetProperties().Fertility() = 1.0;
36         blob->BuildVAO();
37
38         app::MasterState state(assets, sim);
39         state.Show(*blob);
40
41         app::Application app(init.window, init.viewport);
42         app.PushState(&state);
43
44         // just run it for one second and check if anything segfaults or throws
45         for (int t = 0; t < 1000; t += 17) {
46                 app.Loop(17);
47         }
48 }
49
50 }
51 }
52 }