diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-20 12:01:36 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-20 12:01:36 +0100 |
commit | 79d3a9f4311e6684b6df83a15ca7844f58c1959c (patch) | |
tree | b2883e83f61cee9edf290a6a7228c7f0b1fbae8a /src/test/ScriptTest.cpp | |
parent | 9140b73e4af7aa925b53e4fb4e6aa7f4ea2e3385 (diff) | |
parent | 03aea832aa0bc2edba2cc5ab4d9f8eba42d355be (diff) |
Merge remote-tracking branch 'origin/master' into max/game
Diffstat (limited to 'src/test/ScriptTest.cpp')
-rw-r--r-- | src/test/ScriptTest.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/src/test/ScriptTest.cpp b/src/test/ScriptTest.cpp index acdae70..40aa25c 100644 --- a/src/test/ScriptTest.cpp +++ b/src/test/ScriptTest.cpp @@ -28,7 +28,8 @@ void ScriptTest::SetUp() { TEST_F(ScriptTest, Default) { MyScript & script = this->script; EXPECT_CALL(script, init()).Times(0); - EXPECT_CALL(script, update()).Times(0); + EXPECT_CALL(script, fixed_update(_)).Times(0); + EXPECT_CALL(script, frame_update(_)).Times(0); } TEST_F(ScriptTest, UpdateOnce) { @@ -38,16 +39,23 @@ TEST_F(ScriptTest, UpdateOnce) { InSequence seq; EXPECT_CALL(script, init()).Times(1); - EXPECT_CALL(script, update()).Times(1); - system.update(); + EXPECT_CALL(script, fixed_update(_)).Times(1); + system.fixed_update(); } { InSequence seq; EXPECT_CALL(script, init()).Times(0); - EXPECT_CALL(script, update()).Times(1); - system.update(); + EXPECT_CALL(script, fixed_update(_)).Times(1); + system.fixed_update(); + } + + { + InSequence seq; + + EXPECT_CALL(script, frame_update(_)).Times(1); + system.frame_update(); } } @@ -59,17 +67,29 @@ TEST_F(ScriptTest, UpdateInactive) { InSequence seq; EXPECT_CALL(script, init()).Times(0); - EXPECT_CALL(script, update()).Times(0); + EXPECT_CALL(script, fixed_update(_)).Times(0); behaviorscript.active = false; - system.update(); + system.fixed_update(); } { InSequence seq; EXPECT_CALL(script, init()).Times(1); - EXPECT_CALL(script, update()).Times(1); + EXPECT_CALL(script, fixed_update(_)).Times(1); behaviorscript.active = true; - system.update(); + system.fixed_update(); } } + +TEST_F(ScriptTest, SaveManager) { + MyScript & script = this->script; + + EXPECT_EQ(&script.get_save_manager(), &this->save_manager); +} + +TEST_F(ScriptTest, LoopTimerManager) { + MyScript & script = this->script; + + EXPECT_EQ(&script.get_loop_timer(), &this->loop_timer); +} |