Triangles/src/unittest/test_helpers.cpp
Stephen Seo b523a6c93e Update to latest versions of libraries
Update to use Raylib 4.2.0.
Update to use Raygui 3.2.
Update to use Catch 3.3.2.
2023-03-06 20:12:09 +09:00

18 lines
509 B
C++

#include "catch_amalgamated.hpp"
#include "helpers.hpp"
#include "triangle.hpp"
TEST_CASE("Test is_within_shape", "[Triangles]") {
Tri::Triangle triangle({{
{0.0f, 10.0f},
{10.0f, 10.0f},
{10.0f, 0.0f}
}});
CHECK(Tri::is_within_shape(triangle, {2.0f, 2.0f}) == false);
CHECK(Tri::is_within_shape(triangle, {5.0f, 15.0f}) == false);
CHECK(Tri::is_within_shape(triangle, {15.0f, 5.0f}) == false);
CHECK(Tri::is_within_shape(triangle, {7.0f, 7.0f}) == true);
}