From d6bb8eead91a4b852e362e2cb4d67f6c3402fc87 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 6 Dec 2021 14:20:52 +0100 Subject: [PATCH] Fixed 3mf unit tests to pass on ARM 64bit --- tests/libslic3r/test_3mf.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/libslic3r/test_3mf.cpp b/tests/libslic3r/test_3mf.cpp index 0ebe47a07..3602d6972 100644 --- a/tests/libslic3r/test_3mf.cpp +++ b/tests/libslic3r/test_3mf.cpp @@ -112,7 +112,17 @@ SCENARIO("2D convex hull of sinking object", "[3mf]") { { -91501496, 4243 } }; - bool res = hull_2d.points == result; + // Allow 1um error due to floating point rounding. + bool res = hull_2d.points.size() == result.size(); + if (res) + for (size_t i = 0; i < result.size(); ++ i) { + const Point &p1 = result[i]; + const Point &p2 = hull_2d.points[i]; + if (std::abs(p1.x() - p2.x()) > 1 || std::abs(p1.y() - p2.y()) > 1) { + res = false; + break; + } + } THEN("2D convex hull should match with reference") { REQUIRE(res);