Skip to content
Snippets Groups Projects
Commit c0238266 authored by Andreas Schenk's avatar Andreas Schenk
Browse files

added/extended tests for geom exceptions

parent f32e8601
Branches
Tags
No related merge requests found
......@@ -37,6 +37,17 @@ BOOST_AUTO_TEST_CASE(line_init2)
BOOST_CHECK_EQUAL(geom::Length(line.GetDirection()), 1.0);
}
BOOST_AUTO_TEST_CASE(rectangle2)
{
Rectangle2 rect;
try{
BOOST_CHECK_THROW(rect[2]=geom::Vec2(0,0), OutOfRangeException);
}catch(...)
{
BOOST_ERROR("Failed to catch OutOfRangeException");
}
}
BOOST_AUTO_TEST_CASE(is_on_line2)
{
Line2 line(geom::Vec2(0,0), geom::Vec2(1,0));
......
......@@ -151,8 +151,12 @@ BOOST_AUTO_TEST_CASE(func_composite3)
BOOST_CHECK(Equal(IntersectionPoint(l2,l3), v3));
BOOST_CHECK(!AreIntersecting(l3, l4));
BOOST_CHECK_THROW(IntersectionPoint(l3,l4), GeomException);
try{
BOOST_CHECK_THROW(IntersectionPoint(l3,l4), GeomException);
}catch(...)
{
BOOST_ERROR("Failed to catch GeomException");
}
BOOST_CHECK(Equal(IntersectionPoint(p1,l3), v1));
BOOST_CHECK(Equal(IntersectionPoint(l3,p1), v1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment