aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-20 11:12:44 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-20 11:12:44 +0100
commit44741315c6d2df9bd6591c19ea189163e5c70add (patch)
treebc4d65efbd0c78cf704db8afd1c08c64c04996c0 /src/test
parent5b1a26a13d8a2f44a7ef1fa8c0fc609c37adc28b (diff)
parent226e01dcd77821d1fccdf42074606ce80528637e (diff)
merge loek/scripts
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ScriptTest.cpp18
-rw-r--r--src/test/ScriptTest.h3
2 files changed, 15 insertions, 6 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();
}
diff --git a/src/test/ScriptTest.h b/src/test/ScriptTest.h
index f3dbda4..8637df0 100644
--- a/src/test/ScriptTest.h
+++ b/src/test/ScriptTest.h
@@ -29,7 +29,8 @@ public:
public:
MOCK_METHOD(void, init, (), (override));
- MOCK_METHOD(void, update, (crepe::duration_t), (override));
+ MOCK_METHOD(void, fixed_update, (crepe::duration_t), (override));
+ MOCK_METHOD(void, frame_update, (crepe::duration_t), (override));
};
crepe::OptionalRef<crepe::BehaviorScript> behaviorscript;