11 #include <gtest/gtest.h>
12 #include <game_manager/level/entity.hpp>
14 TEST(entity_tests, test_set_collisions_box) {
21 ASSERT_FALSE(test_subject.is_affected_by_physics());
26 TEST(entity_tests, test_entities_collision) {
40 ASSERT_TRUE(test_subject1.
collides(test_subject2));
43 TEST(entity_tests, test_entities_colliding_on_edge) {
57 ASSERT_TRUE(test_subject1.
collides(test_subject2));
60 TEST(entity_tests, test_entities_colliding_one_pixel_from_edge) {
74 ASSERT_TRUE(test_subject1.
collides(test_subject2));
78 TEST(entity_tests, test_set_get_is_active) {
83 test_subject.set_active(
true);
84 ASSERT_TRUE(test_subject.is_active());
85 test_subject.set_active(
false);
86 ASSERT_FALSE(test_subject.is_active());
89 TEST(entity_tests, test_set_get_is_static) {
94 test_subject.set_static(
true);
95 ASSERT_TRUE(test_subject.is_static());
96 test_subject.set_static(
false);
97 ASSERT_FALSE(test_subject.is_static());
100 TEST(entity_tests, test_set_get_is_visible) {
105 test_subject.set_visible(
true);
106 ASSERT_TRUE(test_subject.is_visible());
107 test_subject.set_visible(
false);
108 ASSERT_FALSE(test_subject.is_visible());
112 TEST(entity_tests, test_set_get_is_affected_by_physics) {
117 test_subject.set_affected_by_physics(
true);
118 ASSERT_TRUE(test_subject.is_affected_by_physics());
119 test_subject.set_affected_by_physics(
false);
120 ASSERT_FALSE(test_subject.is_affected_by_physics());
123 int main(
int argc,
char **argv) {
124 ::testing::InitGoogleTest(&argc, argv);
125 return RUN_ALL_TESTS();
This class represents all static or dynamic objects in the game (excluding text, see ST::text)
int32_t get_col_y() const
void set_collision_box(int16_t, int16_t, int16_t, int16_t)
bool collides(const entity &) const
int32_t get_col_x() const