improved code added unit test

This commit is contained in:
2024-08-18 10:33:01 +03:00
parent f4c988247c
commit 945fd7daa2
5 changed files with 73 additions and 17 deletions

17
tests/UnitTestAstar.cpp Normal file
View 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);
}