Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add testing values in the neighbourhood of 0.5

Dmitry Kazakov52a2556bc29c
diff --git a/libs/pigment/tests/TestCompositeOpInversion.cpp b/libs/pigment/tests/TestCompositeOpInversion.cpp
index 81888f281f..808421e534 100644
--- a/libs/pigment/tests/TestCompositeOpInversion.cpp
+++ b/libs/pigment/tests/TestCompositeOpInversion.cpp
@@ -777,7 +777,11 @@ void TestCompositeOpInversion::testFloatModes()
0 - std::numeric_limits<float>::epsilon(),
0,
0 + std::numeric_limits<float>::epsilon(),
- 0.1, 0.2, 0.5, 0.8, 0.9,
+ 0.1, 0.2,
+ 0.5 - 2 * std::numeric_limits<float>::epsilon(),
+ 0.5,
+ 0.5 + 2 * std::numeric_limits<float>::epsilon(),
+ 0.8, 0.9,
1.0 - std::numeric_limits<float>::epsilon(),
1.0,
1.0 + std::numeric_limits<float>::epsilon(),
@@ -880,8 +884,9 @@ void TestCompositeOpInversion::testFloatModes()
* instability.
*/
const bool shouldSkipCheck =
- (id == COMPOSITE_HARD_LIGHT &&
- qFuzzyCompare(srcColorValue, 0.5));
+ id == COMPOSITE_HARD_LIGHT &&
+ (qFuzzyCompare(float(srcColorValue), 0.5f) ||
+ qFuzzyCompare(float(dstColorValue), 0.5f));
if (!shouldSkipCheck && difference > maxDifference) {