mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
refactored tests
This commit is contained in:
@@ -5,17 +5,20 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||
|
||||
include(GoogleTest)
|
||||
add_executable(unit-tests
|
||||
UnitTestPrediction.cpp
|
||||
UnitTestMatrix.cpp
|
||||
UnitTestMat.cpp
|
||||
UnitTestAstar.cpp
|
||||
UnitTestProjection.cpp
|
||||
UnitTestVector3.cpp
|
||||
UnitTestVector2.cpp
|
||||
UnitTestColor.cpp
|
||||
UnitTestVector4.cpp
|
||||
UnitTestLineTrace.cpp
|
||||
UnitTestOpenGL.cpp
|
||||
general/UnitTestPrediction.cpp
|
||||
general/UnitTestMatrix.cpp
|
||||
general/UnitTestMat.cpp
|
||||
general/UnitTestAstar.cpp
|
||||
general/UnitTestProjection.cpp
|
||||
general/UnitTestVector3.cpp
|
||||
general/UnitTestVector2.cpp
|
||||
general/UnitTestColor.cpp
|
||||
general/UnitTestVector4.cpp
|
||||
general/UnitTestLineTrace.cpp
|
||||
|
||||
engines/UnitTestOpenGL.cpp
|
||||
engines/UnitTestUnityEngine.cpp
|
||||
engines/UnitTestSourceEngine.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(unit-tests PRIVATE gtest gtest_main omath glm)
|
||||
|
||||
@@ -38,11 +38,11 @@ TEST(UnitTestOpenGL, Projection)
|
||||
}
|
||||
TEST(UnitTestOpenGL, Projection2)
|
||||
{
|
||||
const auto orient = omath::Mat<>::OrientationMat(omath::opengl::kAbsForward, omath::opengl::kAbsRight, omath::opengl::kAbsUp);
|
||||
const auto orient = omath::opengl::ViewMatrix(omath::opengl::kAbsForward, -omath::opengl::kAbsRight, omath::opengl::kAbsUp, {});
|
||||
|
||||
const omath::Mat<4, 1> cords_omath =
|
||||
const omath::Mat<4, 1,float, omath::MatStoreType::COLUMN_MAJOR> cords_omath =
|
||||
{
|
||||
{0}, {0}, {10}, {1}
|
||||
{0}, {0}, {-10}, {1}
|
||||
};
|
||||
std::cout << (orient.Transposed() * cords_omath).ToString();
|
||||
std::cout << (orient * cords_omath).ToString();
|
||||
}
|
||||
3
tests/engines/UnitTestSourceEngine.cpp
Normal file
3
tests/engines/UnitTestSourceEngine.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
//
|
||||
// Created by Orange on 11/27/2024.
|
||||
//
|
||||
3
tests/engines/UnitTestUnityEngine.cpp
Normal file
3
tests/engines/UnitTestUnityEngine.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
//
|
||||
// Created by Orange on 11/27/2024.
|
||||
//
|
||||
Reference in New Issue
Block a user