aboutsummaryrefslogtreecommitdiff
path: root/src/test/ScriptSceneTest.cpp
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-12-05 17:25:50 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-12-05 17:25:50 +0100
commit0b942f4d6eb87fb623afbbae617478674c612ccc (patch)
tree9fd575e1793367e744b60b7d2bed626a72dc70f4 /src/test/ScriptSceneTest.cpp
parent121387ba92a23d6f17b36331d25757abc899f7d2 (diff)
parent1f4e961d7f9d6887c807cac1a362f2d178b0860b (diff)
Merge remote-tracking branch 'origin/master' into max/AI
Diffstat (limited to 'src/test/ScriptSceneTest.cpp')
-rw-r--r--src/test/ScriptSceneTest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ScriptSceneTest.cpp b/src/test/ScriptSceneTest.cpp
new file mode 100644
index 0000000..9ee1e52
--- /dev/null
+++ b/src/test/ScriptSceneTest.cpp
@@ -0,0 +1,30 @@
+#include <gtest/gtest.h>
+
+// stupid hack to allow access to private/protected members under test
+#define private public
+#define protected public
+
+#include "ScriptTest.h"
+#include <crepe/manager/SceneManager.h>
+
+using namespace std;
+using namespace crepe;
+using namespace testing;
+
+class ScriptSceneTest : public ScriptTest {
+public:
+ SceneManager scene_manager{mediator};
+
+ class MyScene : public Scene {};
+};
+
+TEST_F(ScriptSceneTest, Inactive) {
+ BehaviorScript & behaviorscript = this->behaviorscript;
+ MyScript & script = this->script;
+
+ const char * non_default_value = "foo";
+ ASSERT_NE(non_default_value, scene_manager.next_scene);
+
+ script.set_next_scene(non_default_value);
+ EXPECT_EQ(non_default_value, scene_manager.next_scene);
+}