Improves test accuracy and adds .gitignore entry

Updates unit tests to include more accurate assertions for camera projections.

Adds .idea/workspace.xml to .gitignore to prevent tracking local IDE settings.

Refactors some test fixture class names for consistency.
This commit is contained in:
2025-08-21 00:30:05 +03:00
parent 625c676010
commit 83d3cc099f
6 changed files with 38 additions and 30 deletions

View File

@@ -31,10 +31,10 @@ namespace
// -----------------------------------------------------------------------------
// Fixture with one canonical rightangled triangle in the XY plane.
// -----------------------------------------------------------------------------
class line_tracer_fixture : public ::testing::Test
class LineTracerFixture : public ::testing::Test
{
protected:
line_tracer_fixture() :
LineTracerFixture() :
triangle({0.f, 0.f, 0.f}, {1.f, 0.f, 0.f}, {0.f, 1.f, 0.f})
{
}
@@ -51,7 +51,7 @@ namespace
bool expected_clear; // true => segment does NOT hit the triangle
};
class CanTraceLineParam : public line_tracer_fixture,
class CanTraceLineParam : public LineTracerFixture,
public ::testing::WithParamInterface<TraceCase>
{
};
@@ -79,7 +79,7 @@ namespace
// -----------------------------------------------------------------------------
// Validate that the reported hit point is correct for a genuine intersection.
// -----------------------------------------------------------------------------
TEST_F(line_tracer_fixture, HitPointCorrect)
TEST_F(LineTracerFixture, HitPointCorrect)
{
constexpr Ray ray{{0.3f, 0.3f, -1.f}, {0.3f, 0.3f, 1.f}};
constexpr Vec3 expected{0.3f, 0.3f, 0.f};
@@ -92,7 +92,7 @@ namespace
// -----------------------------------------------------------------------------
// Triangle far beyond the ray should not block.
// -----------------------------------------------------------------------------
TEST_F(line_tracer_fixture, DistantTriangleClear)
TEST_F(LineTracerFixture, DistantTriangleClear)
{
constexpr Ray short_ray{{0.f, 0.f, 0.f}, {0.f, 0.f, 1.f}};
constexpr Triangle<Vec3> distant{{1000.f, 1000.f, 1000.f},