Skip to content

Commit

Permalink
CircularArc: Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Oct 16, 2024
1 parent f9ad111 commit 75f4b5c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/geom/CircularArcTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,21 @@ void object::test<4>()
ensure_equals("linear", CircularArc({0, 0}, {1, 1}, {2, 2}).isLinear(), true);
}

template<>
template<>
void object::test<5>()
{
set_test_name("CircularArc::containsPointOnCircle");

// complete circle
CircularArc({5, 0}, {-5, 0}, {5, 0}).containsPointOnCircle({5, 0});
CircularArc({5, 0}, {-5, 0}, {5, 0}).containsPointOnCircle({4, 3});

// lower semi-circle
CircularArc({-5, 0}, {0, -5}, {5, 0}).containsPointOnCircle({5, 0});

// upper semi-circle
CircularArc({-5, 0}, {0, 5}, {5, 0}).containsPointOnCircle({5, 0});
}

}

0 comments on commit 75f4b5c

Please sign in to comment.