u02: Improve test performance

This commit is contained in:
Simon Bruder 2023-05-06 18:38:47 +02:00
parent 8b88c14b02
commit 240d5435f2

View file

@ -142,6 +142,7 @@ TEST_CASE("DDA line tool (prop: for every row/column, only one pixel is set)") {
unique_direction_max = y_max;
}
bool all_sums_are_one = true;
int sum;
for (int dd = draw_direction_min; dd <= draw_direction_max; dd++) {
sum = 0;
@ -157,6 +158,9 @@ TEST_CASE("DDA line tool (prop: for every row/column, only one pixel is set)") {
if (canvas->get_pixel(x, y))
sum++;
}
REQUIRE(sum == 1);
if (sum != 1)
all_sums_are_one = false;
}
REQUIRE(all_sums_are_one);
}