From 41a0e270ac3683cb47590d53943c21a36d684051 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 a0f192460..e3ffe9c6e 100644 --- a/tests/libnest2d/libnest2d_tests_main.cpp +++ b/tests/libnest2d/libnest2d_tests_main.cpp @@ -1171,7 +1171,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; }; @@ -1187,5 +1187,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); }