mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-07 17:50:59 +08:00
qt 6.6.0 clean
This commit is contained in:
@ -349,8 +349,10 @@ void tst_QColorSpace::imageConversion64PM()
|
||||
|
||||
for (int j = 0; j < 16; ++j) {
|
||||
int a = j * 15;
|
||||
for (int i = 0; i < 256; ++i)
|
||||
testImage.setPixel(i, j, qPremultiply(qRgba(i, i, i, a)));
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
QRgba64 color = QRgba64::fromRgba(i, i, i, a);
|
||||
testImage.setPixelColor(i, j, QColor::fromRgba64(color));
|
||||
}
|
||||
}
|
||||
|
||||
testImage.setColorSpace(fromColorSpace);
|
||||
@ -389,8 +391,8 @@ void tst_QColorSpace::imageConversion64PM()
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
QRgb expected = qPremultiply(qRgba(i, i, i, expectedAlpha));
|
||||
QRgb p = testImage.pixel(i, j);
|
||||
QCOMPARE(qRed(p), qGreen(p));
|
||||
QCOMPARE(qRed(p), qBlue(p));
|
||||
QVERIFY(qAbs(qRed(p) - qGreen(p)) <= 1);
|
||||
QVERIFY(qAbs(qRed(p) - qBlue(p)) <= 1);
|
||||
QCOMPARE(qAlpha(p), expectedAlpha);
|
||||
QVERIFY((lastRed - qRed(p)) <= 0);
|
||||
QVERIFY((lastGreen - qGreen(p)) <= 0);
|
||||
|
@ -470,15 +470,19 @@ void tst_QPathClipper::clipTest(int subjectIndex, int clipIndex, QPathClipper::O
|
||||
break;
|
||||
}
|
||||
|
||||
if (expected != inResult) {
|
||||
char str[256];
|
||||
const char *opStr =
|
||||
op == QPathClipper::BoolAnd ? "and" :
|
||||
op == QPathClipper::BoolOr ? "or" : "sub";
|
||||
sprintf(str, "Expected: %d, actual: %d, subject: %d, clip: %d, op: %s\n",
|
||||
int(expected), int(inResult), subjectIndex, clipIndex, opStr);
|
||||
QFAIL(str);
|
||||
}
|
||||
auto failLogger = qScopeGuard([&]{
|
||||
qCritical().noquote().nospace()
|
||||
<< "\n\tExpected: " << expected
|
||||
<< "\n\tActual: " << inResult
|
||||
<< "\n\tSubject: " << subjectIndex
|
||||
<< "\n\tClip: " << clipIndex
|
||||
<< "\n\tOp: " << (op == QPathClipper::BoolAnd
|
||||
? "and"
|
||||
: op == QPathClipper::BoolOr
|
||||
? "or" : "sub");
|
||||
});
|
||||
QCOMPARE(inResult, expected);
|
||||
failLogger.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user