From 9c8d1ca18b48dbcc89dda1b9bacdf7d49c7fc754 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 29 May 2019 13:18:14 +0200 Subject: [PATCH] QTestlib: Check compared images for device pixel ratio When accidentally running a test doing screen-grabbing with High DPI scaling active, sizes of the obtained pixmaps can differ due to the device pixel ratio. Add a check to make that clearer. [ChangeLog][QtTestLib] Comparison of QImage, QPixmap now checks for the device pixel ratio. Change-Id: Id8d5187e99c565c44a7bfb8b9cfb09737815fb15 Reviewed-by: Edward Welbourne --- src/testlib/qtest_gui.h | 16 ++ .../testlib/selftests/cmptest/tst_cmptest.cpp | 6 + .../selftests/expected_cmptest.lightxml | 12 ++ .../testlib/selftests/expected_cmptest.tap | 174 ++++++++++-------- .../selftests/expected_cmptest.teamcity | 6 + .../testlib/selftests/expected_cmptest.txt | 10 +- .../testlib/selftests/expected_cmptest.xml | 12 ++ .../selftests/expected_cmptest.xunitxml | 8 +- 8 files changed, 167 insertions(+), 77 deletions(-) diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h index e5101e6955..d1efde54b1 100644 --- a/src/testlib/qtest_gui.h +++ b/src/testlib/qtest_gui.h @@ -162,6 +162,14 @@ inline bool qCompare(QImage const &t1, QImage const &t2, } if (t1Null && t2Null) return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line); + if (!qFuzzyCompare(t1.devicePixelRatioF(), t2.devicePixelRatioF())) { + qsnprintf(msg, 1024, "Compared QImages differ in device pixel ratio.\n" + " Actual (%s): %g\n" + " Expected (%s): %g", + actual, t1.devicePixelRatioF(), + expected, t2.devicePixelRatioF()); + return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line); + } if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QImages differ in size.\n" " Actual (%s): %dx%d\n" @@ -196,6 +204,14 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c } if (t1Null && t2Null) return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line); + if (!qFuzzyCompare(t1.devicePixelRatioF(), t2.devicePixelRatioF())) { + qsnprintf(msg, 1024, "Compared QPixmaps differ in device pixel ratio.\n" + " Actual (%s): %g\n" + " Expected (%s): %g", + actual, t1.devicePixelRatioF(), + expected, t2.devicePixelRatioF()); + return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line); + } if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n" " Actual (%s): %dx%d\n" diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp index 467c53088e..fb01b19d16 100644 --- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp +++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp @@ -466,6 +466,8 @@ void tst_Cmptest::compareQPixmaps_data() const QPixmap pixmap1(xpmPixmapData1); const QPixmap pixmap2(xpmPixmapData2); const QPixmap pixmap3(xpmPixmapData3); + QPixmap pixmapWrongDpr = pixmap1.scaled(2, 2); + pixmapWrongDpr.setDevicePixelRatio(2); QTest::newRow("both null") << QPixmap() << QPixmap(); QTest::newRow("one null") << QPixmap() << pixmap1; @@ -473,6 +475,7 @@ void tst_Cmptest::compareQPixmaps_data() QTest::newRow("equal") << pixmap1 << pixmap1; QTest::newRow("different size") << pixmap1 << pixmap3; QTest::newRow("different pixels") << pixmap1 << pixmap2; + QTest::newRow("different dpr") << pixmap1 << pixmapWrongDpr; } void tst_Cmptest::compareQPixmaps() @@ -492,6 +495,8 @@ void tst_Cmptest::compareQImages_data() const QImage image2(QPixmap(xpmPixmapData2).toImage()); const QImage image1Indexed = image1.convertToFormat(QImage::Format_Indexed8); const QImage image3(QPixmap(xpmPixmapData3).toImage()); + QImage imageWrongDpr = image1.scaled(2, 2); + imageWrongDpr.setDevicePixelRatio(2); QTest::newRow("both null") << QImage() << QImage(); QTest::newRow("one null") << QImage() << image1; @@ -500,6 +505,7 @@ void tst_Cmptest::compareQImages_data() QTest::newRow("different size") << image1 << image3; QTest::newRow("different format") << image1 << image1Indexed; QTest::newRow("different pixels") << image1 << image2; + QTest::newRow("different dpr") << image1 << imageWrongDpr; } void tst_Cmptest::compareQImages() diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml index 58b5a5e530..f108933585 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.lightxml +++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml @@ -208,6 +208,12 @@ + + + + @@ -245,6 +251,12 @@ + + + + diff --git a/tests/auto/testlib/selftests/expected_cmptest.tap b/tests/auto/testlib/selftests/expected_cmptest.tap index 238db2fc2b..dc9cb5c950 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.tap +++ b/tests/auto/testlib/selftests/expected_cmptest.tap @@ -245,9 +245,9 @@ not ok 32 - compareQPixmaps(one null) found: 1 (opA).isNull() expected: 0 (opB).isNull() actual: 1 (opA).isNull() - at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483) + at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 483 + line: 486 ... not ok 33 - compareQPixmaps(other null) --- @@ -257,9 +257,9 @@ not ok 33 - compareQPixmaps(other null) found: 0 (opA).isNull() expected: 1 (opB).isNull() actual: 0 (opA).isNull() - at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483) + at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 483 + line: 486 ... ok 34 - compareQPixmaps(equal) not ok 35 - compareQPixmaps(different size) @@ -270,19 +270,31 @@ not ok 35 - compareQPixmaps(different size) found: 11x20 (opA) expected: 20x20 (opB) actual: 11x20 (opA) - at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483) + at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 483 + line: 486 ... not ok 36 - compareQPixmaps(different pixels) --- # Compared values are not the same - at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483) + at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 483 + line: 486 ... -ok 37 - compareQImages(both null) -not ok 38 - compareQImages(one null) +not ok 37 - compareQPixmaps(different dpr) + --- + type: QCOMPARE + message: Compared QPixmaps differ in device pixel ratio. + wanted: 2 (opB) + found: 1 (opA) + expected: 2 (opB) + actual: 1 (opA) + at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486) + file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp + line: 486 + ... +ok 38 - compareQImages(both null) +not ok 39 - compareQImages(one null) --- type: QCOMPARE message: Compared QImages differ. @@ -290,11 +302,11 @@ not ok 38 - compareQImages(one null) found: 1 (opA).isNull() expected: 0 (opB).isNull() actual: 1 (opA).isNull() - at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510) + at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 510 + line: 516 ... -not ok 39 - compareQImages(other null) +not ok 40 - compareQImages(other null) --- type: QCOMPARE message: Compared QImages differ. @@ -302,12 +314,12 @@ not ok 39 - compareQImages(other null) found: 0 (opA).isNull() expected: 1 (opB).isNull() actual: 0 (opA).isNull() - at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510) + at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 510 + line: 516 ... -ok 40 - compareQImages(equal) -not ok 41 - compareQImages(different size) +ok 41 - compareQImages(equal) +not ok 42 - compareQImages(different size) --- type: QCOMPARE message: Compared QImages differ in size. @@ -315,11 +327,11 @@ not ok 41 - compareQImages(different size) found: 11x20 (opA) expected: 20x20 (opB) actual: 11x20 (opA) - at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510) + at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 510 + line: 516 ... -not ok 42 - compareQImages(different format) +not ok 43 - compareQImages(different format) --- type: QCOMPARE message: Compared QImages differ in format. @@ -327,19 +339,31 @@ not ok 42 - compareQImages(different format) found: 6 (opA) expected: 3 (opB) actual: 6 (opA) - at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510) + at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 510 + line: 516 ... -not ok 43 - compareQImages(different pixels) +not ok 44 - compareQImages(different pixels) --- # Compared values are not the same - at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510) + at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 510 + line: 516 ... -ok 44 - compareQRegion(equal-empty) -not ok 45 - compareQRegion(1-empty) +not ok 45 - compareQImages(different dpr) + --- + type: QCOMPARE + message: Compared QImages differ in device pixel ratio. + wanted: 2 (opB) + found: 1 (opA) + expected: 2 (opB) + actual: 1 (opA) + at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516) + file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp + line: 516 + ... +ok 46 - compareQRegion(equal-empty) +not ok 47 - compareQRegion(1-empty) --- type: QCOMPARE message: Compared values are not the same @@ -347,12 +371,12 @@ not ok 45 - compareQRegion(1-empty) found: QRegion(200x50+10+10) (rA) expected: QRegion(null) (rB) actual: QRegion(200x50+10+10) (rA) - at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:533) + at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:539) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 533 + line: 539 ... -ok 46 - compareQRegion(equal) -not ok 47 - compareQRegion(different lists) +ok 48 - compareQRegion(equal) +not ok 49 - compareQRegion(different lists) --- type: QCOMPARE message: Compared values are not the same @@ -360,11 +384,11 @@ not ok 47 - compareQRegion(different lists) found: QRegion(200x50+10+10) (rA) expected: QRegion(2 rectangles, 50x200+100+200, 200x50+10+10) (rB) actual: QRegion(200x50+10+10) (rA) - at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:533) + at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:539) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 533 + line: 539 ... -not ok 48 - compareQVector2D() +not ok 50 - compareQVector2D() --- type: QCOMPARE message: Compared values are not the same @@ -372,11 +396,11 @@ not ok 48 - compareQVector2D() found: QVector2D(1, 2) (v2a) expected: QVector2D(1, 3) (v2b) actual: QVector2D(1, 2) (v2a) - at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:542) + at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:548) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 542 + line: 548 ... -not ok 49 - compareQVector3D() +not ok 51 - compareQVector3D() --- type: QCOMPARE message: Compared values are not the same @@ -384,11 +408,11 @@ not ok 49 - compareQVector3D() found: QVector3D(1, 2, 3) (v3a) expected: QVector3D(1, 3, 3) (v3b) actual: QVector3D(1, 2, 3) (v3a) - at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:551) + at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:557) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 551 + line: 557 ... -not ok 50 - compareQVector4D() +not ok 52 - compareQVector4D() --- type: QCOMPARE message: Compared values are not the same @@ -396,11 +420,11 @@ not ok 50 - compareQVector4D() found: QVector4D(1, 2, 3, 4) (v4a) expected: QVector4D(1, 3, 3, 4) (v4b) actual: QVector4D(1, 2, 3, 4) (v4a) - at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:560) + at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:566) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 560 + line: 566 ... -not ok 51 - verify() +not ok 53 - verify() --- type: QVERIFY message: Verification failed @@ -408,35 +432,11 @@ not ok 51 - verify() found: false (opaqueFunc() < 2) expected: true (opaqueFunc() < 2) actual: false (opaqueFunc() < 2) - at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:572) - file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 572 - ... -not ok 52 - verify2() - --- - type: QVERIFY - message: 42 - wanted: true (opaqueFunc() < 2) - found: false (opaqueFunc() < 2) - expected: true (opaqueFunc() < 2) - actual: false (opaqueFunc() < 2) - at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:578) + at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:578) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp line: 578 ... -not ok 53 - tryVerify() - --- - type: QVERIFY - message: Verification failed - wanted: true (opaqueFunc() < 2) - found: false (opaqueFunc() < 2) - expected: true (opaqueFunc() < 2) - actual: false (opaqueFunc() < 2) - at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:584) - file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp - line: 584 - ... -not ok 54 - tryVerify2() +not ok 54 - verify2() --- type: QVERIFY message: 42 @@ -444,13 +444,37 @@ not ok 54 - tryVerify2() found: false (opaqueFunc() < 2) expected: true (opaqueFunc() < 2) actual: false (opaqueFunc() < 2) - at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:590) + at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:584) + file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp + line: 584 + ... +not ok 55 - tryVerify() + --- + type: QVERIFY + message: Verification failed + wanted: true (opaqueFunc() < 2) + found: false (opaqueFunc() < 2) + expected: true (opaqueFunc() < 2) + actual: false (opaqueFunc() < 2) + at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:590) file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp line: 590 ... -ok 55 - verifyExplicitOperatorBool() -ok 56 - cleanupTestCase() -1..56 -# tests 56 +not ok 56 - tryVerify2() + --- + type: QVERIFY + message: 42 + wanted: true (opaqueFunc() < 2) + found: false (opaqueFunc() < 2) + expected: true (opaqueFunc() < 2) + actual: false (opaqueFunc() < 2) + at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:596) + file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp + line: 596 + ... +ok 57 - verifyExplicitOperatorBool() +ok 58 - cleanupTestCase() +1..58 +# tests 58 # pass 18 -# fail 38 +# fail 40 diff --git a/tests/auto/testlib/selftests/expected_cmptest.teamcity b/tests/auto/testlib/selftests/expected_cmptest.teamcity index 422d0cbfdf..426fddb20f 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.teamcity +++ b/tests/auto/testlib/selftests/expected_cmptest.teamcity @@ -95,6 +95,9 @@ ##teamcity[testStarted name='compareQPixmaps(different pixels)' flowId='tst_Cmptest'] ##teamcity[testFailed name='compareQPixmaps(different pixels)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same' flowId='tst_Cmptest'] ##teamcity[testFinished name='compareQPixmaps(different pixels)' flowId='tst_Cmptest'] +##teamcity[testStarted name='compareQPixmaps(different dpr)' flowId='tst_Cmptest'] +##teamcity[testFailed name='compareQPixmaps(different dpr)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared QPixmaps differ in device pixel ratio.|n Actual (opA): 1|n Expected (opB): 2' flowId='tst_Cmptest'] +##teamcity[testFinished name='compareQPixmaps(different dpr)' flowId='tst_Cmptest'] ##teamcity[testStarted name='compareQImages(both null)' flowId='tst_Cmptest'] ##teamcity[testFinished name='compareQImages(both null)' flowId='tst_Cmptest'] ##teamcity[testStarted name='compareQImages(one null)' flowId='tst_Cmptest'] @@ -114,6 +117,9 @@ ##teamcity[testStarted name='compareQImages(different pixels)' flowId='tst_Cmptest'] ##teamcity[testFailed name='compareQImages(different pixels)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same' flowId='tst_Cmptest'] ##teamcity[testFinished name='compareQImages(different pixels)' flowId='tst_Cmptest'] +##teamcity[testStarted name='compareQImages(different dpr)' flowId='tst_Cmptest'] +##teamcity[testFailed name='compareQImages(different dpr)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared QImages differ in device pixel ratio.|n Actual (opA): 1|n Expected (opB): 2' flowId='tst_Cmptest'] +##teamcity[testFinished name='compareQImages(different dpr)' flowId='tst_Cmptest'] ##teamcity[testStarted name='compareQRegion(equal-empty)' flowId='tst_Cmptest'] ##teamcity[testFinished name='compareQRegion(equal-empty)' flowId='tst_Cmptest'] ##teamcity[testStarted name='compareQRegion(1-empty)' flowId='tst_Cmptest'] diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt index e1aa81c1a1..08877ef74d 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.txt +++ b/tests/auto/testlib/selftests/expected_cmptest.txt @@ -104,6 +104,10 @@ FAIL! : tst_Cmptest::compareQPixmaps(different size) Compared QPixmaps differ i Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)] FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)] +FAIL! : tst_Cmptest::compareQPixmaps(different dpr) Compared QPixmaps differ in device pixel ratio. + Actual (opA): 1 + Expected (opB): 2 + Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)] PASS : tst_Cmptest::compareQImages(both null) FAIL! : tst_Cmptest::compareQImages(one null) Compared QImages differ. Actual (opA).isNull(): 1 @@ -124,6 +128,10 @@ FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ i Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)] FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)] +FAIL! : tst_Cmptest::compareQImages(different dpr) Compared QImages differ in device pixel ratio. + Actual (opA): 1 + Expected (opB): 2 + Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)] PASS : tst_Cmptest::compareQRegion(equal-empty) FAIL! : tst_Cmptest::compareQRegion(1-empty) Compared values are not the same Actual (rA): QRegion(200x50+10+10) @@ -156,5 +164,5 @@ FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42) Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)] PASS : tst_Cmptest::verifyExplicitOperatorBool() PASS : tst_Cmptest::cleanupTestCase() -Totals: 18 passed, 38 failed, 0 skipped, 0 blacklisted, 0ms +Totals: 18 passed, 40 failed, 0 skipped, 0 blacklisted, 0ms ********* Finished testing of tst_Cmptest ********* diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml index 1c5a17631a..daf2560f1b 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xml +++ b/tests/auto/testlib/selftests/expected_cmptest.xml @@ -210,6 +210,12 @@ + + + + @@ -247,6 +253,12 @@ + + + + diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml index 99823d1c1c..397db4c3e4 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml +++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml @@ -1,5 +1,5 @@ - + @@ -98,6 +98,9 @@ Actual (opA): 11x20 Expected (opB): 20x20" result="fail"/> + +