diff --git a/u02/src/tests.cpp b/u02/src/tests.cpp index f0d205a..cde85bb 100644 --- a/u02/src/tests.cpp +++ b/u02/src/tests.cpp @@ -17,7 +17,7 @@ #include "sweep_line_tool.h" #include "util.h" -using Catch::Matchers::WithinRel; +using Catch::Matchers::WithinAbs; TEST_CASE("Transform Mirror") { // elementary operations @@ -440,7 +440,7 @@ TEST_CASE("Barycentric coordinates (prop: Σ = 1)") { // If all points are on a straight line, the property does not hold if (!(x0 == x1 && x1 == x2) && !(y0 == y1 && y1 == y2)) { - REQUIRE_THAT(b1 + b2 + b3, WithinRel(1.0, 0.01)); + REQUIRE_THAT(b1 + b2 + b3, WithinAbs(1.0, 0.01)); } } @@ -580,8 +580,8 @@ TEST_CASE("Star (prop: average of all points is centre)") { y += point.second; } - REQUIRE_THAT(x / points.size(), WithinRel(x0, 0.1)); - REQUIRE_THAT(y / points.size(), WithinRel(y0, 0.1)); + REQUIRE_THAT(x / points.size(), WithinAbs(x0, 0.5)); + REQUIRE_THAT(y / points.size(), WithinAbs(y0, 0.5)); } // The Haskell implementation of regular_polygon_mod has many more tests,