Testing lower bounds of InBounds and Inside, testing ByteSize literals

This commit is contained in:
Vladyslav Baranovskyi
2024-10-08 15:48:25 +03:00
parent e7160ffef0
commit ad8fbfde81
2 changed files with 43 additions and 0 deletions

View File

@@ -116,14 +116,26 @@ TEST_CASE("IsOverlapping", "[AABB]")
TEST_CASE("InBounds", "[AABB]")
{
AABB aabb(Vector3f(0.0f), Vector3f(1.0f));
REQUIRE(aabb.InBounds(Vector3f(0.5f)));
REQUIRE(aabb.InBounds(Vector3f(0.0f)));
REQUIRE(aabb.InBounds(Vector3f(1.0f)));
REQUIRE_FALSE(aabb.InBounds(Vector3f(1.1f)));
REQUIRE_FALSE(aabb.InBounds(Vector3f(-0.1f)));
REQUIRE_FALSE(aabb.InBounds(Vector3f(2.0f)));
}
TEST_CASE("Inside", "[AABB]")
{
AABB aabb(Vector3f(0.0f), Vector3f(1.0f));
REQUIRE(aabb.Inside(Vector3f(0.5f)));
REQUIRE_FALSE(aabb.Inside(Vector3f(0.0f)));
REQUIRE_FALSE(aabb.Inside(Vector3f(1.0f)));
REQUIRE_FALSE(aabb.Inside(Vector3f(1.1f)));
REQUIRE_FALSE(aabb.Inside(Vector3f(-0.1f)));
REQUIRE_FALSE(aabb.Inside(Vector3f(1.0f)));
}