mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
improved code added unit test
This commit is contained in:
@@ -5,7 +5,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
|
||||
file(GLOB TEST_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
|
||||
include(GoogleTest)
|
||||
add_executable(unit-tests UnitTestPrediction.cpp UnitTestMatrix.cpp)
|
||||
add_executable(unit-tests UnitTestPrediction.cpp UnitTestMatrix.cpp UnitTestAstar.cpp)
|
||||
|
||||
target_link_libraries(unit-tests PRIVATE gtest gtest_main omath)
|
||||
|
||||
|
||||
17
tests/UnitTestAstar.cpp
Normal file
17
tests/UnitTestAstar.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by Vlad on 18.08.2024.
|
||||
//
|
||||
#include <gtest/gtest.h>
|
||||
#include <omath/pathfinding/Astar.h>
|
||||
|
||||
|
||||
TEST(UnitTestAstar, FindingRightPath)
|
||||
{
|
||||
omath::pathfinding::NavigationMesh mesh;
|
||||
|
||||
mesh.m_verTextMap[{0.f, 0.f, 0.f}] = {{0.f, 1.f, 0.f}};
|
||||
mesh.m_verTextMap[{0.f, 1.f, 0.f}] = {{0.f, 2.f, 0.f}};
|
||||
mesh.m_verTextMap[{0.f, 2.f, 0.f}] = {{0.f, 3.f, 0.f}};
|
||||
mesh.m_verTextMap[{0.f, 3.f, 0.f}] = {};
|
||||
omath::pathfinding::Astar::FindPath({}, {0.f, 3.f, 0.f}, mesh);
|
||||
}
|
||||
Reference in New Issue
Block a user