X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=tst%2Fapp%2FMasterTest.cpp;fp=tst%2Fapp%2FMasterTest.cpp;h=c9ab2d90d672ea60febbe8b3e2775a31c93f8db6;hp=0000000000000000000000000000000000000000;hb=2797cbced4b524543b4732041cee03a1b80d0047;hpb=38db9a31695abef65ebc421f120a05219132b15f diff --git a/tst/app/MasterTest.cpp b/tst/app/MasterTest.cpp new file mode 100644 index 0000000..c9ab2d9 --- /dev/null +++ b/tst/app/MasterTest.cpp @@ -0,0 +1,52 @@ +#include "MasterTest.hpp" + +#include "app/Application.hpp" +#include "app/Assets.hpp" +#include "app/init.hpp" +#include "app/MasterState.hpp" +#include "creature/Creature.hpp" +#include "world/Simulation.hpp" + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(blobs::app::test::MasterTest, "headed"); + + +namespace blobs { +namespace app { +namespace test { + +void MasterTest::setUp() { +} + +void MasterTest::tearDown() { +} + + +void MasterTest::testOneSecond() { + Init init(false, 1); + Assets assets; + + world::Simulation sim(assets); + assets.LoadUniverse("universe", sim); + + auto blob = new creature::Creature(sim); + blob->Name(assets.name.Sequential()); + Spawn(*blob, sim.PlanetByName("Planet")); + // decrease chances of ur-blob dying without splitting + blob->GetProperties().Fertility() = 1.0; + blob->BuildVAO(); + + app::MasterState state(assets, sim); + state.Show(*blob); + + app::Application app(init.window, init.viewport); + app.PushState(&state); + + // just run it for one second and check if anything segfaults or throws + for (int t = 0; t < 1000; t += 17) { + app.Loop(17); + } +} + +} +} +}