aboutsummaryrefslogtreecommitdiff
path: root/src/test/ParticleTest.cpp
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-12-20 12:01:36 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-12-20 12:01:36 +0100
commit79d3a9f4311e6684b6df83a15ca7844f58c1959c (patch)
treeb2883e83f61cee9edf290a6a7228c7f0b1fbae8a /src/test/ParticleTest.cpp
parent9140b73e4af7aa925b53e4fb4e6aa7f4ea2e3385 (diff)
parent03aea832aa0bc2edba2cc5ab4d9f8eba42d355be (diff)
Merge remote-tracking branch 'origin/master' into max/game
Diffstat (limited to 'src/test/ParticleTest.cpp')
-rw-r--r--src/test/ParticleTest.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test/ParticleTest.cpp b/src/test/ParticleTest.cpp
index 9263e00..7a731a3 100644
--- a/src/test/ParticleTest.cpp
+++ b/src/test/ParticleTest.cpp
@@ -97,18 +97,18 @@ TEST_F(ParticlesTest, spawnParticle) {
emitter.data.max_angle = 0.1;
emitter.data.max_speed = 10;
emitter.data.max_angle = 10;
- particle_system.update();
+ particle_system.fixed_update();
//check if nothing happend
EXPECT_EQ(emitter.particles[0].active, false);
emitter.data.emission_rate = 50;
//check particle spawnes
- particle_system.update();
+ particle_system.fixed_update();
EXPECT_EQ(emitter.particles[0].active, true);
- particle_system.update();
+ particle_system.fixed_update();
EXPECT_EQ(emitter.particles[1].active, true);
- particle_system.update();
+ particle_system.fixed_update();
EXPECT_EQ(emitter.particles[2].active, true);
- particle_system.update();
+ particle_system.fixed_update();
EXPECT_EQ(emitter.particles[3].active, true);
for (auto & particle : emitter.particles) {
@@ -142,7 +142,7 @@ TEST_F(ParticlesTest, moveParticleHorizontal) {
emitter.data.max_angle = 0;
emitter.data.emission_rate = 50;
for (int a = 1; a < emitter.data.boundary.width / 2; a++) {
- particle_system.update();
+ particle_system.fixed_update();
EXPECT_EQ(emitter.particles[0].position.x, a);
}
}
@@ -160,7 +160,7 @@ TEST_F(ParticlesTest, moveParticleVertical) {
emitter.data.max_angle = 90;
emitter.data.emission_rate = 50;
for (int a = 1; a < emitter.data.boundary.width / 2; a++) {
- particle_system.update();
+ particle_system.fixed_update();
EXPECT_EQ(emitter.particles[0].position.y, a);
}
}
@@ -179,7 +179,7 @@ TEST_F(ParticlesTest, boundaryParticleReset) {
emitter.data.max_angle = 90;
emitter.data.emission_rate = 1;
for (int a = 0; a < emitter.data.boundary.width / 2 + 1; a++) {
- particle_system.update();
+ particle_system.fixed_update();
}
EXPECT_EQ(emitter.particles[0].active, false);
}
@@ -198,7 +198,7 @@ TEST_F(ParticlesTest, boundaryParticleStop) {
emitter.data.max_angle = 90;
emitter.data.emission_rate = 1;
for (int a = 0; a < emitter.data.boundary.width / 2 + 1; a++) {
- particle_system.update();
+ particle_system.fixed_update();
}
const double TOLERANCE = 0.01;
EXPECT_NEAR(emitter.particles[0].velocity.x, 0, TOLERANCE);