From 949b0e63e8579a6c5ef87ea2e730e9b6c782aa0a Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Wed, 14 Apr 2021 08:51:54 +0200 Subject: [PATCH] Fix integer overflows in libnest2d tests --- tests/libnest2d/libnest2d_tests_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/libnest2d/libnest2d_tests_main.cpp b/tests/libnest2d/libnest2d_tests_main.cpp index 1cec8dcba..181f130e5 100644 --- a/tests/libnest2d/libnest2d_tests_main.cpp +++ b/tests/libnest2d/libnest2d_tests_main.cpp @@ -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() / (W * W); + double area = b.area() / (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); }