YoggieEngine/Tests/EngineTest.cpp

33 lines
743 B
C++

#include <YoggieEngine.h>
#include <gtest/gtest.h>
TEST(HelloTDD, MyFirstTest) {
EXPECT_EQ(1, 1);
};
TEST(TRANSFORM_COMPONENT_TESTS , CAN_EXTRACT_TRANSLATION_FROM_TRANSFORM_MATRIX) {
auto component = YoggieEngine::TransformComponent{};
component.Position = glm::vec3(1.0f, 2.0f, 3.0f);
auto transformationMatrix = component.GetTransform();
auto newComponent = YoggieEngine::TransformComponent{};
newComponent.Decompose(transformationMatrix);
EXPECT_EQ(newComponent.Position.x, component.Position.x);
EXPECT_EQ(newComponent.Position.y, component.Position.y);
EXPECT_EQ(newComponent.Position.z, component.Position.z);
}
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}