diff --git a/u02/src/tests.cpp b/u02/src/tests.cpp index cde85bb..81521ae 100644 --- a/u02/src/tests.cpp +++ b/u02/src/tests.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "bresenham_circle_tool.h" #include "bresenham_line_tool.h" @@ -349,7 +350,12 @@ TEST_CASE("Bresenham circle (prop: √(x²+y²)-r<ε)") { if ((x0 == min_c || x0 == max_c) && (x1 == min_c || x1 == max_c) && (y0 == min_c || y0 == max_c) && (y1 == min_c || y1 == max_c)) { - SKIP("All coordinates have extreme value, skipping (avoid rounding error)"); + // catch2’s SKIP macro does not exactly do what I want here, + // so this just returns from the function and prints a message. + std::cerr + << "All coordinates have extreme value, skipping (avoid rounding error)" + << std::endl; + return; } const float r = @@ -537,7 +543,11 @@ TEST_CASE("Star (prop: all points inside circle)") { if ((x0 == min_c || x0 == max_c) && (x1 == min_c || x1 == max_c) && (y0 == min_c || y0 == max_c) && (y1 == min_c || y1 == max_c)) { - SKIP("All coordinates have extreme value, skipping (avoid rounding error)"); + // see above + std::cerr + << "All coordinates have extreme value, skipping (avoid rounding error)" + << std::endl; + return; } const float r = std::sqrt(std::pow((x1 - x0), 2) + std::pow((y1 - y0), 2));