aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 12:19:56 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 12:19:56 +0100
commit87c74782e486647c46f9ca4d2f857094006e563c (patch)
treec8e0b893610cb90d7bd7578c3d076b7e905c822a /src/test
parentec3601fbc17a38a44608a04f53d4e36c1bff8c96 (diff)
`make format`
Diffstat (limited to 'src/test')
-rw-r--r--src/test/PhysicsTest.cpp11
-rw-r--r--src/test/ScriptTest.cpp9
-rw-r--r--src/test/main.cpp6
3 files changed, 14 insertions, 12 deletions
diff --git a/src/test/PhysicsTest.cpp b/src/test/PhysicsTest.cpp
index 5399d54..9ac99aa 100644
--- a/src/test/PhysicsTest.cpp
+++ b/src/test/PhysicsTest.cpp
@@ -13,7 +13,7 @@ using namespace crepe;
class PhysicsTest : public ::testing::Test {
public:
ComponentManager component_manager;
- PhysicsSystem system { component_manager };
+ PhysicsSystem system{component_manager};
void SetUp() override {
ComponentManager & mgr = this->component_manager;
@@ -49,7 +49,8 @@ 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);
@@ -87,9 +88,11 @@ 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());
diff --git a/src/test/ScriptTest.cpp b/src/test/ScriptTest.cpp
index ea49a35..bab9e52 100644
--- a/src/test/ScriptTest.cpp
+++ b/src/test/ScriptTest.cpp
@@ -5,11 +5,11 @@
#define protected public
#include <crepe/ComponentManager.h>
-#include <crepe/system/ScriptSystem.h>
#include <crepe/api/BehaviorScript.h>
-#include <crepe/api/Script.h>
#include <crepe/api/GameObject.h>
+#include <crepe/api/Script.h>
#include <crepe/api/Vector2.h>
+#include <crepe/system/ScriptSystem.h>
using namespace std;
using namespace crepe;
@@ -17,8 +17,8 @@ using namespace testing;
class ScriptTest : public Test {
public:
- ComponentManager component_manager {};
- ScriptSystem system { component_manager };
+ ComponentManager component_manager{};
+ ScriptSystem system{component_manager};
class MyScript : public Script {
// NOTE: default (private) visibility of init and update shouldn't cause
@@ -70,4 +70,3 @@ TEST_F(ScriptTest, ListScripts) {
}
ASSERT_EQ(1, script_count);
}
-
diff --git a/src/test/main.cpp b/src/test/main.cpp
index 6830a01..a54d239 100644
--- a/src/test/main.cpp
+++ b/src/test/main.cpp
@@ -5,11 +5,11 @@
using namespace crepe;
using namespace testing;
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
+int main(int argc, char ** argv) {
+ InitGoogleTest(&argc, argv);
auto & cfg = Config::get_instance();
cfg.log.level = LogLevel::ERROR;
- return RUN_ALL_TESTS();
+ return RUN_ALL_TESTS();
}