diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-18 14:20:59 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-18 14:20:59 +0100 |
commit | cff284cedde9f0cc133ff2855557299ce1d8083c (patch) | |
tree | 7aafa1892cca039b5e59db8a748d91a8857262da /src/test/ScriptTest.cpp | |
parent | 8dfdb5a588614db80fa8f41ccf883c1766fe56ff (diff) |
add fixed/frame update functions to script
Diffstat (limited to 'src/test/ScriptTest.cpp')
-rw-r--r-- | src/test/ScriptTest.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/test/ScriptTest.cpp b/src/test/ScriptTest.cpp index 66b8193..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,7 +39,7 @@ TEST_F(ScriptTest, UpdateOnce) { InSequence seq; EXPECT_CALL(script, init()).Times(1); - EXPECT_CALL(script, update(_)).Times(1); + EXPECT_CALL(script, fixed_update(_)).Times(1); system.fixed_update(); } @@ -46,9 +47,16 @@ TEST_F(ScriptTest, UpdateOnce) { InSequence seq; EXPECT_CALL(script, init()).Times(0); - EXPECT_CALL(script, update(_)).Times(1); + EXPECT_CALL(script, fixed_update(_)).Times(1); system.fixed_update(); } + + { + InSequence seq; + + EXPECT_CALL(script, frame_update(_)).Times(1); + system.frame_update(); + } } TEST_F(ScriptTest, UpdateInactive) { @@ -59,7 +67,7 @@ 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.fixed_update(); } @@ -68,7 +76,7 @@ TEST_F(ScriptTest, UpdateInactive) { 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.fixed_update(); } |