#include "app/init.hpp"
#include "app/MasterState.hpp"
#include "creature/Creature.hpp"
-#include "math/const.hpp"
-#include "world/Planet.hpp"
-#include "world/Set.hpp"
#include "world/Simulation.hpp"
-#include "world/Sun.hpp"
-#include "world/TileType.hpp"
-
-#include <cstdint>
-#include <iostream>
using namespace blobs;
--- /dev/null
+#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);
+ }
+}
+
+}
+}
+}
--- /dev/null
+#ifndef BLOBS_TEST_APP_MASTERTEST_HPP_
+#define BLOBS_TEST_APP_MASTERTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+
+namespace blobs {
+namespace app {
+namespace test {
+
+class MasterTest
+: public CppUnit::TestFixture {
+
+CPPUNIT_TEST_SUITE(MasterTest);
+
+CPPUNIT_TEST(testOneSecond);
+
+CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp();
+ void tearDown();
+
+ void testOneSecond();
+
+};
+
+}
+}
+}
+
+#endif