Fix integer overflows in libnest2d tests

This commit is contained in:
tamasmeszaros 2021-04-14 08:51:54 +02:00
parent dca67822d1
commit 949b0e63e8

View File

@ -1207,7 +1207,7 @@ TEST_CASE("Test for biggest bounding box area", "[Nesting], [NestKernels]")
pconfig.object_function = [&pile_box](const Item &item) -> double {
Box b = sl::boundingBox(item.boundingBox(), pile_box);
double area = b.area<double>() / (W * W);
double area = b.area<double>() / (double(W) * W);
return -area;
};
@ -1223,5 +1223,5 @@ TEST_CASE("Test for biggest bounding box area", "[Nesting], [NestKernels]")
// Here the result shall be a stairway of boxes
REQUIRE(pile.size() == N);
REQUIRE(bb.area() == N * N * W * W);
REQUIRE(bb.area() == double(N) * N * W * W);
}