aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ParticleTest.cpp15
-rw-r--r--src/test/PhysicsTest.cpp12
2 files changed, 9 insertions, 18 deletions
diff --git a/src/test/ParticleTest.cpp b/src/test/ParticleTest.cpp
index cd2ec2a..cfbbc0e 100644
--- a/src/test/ParticleTest.cpp
+++ b/src/test/ParticleTest.cpp
@@ -79,8 +79,7 @@ public:
TEST_F(ParticlesTest, spawnParticle) {
Config::get_instance().physics.gravity = 1;
ComponentManager & mgr = this->component_manager;
- ParticleEmitter & emitter
- = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
+ ParticleEmitter & emitter = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
emitter.data.end_lifespan = 5;
emitter.data.boundary.height = 100;
emitter.data.boundary.width = 100;
@@ -124,8 +123,7 @@ TEST_F(ParticlesTest, spawnParticle) {
TEST_F(ParticlesTest, moveParticleHorizontal) {
Config::get_instance().physics.gravity = 1;
ComponentManager & mgr = this->component_manager;
- ParticleEmitter & emitter
- = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
+ ParticleEmitter & emitter = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
emitter.data.end_lifespan = 100;
emitter.data.boundary.height = 100;
emitter.data.boundary.width = 100;
@@ -142,8 +140,7 @@ TEST_F(ParticlesTest, moveParticleHorizontal) {
TEST_F(ParticlesTest, moveParticleVertical) {
Config::get_instance().physics.gravity = 1;
ComponentManager & mgr = this->component_manager;
- ParticleEmitter & emitter
- = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
+ ParticleEmitter & emitter = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
emitter.data.end_lifespan = 100;
emitter.data.boundary.height = 100;
emitter.data.boundary.width = 100;
@@ -161,8 +158,7 @@ TEST_F(ParticlesTest, moveParticleVertical) {
TEST_F(ParticlesTest, boundaryParticleReset) {
Config::get_instance().physics.gravity = 1;
ComponentManager & mgr = this->component_manager;
- ParticleEmitter & emitter
- = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
+ ParticleEmitter & emitter = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
emitter.data.end_lifespan = 100;
emitter.data.boundary.height = 10;
emitter.data.boundary.width = 10;
@@ -181,8 +177,7 @@ TEST_F(ParticlesTest, boundaryParticleReset) {
TEST_F(ParticlesTest, boundaryParticleStop) {
Config::get_instance().physics.gravity = 1;
ComponentManager & mgr = this->component_manager;
- ParticleEmitter & emitter
- = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
+ ParticleEmitter & emitter = mgr.get_components_by_id<ParticleEmitter>(0).front().get();
emitter.data.end_lifespan = 100;
emitter.data.boundary.height = 10;
emitter.data.boundary.width = 10;
diff --git a/src/test/PhysicsTest.cpp b/src/test/PhysicsTest.cpp
index edb76e9..1e37c26 100644
--- a/src/test/PhysicsTest.cpp
+++ b/src/test/PhysicsTest.cpp
@@ -49,8 +49,7 @@ public:
TEST_F(PhysicsTest, gravity) {
Config::get_instance().physics.gravity = 1;
ComponentManager & mgr = this->component_manager;
- vector<reference_wrapper<Transform>> transforms
- = mgr.get_components_by_id<Transform>(0);
+ vector<reference_wrapper<Transform>> transforms = mgr.get_components_by_id<Transform>(0);
const Transform & transform = transforms.front().get();
ASSERT_FALSE(transforms.empty());
EXPECT_EQ(transform.position.y, 0);
@@ -64,8 +63,7 @@ TEST_F(PhysicsTest, gravity) {
TEST_F(PhysicsTest, max_velocity) {
ComponentManager & mgr = this->component_manager;
- vector<reference_wrapper<Rigidbody>> rigidbodies
- = mgr.get_components_by_id<Rigidbody>(0);
+ vector<reference_wrapper<Rigidbody>> rigidbodies = mgr.get_components_by_id<Rigidbody>(0);
Rigidbody & rigidbody = rigidbodies.front().get();
ASSERT_FALSE(rigidbodies.empty());
EXPECT_EQ(rigidbody.data.linear_velocity.y, 0);
@@ -88,11 +86,9 @@ TEST_F(PhysicsTest, max_velocity) {
TEST_F(PhysicsTest, movement) {
Config::get_instance().physics.gravity = 0;
ComponentManager & mgr = this->component_manager;
- vector<reference_wrapper<Rigidbody>> rigidbodies
- = mgr.get_components_by_id<Rigidbody>(0);
+ vector<reference_wrapper<Rigidbody>> rigidbodies = mgr.get_components_by_id<Rigidbody>(0);
Rigidbody & rigidbody = rigidbodies.front().get();
- vector<reference_wrapper<Transform>> transforms
- = mgr.get_components_by_id<Transform>(0);
+ vector<reference_wrapper<Transform>> transforms = mgr.get_components_by_id<Transform>(0);
const Transform & transform = transforms.front().get();
ASSERT_FALSE(rigidbodies.empty());
ASSERT_FALSE(transforms.empty());