From 3723fbd99f1aa4c835cf19bb2af51fc5acf2b118 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Fri, 12 Sep 2025 23:00:22 -0500 Subject: [PATCH] Fixing regression on Mac and Windows builds for Clip blend modes (color tolerances) --- tests/Clip.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/Clip.cpp b/tests/Clip.cpp index b2c75942..5f06a523 100644 --- a/tests/Clip.cpp +++ b/tests/Clip.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "Clip.h" #include "DummyReader.h" @@ -796,10 +797,12 @@ TEST_CASE("all_composite_modes_simple_colors", "[libopenshot][clip][composite]") else if (mode == COMPOSITE_DESTINATION_OUT || mode == COMPOSITE_SOURCE_ATOP) expect = dst_color; - CHECK(result.red() == expect.red()); - CHECK(result.green() == expect.green()); - CHECK(result.blue() == expect.blue()); - CHECK(result.alpha() == expect.alpha()); + // Allow a small tolerance to account for platform-specific + // rounding differences in Qt's composition modes + CHECK(std::abs(result.red() - expect.red()) <= 1); + CHECK(std::abs(result.green() - expect.green()) <= 1); + CHECK(std::abs(result.blue() - expect.blue()) <= 1); + CHECK(std::abs(result.alpha() - expect.alpha()) <= 1); } }