aboutsummaryrefslogtreecommitdiff
path: root/src/test/ScriptSaveManagerTest.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-12 07:59:47 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-12 07:59:47 +0100
commit0f68177a0384d41a7feff36cc0e1869b6d2ac9aa (patch)
tree4904b60820858efd0ee6ece0af1f2c1fc5846ec5 /src/test/ScriptSaveManagerTest.cpp
parent73f8d5c558ebc0820ede241e64a876ff1c5ccefb (diff)
parent194ee3f192c3343c3ccc28dfa97fed180503ffd4 (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/inputSystem
Diffstat (limited to 'src/test/ScriptSaveManagerTest.cpp')
-rw-r--r--src/test/ScriptSaveManagerTest.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/ScriptSaveManagerTest.cpp b/src/test/ScriptSaveManagerTest.cpp
new file mode 100644
index 0000000..64403c4
--- /dev/null
+++ b/src/test/ScriptSaveManagerTest.cpp
@@ -0,0 +1,35 @@
+#include <gtest/gtest.h>
+
+// stupid hack to allow access to private/protected members under test
+#define private public
+#define protected public
+
+#include <crepe/facade/DB.h>
+#include <crepe/manager/SaveManager.h>
+
+#include "ScriptTest.h"
+
+using namespace std;
+using namespace crepe;
+using namespace testing;
+
+class ScriptSaveManagerTest : public ScriptTest {
+public:
+ class TestSaveManager : public SaveManager {
+ using SaveManager::SaveManager;
+
+ // in-memory database for testing
+ DB db{};
+ virtual DB & get_db() override { return this->db; }
+ };
+
+ TestSaveManager save_mgr{mediator};
+};
+
+TEST_F(ScriptSaveManagerTest, GetSaveManager) {
+ MyScript & script = this->script;
+
+ SaveManager & mgr = script.get_save_manager();
+
+ EXPECT_EQ(&mgr, &save_mgr);
+}