diff options
Diffstat (limited to 'tests/auto/gui')
34 files changed, 235 insertions, 364 deletions
diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp index 25c6c81b2a..74eec26c52 100644 --- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp +++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp @@ -127,8 +127,8 @@ void tst_QIcoImageFormat::canRead_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 1; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 1; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 1; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 1; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 1; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 1; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 1; QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << 0; QTest::newRow("103x16px, 24BPP") << "valid/trolltechlogo_tiny.ico" << 1; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 1; @@ -198,8 +198,8 @@ void tst_QIcoImageFormat::imageCount_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 3; QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << 0; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9; QTest::newRow("PNG compression") << "valid/Qt.ico" << 4; @@ -227,8 +227,8 @@ void tst_QIcoImageFormat::jumpToNextImage_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 3; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9; QTest::newRow("PNG compression") << "valid/Qt.ico" << 4; } @@ -276,8 +276,8 @@ void tst_QIcoImageFormat::nextImageDelay_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 3; QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << -1; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9; QTest::newRow("PNG compression") << "valid/Qt.ico" << 4; diff --git a/tests/auto/gui/image/qicon/heart.svg b/tests/auto/gui/image/qicon/heart.svg deleted file mode 100644 index 8c982cd93c..0000000000 --- a/tests/auto/gui/image/qicon/heart.svg +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --><svg viewBox="100 200 550 500" height="841.88976pt" id="svg1" inkscape:version="0.40+cvs" sodipodi:docbase="C:\Documents and Settings\Jon Phillips\My Documents\projects\clipart-project\submissions" sodipodi:docname="heart-left-highlight.svg" sodipodi:version="0.32" width="595.27559pt" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"> -<metadata> -<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> -<cc:Work rdf:about=""> -<dc:title>Heart Left-Highlight</dc:title> -<dc:description>This is a normal valentines day heart.</dc:description> -<dc:subject> -<rdf:Bag> -<rdf:li>holiday</rdf:li> -<rdf:li>valentines</rdf:li> -<rdf:li></rdf:li> -<rdf:li>valentine</rdf:li> -<rdf:li>hash(0x8a091c0)</rdf:li> -<rdf:li>hash(0x8a0916c)</rdf:li> -<rdf:li>signs_and_symbols</rdf:li> -<rdf:li>hash(0x8a091f0)</rdf:li> -<rdf:li>day</rdf:li> -</rdf:Bag> -</dc:subject> -<dc:publisher> -<cc:Agent rdf:about="http://www.openclipart.org"> -<dc:title>Jon Phillips</dc:title> -</cc:Agent> -</dc:publisher> -<dc:creator> -<cc:Agent> -<dc:title>Jon Phillips</dc:title> -</cc:Agent> -</dc:creator> -<dc:rights> -<cc:Agent> -<dc:title>Jon Phillips</dc:title> -</cc:Agent> -</dc:rights> -<dc:date></dc:date> -<dc:format>image/svg+xml</dc:format> -<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> -<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/> -<dc:language>en</dc:language> -</cc:Work> -<cc:License rdf:about="http://web.resource.org/cc/PublicDomain"> -<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/> -<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/> -<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/> -</cc:License> -</rdf:RDF> -</metadata> -<defs id="defs3"/> -<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="549.40674" inkscape:cy="596.00159" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="615" inkscape:window-width="866" inkscape:window-x="88" inkscape:window-y="116" inkscape:zoom="0.35000000" pagecolor="#ffffff" showguides="true"/> -<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1"> -<path d="M 263.41570,235.14588 C 197.17570,235.14588 143.41575,288.90587 143.41575,355.14588 C 143.41575,489.90139 279.34890,525.23318 371.97820,658.45392 C 459.55244,526.05056 600.54070,485.59932 600.54070,355.14588 C 600.54070,288.90588 546.78080,235.14587 480.54070,235.14588 C 432.49280,235.14588 391.13910,263.51631 371.97820,304.33338 C 352.81740,263.51630 311.46370,235.14587 263.41570,235.14588 z " id="path7" sodipodi:nodetypes="ccccccc" style="fill:#e60000;fill-opacity:1.0000000;stroke:#000000;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/> -<path d="M 265.00000,253.59375 C 207.04033,253.59375 160.00000,300.63407 160.00000,358.59375 C 160.00000,476.50415 278.91857,507.43251 359.96875,624.00000 C 366.52868,614.08205 220.00000,478.47309 220.00000,378.59375 C 220.00000,320.63407 267.04033,273.59375 325.00000,273.59375 C 325.50453,273.59375 325.99718,273.64912 326.50000,273.65625 C 309.22436,261.07286 288.00557,253.59374 265.00000,253.59375 z " id="path220" sodipodi:nodetypes="ccccccc" style="fill:#e6e6e6;fill-opacity:0.64556962;stroke:none;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/> -</g> -</svg> diff --git a/tests/auto/gui/image/qicon/heart.svgz b/tests/auto/gui/image/qicon/heart.svgz Binary files differdeleted file mode 100644 index 0f0913ffa7..0000000000 --- a/tests/auto/gui/image/qicon/heart.svgz +++ /dev/null diff --git a/tests/auto/gui/image/qicon/rect.svg b/tests/auto/gui/image/qicon/rect.svg deleted file mode 100644 index 8eb24727be..0000000000 --- a/tests/auto/gui/image/qicon/rect.svg +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" - width="40px" - height="5px" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.46" - sodipodi:docname="test.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview - inkscape:window-height="1005" - inkscape:window-width="1280" - inkscape:pageshadow="2" - inkscape:pageopacity="0.0" - guidetolerance="10.0" - gridtolerance="10.0" - objecttolerance="10.0" - borderopacity="1.0" - bordercolor="#666666" - pagecolor="#ffffff" - id="base" - showgrid="false" - inkscape:zoom="13.6" - inkscape:cx="20" - inkscape:cy="2.5" - inkscape:window-x="-4" - inkscape:window-y="-4" - inkscape:current-layer="svg2" /> - <defs - id="defs4"> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 2.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="40 : 2.5 : 1" - inkscape:persp3d-origin="20 : 1.6666667 : 1" - id="perspective9" /> - </defs> - <g - id="layer1"> - <rect - width="40px" - height="5px" - x="0px" - y="0px" - id="rect2393" - style="fill:#ff0000" /> - </g> - <rect - style="fill:#000000" - id="rect2382" - width="2" - height="2" - x="19" - y="1.5" /> -</svg> diff --git a/tests/auto/gui/image/qicon/trash.svg b/tests/auto/gui/image/qicon/trash.svg deleted file mode 100644 index c44e4c75a2..0000000000 --- a/tests/auto/gui/image/qicon/trash.svg +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 10, SVG Export Plug-In . SVG Version: 3.0.0 Build 76) --><svg enable-background="new 0 0 347 348" height="348" i:pageBounds="0 792 612 0" i:rulerOrigin="0 0" i:viewOrigin="131 567" overflow="visible" space="preserve" viewBox="-20 -20 387 388" width="347" xmlns="http://www.w3.org/2000/svg" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" xmlns:graph="http://ns.adobe.com/Graphs/1.0/" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:x="http://ns.adobe.com/Extensibility/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> -<metadata> -<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> -<cc:Work rdf:about=""> -<dc:title>Keep Tidy Inside</dc:title> -<dc:description></dc:description> -<dc:subject> -<rdf:Bag> -<rdf:li></rdf:li> -<rdf:li>symbol</rdf:li> -<rdf:li>bin</rdf:li> -<rdf:li>signs_and_symbols</rdf:li> -<rdf:li>clean</rdf:li> -<rdf:li>rubish</rdf:li> -<rdf:li>trash</rdf:li> -<rdf:li>inside</rdf:li> -<rdf:li>garbage</rdf:li> -<rdf:li>sign</rdf:li> -</rdf:Bag> -</dc:subject> -<dc:publisher> -<cc:Agent rdf:about="http://www.openclipart.org"> -<dc:title>Martin Owens</dc:title> -</cc:Agent> -</dc:publisher> -<dc:creator> -<cc:Agent> -<dc:title>Martin Owens</dc:title> -</cc:Agent> -</dc:creator> -<dc:rights> -<cc:Agent> -<dc:title>Martin Owens</dc:title> -</cc:Agent> -</dc:rights> -<dc:date></dc:date> -<dc:format>image/svg+xml</dc:format> -<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> -<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/> -<dc:language>en</dc:language> -</cc:Work> -<cc:License rdf:about="http://web.resource.org/cc/PublicDomain"> -<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/> -<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/> -<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/> -</cc:License> -</rdf:RDF> -</metadata> -<g i:dimmedPercent="50" i:knockout="Off" i:layer="yes" i:rgbTrio="#4F008000FFFF" id="Layer_1"> -<path d="M347,174c0,96.098-77.679,174-173.5,174C77.679,348,0,270.098,0,174 C0,77.902,77.679,0,173.5,0C269.321,0,347,77.902,347,174z" fill="#10A040" i:knockout="Off"/> -<path d="M238,53c0,13.807-11.864,25-26.5,25S185,66.807,185,53s11.864-25,26.5-25 S238,39.193,238,53z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M66,175c1.055,6.355,19.333,126.417,19.333,126.417h68.333 c0,0,14.105-122.524,14.333-126.417c6.224-0.622,6.667-13-2-13c-12.164,0-89.205-0.059-98,0S61.167,174.487,66,175z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M78,141c17.292-5.325,24.179-23.532,27-31c14.513,6.596,40.333,12.265,59,8 c3.683,19.419-28.043,19.31-23,37C132.577,145.705,89.404,167.292,78,141z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M103,82l139-1c-0.6,3.421,33.633,57.497,29,67c-4.089,0.418-67,5-67,5 c6.109-9.379-13-43-13-43L103,82z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M270,156l-66-3c0,0-23.565,143.355-24,145s1.855,2.536,3,1s51-82,51-82 s19.754,80.701,20,82s3.721,1.209,4,0S270,156,270,156z" fill="#FFFFFF" i:knockout="Off"/> -</g> -</svg> diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 7d455f1010..4a9ab93921 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -58,13 +58,11 @@ private slots: void actualSize(); void actualSize2_data(); // test with 2 pixmaps with different aspect ratio void actualSize2(); - void svgActualSize(); void isNull(); void swap(); void bestMatch(); void cacheKey(); void detach(); - void svg(); void addFile(); void availableSizes(); void name(); @@ -181,28 +179,6 @@ void tst_QIcon::actualSize2() QCOMPARE(icon.pixmap(argument).size(), result); } -void tst_QIcon::svgActualSize() -{ - if (!haveImageFormat("svg")) { - QSKIP("SVG support is not available"); - } - - const QString prefix = QFileInfo(QFINDTESTDATA("icons")).absolutePath() + "/"; - QIcon icon(prefix + "rect.svg"); - QCOMPARE(icon.actualSize(QSize(16, 16)), QSize(16, 2)); - QCOMPARE(icon.pixmap(QSize(16, 16)).size(), QSize(16, 2)); - - QPixmap p(16, 16); - p.fill(Qt::cyan); - icon.addPixmap(p); - - QCOMPARE(icon.actualSize(QSize(16, 16)), QSize(16, 16)); - QCOMPARE(icon.pixmap(QSize(16, 16)).size(), QSize(16, 16)); - - QCOMPARE(icon.actualSize(QSize(16, 14)), QSize(16, 2)); - QCOMPARE(icon.pixmap(QSize(16, 14)).size(), QSize(16, 2)); -} - void tst_QIcon::isNull() { // test default constructor QIcon defaultConstructor; @@ -395,54 +371,6 @@ void tst_QIcon::detach() QVERIFY(img1 == img2); } -void tst_QIcon::svg() -{ - if (!haveImageFormat("svg")) { - QSKIP("SVG support is not available"); - } - QIcon icon1("heart.svg"); - - QVERIFY(!icon1.pixmap(32).isNull()); - QImage img1 = icon1.pixmap(32).toImage(); - QVERIFY(!icon1.pixmap(32, QIcon::Disabled).isNull()); - QImage img2 = icon1.pixmap(32, QIcon::Disabled).toImage(); - - icon1.addFile("trash.svg", QSize(), QIcon::Disabled); - QVERIFY(!icon1.pixmap(32, QIcon::Disabled).isNull()); - QImage img3 = icon1.pixmap(32, QIcon::Disabled).toImage(); - QVERIFY(img3 != img2); - QVERIFY(img3 != img1); - - QPixmap pm("image.png"); - icon1.addPixmap(pm, QIcon::Normal, QIcon::On); - QVERIFY(!icon1.pixmap(128, QIcon::Normal, QIcon::On).isNull()); - QImage img4 = icon1.pixmap(128, QIcon::Normal, QIcon::On).toImage(); - QVERIFY(img4 != img3); - QVERIFY(img4 != img2); - QVERIFY(img4 != img1); - - QIcon icon2; - icon2.addFile("heart.svg"); - QVERIFY(icon2.pixmap(57).toImage() == icon1.pixmap(57).toImage()); - - QIcon icon3("trash.svg"); - icon3.addFile("heart.svg"); - QVERIFY(icon3.pixmap(57).toImage() == icon1.pixmap(57).toImage()); - - QIcon icon4("heart.svg"); - icon4.addFile("image.png", QSize(), QIcon::Active); - QVERIFY(!icon4.pixmap(32).isNull()); - QVERIFY(!icon4.pixmap(32, QIcon::Active).isNull()); - QVERIFY(icon4.pixmap(32).toImage() == img1); - QIcon pmIcon(pm); - QVERIFY(icon4.pixmap(pm.size(), QIcon::Active).toImage() == pmIcon.pixmap(pm.size(), QIcon::Active).toImage()); - -#ifndef QT_NO_COMPRESS - QIcon icon5("heart.svgz"); - QVERIFY(!icon5.pixmap(32).isNull()); -#endif -} - void tst_QIcon::addFile() { QIcon icon; @@ -506,22 +434,6 @@ void tst_QIcon::availableSizes() QCOMPARE(availableSizes.at(0), QSize(16,16)); } - if (haveImageFormat("svg")) { - // checks that there are no availableSizes for scalable images. - QIcon icon("heart.svg"); - QList<QSize> availableSizes = icon.availableSizes(); - QVERIFY(availableSizes.isEmpty()); - } - - if (haveImageFormat("svg")) { - // even if an a scalable image contain added pixmaps, - // availableSizes still should be empty. - QIcon icon("heart.svg"); - icon.addFile("image.png", QSize(32,32)); - QList<QSize> availableSizes = icon.availableSizes(); - QVERIFY(availableSizes.isEmpty()); - } - { // we try to load an icon from resources QIcon icon(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")); diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index cda887d8e1..c5c2b13b3e 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -1025,17 +1025,17 @@ void tst_QImage::setPixel_data() QTest::newRow("RGB16 blue") << int(QImage::Format_RGB16) << 0xff0000ff << 0x001fu; QTest::newRow("ARGB8565_Premultiplied red") << int(QImage::Format_ARGB8565_Premultiplied) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0xf800ffu; QTest::newRow("ARGB8565_Premultiplied green") << int(QImage::Format_ARGB8565_Premultiplied) - << 0xff00ff00 << 0xff00ff00; + << 0xff00ff00 << 0x07e0ffu; QTest::newRow("ARGB8565_Premultiplied blue") << int(QImage::Format_ARGB8565_Premultiplied) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0x001fffu; QTest::newRow("RGB666 red") << int(QImage::Format_RGB666) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0x03f000u; QTest::newRow("RGB666 green") << int(QImage::Format_RGB666) - << 0xff00ff00 << 0xff00ff00;; + << 0xff00ff00 << 0x000fc0u; QTest::newRow("RGB666 blue") << int(QImage::Format_RGB666) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0x00003fu; QTest::newRow("RGB555 red") << int(QImage::Format_RGB555) << 0xffff0000 << 0x7c00u; QTest::newRow("RGB555 green") << int(QImage::Format_RGB555) @@ -1043,17 +1043,17 @@ void tst_QImage::setPixel_data() QTest::newRow("RGB555 blue") << int(QImage::Format_RGB555) << 0xff0000ff << 0x001fu; QTest::newRow("ARGB8555_Premultiplied red") << int(QImage::Format_ARGB8555_Premultiplied) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0x7c00ffu; QTest::newRow("ARGB8555_Premultiplied green") << int(QImage::Format_ARGB8555_Premultiplied) - << 0xff00ff00 << 0xff00ff00; + << 0xff00ff00 << 0x03e0ffu; QTest::newRow("ARGB8555_Premultiplied blue") << int(QImage::Format_ARGB8555_Premultiplied) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0x001fffu; QTest::newRow("RGB888 red") << int(QImage::Format_RGB888) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0x0000ffu; QTest::newRow("RGB888 green") << int(QImage::Format_RGB888) - << 0xff00ff00 << 0xff00ff00; + << 0xff00ff00 << 0x00ff00u; QTest::newRow("RGB888 blue") << int(QImage::Format_RGB888) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0xff0000u; } void tst_QImage::setPixel() @@ -1106,37 +1106,12 @@ void tst_QImage::setPixel() break; } case int(QImage::Format_RGB666): - { - for (int y = 0; y < h; ++y) { - const qrgb666 *row = (const qrgb666*)(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - quint32 result = row[x]; - if (result != expected) - printf("[x,y]: %d,%d, expected=%04x, result=%04x\n", - x, y, expected, result); - QCOMPARE(result, expected); - } - } - break; - } case int(QImage::Format_ARGB8565_Premultiplied): - { - for (int y = 0; y < h; ++y) { - const qargb8565 *row = (const qargb8565*)(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - quint32 result = row[x]; - if (result != expected) - printf("[x,y]: %d,%d, expected=%04x, result=%04x\n", - x, y, expected, result); - QCOMPARE(result, expected); - } - } - break; - } case int(QImage::Format_ARGB8555_Premultiplied): + case int(QImage::Format_RGB888): { for (int y = 0; y < h; ++y) { - const qargb8555 *row = (const qargb8555*)(img.scanLine(y)); + const quint24 *row = (const quint24*)(img.scanLine(y)); for (int x = 0; x < w; ++x) { quint32 result = row[x]; if (result != expected) @@ -1147,20 +1122,6 @@ void tst_QImage::setPixel() } break; } - case int(QImage::Format_RGB888): - { - for (int y = 0; y < h; ++y) { - const qrgb888 *row = (const qrgb888*)(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - qrgb888 result = row[x]; - if (result != expected) - printf("[x,y]: %d,%d, expected=%04x, result=%04x\n", - x, y, expected, quint32(result)); - QCOMPARE(uint(result), expected); - } - } - break; - } default: qFatal("Test not implemented for format %d", format); } diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 8a18bee83f..96171740e2 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -623,7 +623,6 @@ void tst_QImageReader::supportsAnimation_data() QTest::newRow("XPM: marble") << QString("marble.xpm") << false; QTest::newRow("PNG: kollada") << QString("kollada.png") << false; QTest::newRow("PPM: teapot") << QString("teapot.ppm") << false; - QTest::newRow("PPM: teapot") << QString("teapot.ppm") << false; QTest::newRow("PPM: runners") << QString("runners.ppm") << false; QTest::newRow("XBM: gnus") << QString("gnus.xbm") << false; diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index 8473597dac..ad9da27c7e 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -52,6 +52,11 @@ #include <QPainter> #include <QSet> +#ifdef Q_OS_UNIX // for geteuid() +# include <sys/types.h> +# include <unistd.h> +#endif + typedef QMap<QString, QString> QStringMap; typedef QList<int> QIntList; Q_DECLARE_METATYPE(QImage) diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro index 15098770c6..91d93a781d 100644 --- a/tests/auto/gui/image/qpixmap/qpixmap.pro +++ b/tests/auto/gui/image/qpixmap/qpixmap.pro @@ -10,3 +10,5 @@ SOURCES += tst_qpixmap.cpp RESOURCES += qpixmap.qrc TESTDATA += convertFromImage/* convertFromToHICON/* loadFromData/* images/* + +win32:CONFIG += insignificant_test # QTBUG-24183 diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 527dcce916..563baef486 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -52,6 +52,7 @@ #include <qsplashscreen.h> #include <qplatformpixmap_qpa.h> +#include <qplatformintegration_qpa.h> #include <private/qguiapplication_p.h> #include <private/qdrawhelper_p.h> @@ -1342,7 +1343,7 @@ void tst_QPixmap::fromImageReader_data() QTest::newRow("designer_indexed8_with_alpha.gif") << prefix + "/designer_indexed8_with_alpha.gif"; QTest::newRow("designer_rgb32.jpg") << prefix + "/designer_rgb32.jpg"; QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_with_alpha_animated.gif"; - QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_no_alpha_animated.gif"; + QTest::newRow("designer_indexed8_no_alpha_animated") << prefix + "/designer_indexed8_no_alpha_animated.gif"; } void tst_QPixmap::fromImageReader() diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro index 1adae128cf..116e9dd1f1 100644 --- a/tests/auto/gui/kernel/kernel.pro +++ b/tests/auto/gui/kernel/kernel.pro @@ -4,6 +4,7 @@ SUBDIRS=\ qdrag \ qevent \ qfileopenevent \ + qguieventdispatcher \ qguimetatype \ qguivariant \ qinputmethod \ diff --git a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro index fffa097d73..777e2c6b1a 100644 --- a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro +++ b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro @@ -2,3 +2,5 @@ CONFIG += testcase TARGET = tst_qguiapplication QT += core gui testlib SOURCES = tst_qguiapplication.cpp + +win32:CONFIG += insignificant_test # QTBUG-24186 diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index 2fd875b7f4..7664706b93 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -53,6 +53,7 @@ private slots: void focusObject(); void allWindows(); void topLevelWindows(); + void abortQuitOnShow(); }; class DummyWindow : public QWindow @@ -77,6 +78,9 @@ public: void tst_QGuiApplication::focusObject() { +#ifdef Q_OS_MAC + QSKIP("This test fails intermittently, and at different locations. See QTBUG-24322"); +#endif int argc = 0; QGuiApplication app(argc, 0); @@ -152,5 +156,44 @@ void tst_QGuiApplication::topLevelWindows() QCOMPARE(app.topLevelWindows().count(), 0); } +class ShowCloseShowWindow : public QWindow +{ + Q_OBJECT +public: + ShowCloseShowWindow(bool showAgain, QWindow *parent = 0) + : QWindow(parent), showAgain(showAgain) + { + QTimer::singleShot(0, this, SLOT(doClose())); + QTimer::singleShot(500, this, SLOT(exitApp())); + } + +private slots: + void doClose() { + close(); + if (showAgain) + show(); + } + + void exitApp() { + qApp->exit(1); + } + +private: + bool showAgain; +}; + +void tst_QGuiApplication::abortQuitOnShow() +{ + int argc = 0; + QGuiApplication app(argc, 0); + QWindow *window1 = new ShowCloseShowWindow(false); + window1->show(); + QCOMPARE(app.exec(), 0); + + QWindow *window2 = new ShowCloseShowWindow(true); + window2->show(); + QCOMPARE(app.exec(), 1); +} + QTEST_APPLESS_MAIN(tst_QGuiApplication) #include "tst_qguiapplication.moc" diff --git a/tests/auto/gui/kernel/qguieventdispatcher/qguieventdispatcher.pro b/tests/auto/gui/kernel/qguieventdispatcher/qguieventdispatcher.pro new file mode 100644 index 0000000000..3057037e74 --- /dev/null +++ b/tests/auto/gui/kernel/qguieventdispatcher/qguieventdispatcher.pro @@ -0,0 +1,4 @@ +CONFIG += testcase +TARGET = tst_qguieventdispatcher +QT = core gui testlib +SOURCES += ../../../corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp diff --git a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro index c6eb02919e..1e0baafd09 100644 --- a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro +++ b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro @@ -7,5 +7,3 @@ QT += core-private gui-private SOURCES += tst_qkeysequence.cpp RESOURCES += qkeysequence.qrc - -mac: CONFIG += insignificant_test # QTBUG-23058 diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index eed7977c82..29588e2ee9 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -576,6 +576,11 @@ void tst_QKeySequence::parseString() QFETCH( QString, strSequence ); QFETCH( QKeySequence, keycode ); +#ifdef Q_OS_MAC + QEXPECT_FAIL("Win+A", "QTBUG-24406 - This test fails on OSX", Abort); + QEXPECT_FAIL("Simon+G", "QTBUG-24406 - This test fails on OSX", Abort); +#endif + QCOMPARE( QKeySequence(strSequence).toString(), keycode.toString() ); QVERIFY( QKeySequence(strSequence) == keycode ); } diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro index 0115d96c56..363f7dd92e 100644 --- a/tests/auto/gui/kernel/qwindow/qwindow.pro +++ b/tests/auto/gui/kernel/qwindow/qwindow.pro @@ -6,3 +6,4 @@ QT += core-private gui-private testlib SOURCES += tst_qwindow.cpp mac: CONFIG += insignificant_test # QTBUG-23059 + diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index d7c153dca1..90c96b4030 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -45,6 +45,9 @@ #include <QEvent> +// For QSignalSpy slot connections. +Q_DECLARE_METATYPE(Qt::ScreenOrientation) + class tst_QWindow: public QObject { Q_OBJECT @@ -57,6 +60,8 @@ private slots: void touchToMouseTranslation(); void mouseToTouchTranslation(); void mouseToTouchLoop(); + void touchCancel(); + void touchCancelWithTouchToMouse(); void orientation(); void close(); void initTestCase() @@ -274,6 +279,7 @@ public: event->ignore(); return; } + touchEventType = event->type(); QList<QTouchEvent::TouchPoint> points = event->touchPoints(); for (int i = 0; i < points.count(); ++i) { switch (points.at(i).state()) { @@ -283,6 +289,9 @@ public: case Qt::TouchPointReleased: ++touchReleasedCount; break; + case Qt::TouchPointMoved: + ++touchMovedCount; + break; default: break; } @@ -292,14 +301,15 @@ public: InputTestWindow() { keyPressCode = keyReleaseCode = 0; mousePressButton = mouseReleaseButton = 0; - touchPressedCount = touchReleasedCount = 0; - ignoreMouse = ignoreTouch = 0; + touchPressedCount = touchReleasedCount = touchMovedCount = 0; + ignoreMouse = ignoreTouch = false; } int keyPressCode, keyReleaseCode; int mousePressButton, mouseReleaseButton, mouseMoveButton; QPointF mousePressScreenPos, mouseMoveScreenPos; - int touchPressedCount, touchReleasedCount; + int touchPressedCount, touchReleasedCount, touchMovedCount; + QEvent::Type touchEventType; bool ignoreMouse, ignoreTouch; }; @@ -480,11 +490,114 @@ void tst_QWindow::mouseToTouchLoop() QCoreApplication::processEvents(); qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, false); - qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false); + qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, true); +} + +void tst_QWindow::touchCancel() +{ + InputTestWindow window; + window.setGeometry(80, 80, 40, 40); + window.show(); + QTest::qWaitForWindowShown(&window); + + QList<QWindowSystemInterface::TouchPoint> points; + QWindowSystemInterface::TouchPoint tp1; + tp1.id = 1; + + // Start a touch. + tp1.state = Qt::TouchPointPressed; + tp1.area = QRect(10, 10, 4, 4); + points << tp1; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchEventType, QEvent::TouchBegin); + QTRY_COMPARE(window.touchPressedCount, 1); + + // Cancel the active touch sequence. + QWindowSystemInterface::handleTouchCancelEvent(&window, touchDevice); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchEventType, QEvent::TouchCancel); + + // Send a move -> will not be delivered due to the cancellation. + QTRY_COMPARE(window.touchMovedCount, 0); + points[0].state = Qt::TouchPointMoved; + tp1.area.adjust(2, 2, 2, 2); + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchMovedCount, 0); + + // Likewise. The only allowed transition is TouchCancel -> TouchBegin. + QTRY_COMPARE(window.touchReleasedCount, 0); + points[0].state = Qt::TouchPointReleased; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchReleasedCount, 0); + + // Start a new sequence -> from this point on everything should go through normally. + points[0].state = Qt::TouchPointPressed; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchEventType, QEvent::TouchBegin); + QTRY_COMPARE(window.touchPressedCount, 2); + + points[0].state = Qt::TouchPointMoved; + tp1.area.adjust(2, 2, 2, 2); + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchMovedCount, 1); + + points[0].state = Qt::TouchPointReleased; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchReleasedCount, 1); +} + +void tst_QWindow::touchCancelWithTouchToMouse() +{ + InputTestWindow window; + window.ignoreTouch = true; + window.setGeometry(80, 80, 40, 40); + window.show(); + QTest::qWaitForWindowShown(&window); + + QList<QWindowSystemInterface::TouchPoint> points; + QWindowSystemInterface::TouchPoint tp1; + tp1.id = 1; + + tp1.state = Qt::TouchPointPressed; + tp1.area = QRect(100, 100, 4, 4); + points << tp1; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.mousePressButton, int(Qt::LeftButton)); + QTRY_COMPARE(window.mousePressScreenPos, points[0].area.center()); + + // Cancel the touch. Should result in a mouse release for windows that have + // have an active touch-to-mouse sequence. + QWindowSystemInterface::handleTouchCancelEvent(0, touchDevice); + QCoreApplication::processEvents(); + + QTRY_COMPARE(window.mouseReleaseButton, int(Qt::LeftButton)); + + // Now change the window to accept touches. + window.mousePressButton = window.mouseReleaseButton = 0; + window.ignoreTouch = false; + + // Send a touch, there will be no mouse event generated. + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.mousePressButton, 0); + + // Cancel the touch. It should not result in a mouse release with this window. + QWindowSystemInterface::handleTouchCancelEvent(0, touchDevice); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.mouseReleaseButton, 0); } void tst_QWindow::orientation() { + qRegisterMetaType<Qt::ScreenOrientation>("Qt::ScreenOrientation"); + QWindow window; window.setGeometry(80, 80, 40, 40); window.create(); diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro index 0209043d20..2cbd5b7e1c 100644 --- a/tests/auto/gui/painting/qpainter/qpainter.pro +++ b/tests/auto/gui/painting/qpainter/qpainter.pro @@ -5,6 +5,7 @@ QT += widgets widgets-private printsupport testlib SOURCES += tst_qpainter.cpp mac*:CONFIG+=insignificant_test +win32:CONFIG += insignificant_test # QTBUG-24188 TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \ task217400.png diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index bcd009dfb4..44006d4571 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -282,13 +282,13 @@ void tst_QPainterPath::contains_QPointF_data() inside.addEllipse(base_rect.adjusted(5, 5, -5, -5)); QPolygonF inside_poly = inside.toFillPolygon(); for (int i=0; i<inside_poly.size(); ++i) - QTest::newRow("inside_ellipse") << path << inside_poly.at(i) << true; + QTest::newRow(qPrintable(QString("inside_ellipse %1").arg(i))) << path << inside_poly.at(i) << true; QPainterPath outside; outside.addEllipse(base_rect.adjusted(-5, -5, 5, 5)); QPolygonF outside_poly = outside.toFillPolygon(); for (int i=0; i<outside_poly.size(); ++i) - QTest::newRow("outside_ellipse") << path << outside_poly.at(i) << false; + QTest::newRow(qPrintable(QString("outside_ellipse %1").arg(i))) << path << outside_poly.at(i) << false; path = QPainterPath(); base_rect = QRectF(50, 50, 200, 200); @@ -865,12 +865,12 @@ void tst_QPainterPath::testArcMoveTo_data() for (int domain=0; domain<rects.size(); ++domain) { for (int i=-360; i<=360; ++i) { - QTest::newRow("test") << rects.at(domain) << (qreal) i; + QTest::newRow(qPrintable(QString("test %1 %2").arg(domain).arg(i))) << rects.at(domain) << (qreal) i; } // test low angles - QTest::newRow("test") << rects.at(domain) << (qreal) 1e-10; - QTest::newRow("test") << rects.at(domain) << (qreal)-1e-10; + QTest::newRow("low angles 1") << rects.at(domain) << (qreal) 1e-10; + QTest::newRow("low angles 2") << rects.at(domain) << (qreal)-1e-10; } } diff --git a/tests/auto/gui/painting/qprinter/qprinter.pro b/tests/auto/gui/painting/qprinter/qprinter.pro index ebf8edea32..7543e91f8c 100644 --- a/tests/auto/gui/painting/qprinter/qprinter.pro +++ b/tests/auto/gui/painting/qprinter/qprinter.pro @@ -4,3 +4,4 @@ QT += printsupport widgets testlib SOURCES += tst_qprinter.cpp mac*:CONFIG+=insignificant_test +win32:CONFIG += insignificant_test # QTBUG-24191 diff --git a/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro b/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro index b0e69dca2e..88cb07f338 100644 --- a/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro +++ b/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro @@ -7,3 +7,4 @@ QT += printsupport network testlib DEFINES += QT_USE_USING_NAMESPACE mac: CONFIG += insignificant_test # QTBUG-23060 +win32:CONFIG += insignificant_test # QTBUG-24190 diff --git a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp index d312469449..2323dc8df3 100644 --- a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp @@ -110,7 +110,7 @@ QString tst_QPrinterInfo::getDefaultPrinterFromSystem() return QString(); } - QRegExp defaultReg("default.*: *([a-zA-Z0-9_]+)"); + QRegExp defaultReg("default.*: *([a-zA-Z0-9_-]+)"); defaultReg.indexIn(output); QString printer = defaultReg.cap(1); macFixNameFormat(&printer); @@ -221,7 +221,8 @@ void tst_QPrinterInfo::testForDefaultPrinter() # else QString defSysPrinter = getDefaultPrinterFromSystem(); # endif - if (defSysPrinter == "") return; + if (defSysPrinter == "") + QSKIP("No default printer available"); QList<QPrinterInfo> list = QPrinterInfo::availablePrinters(); bool found = false; diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index f3c020dde2..d0af96df37 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -9,3 +9,4 @@ QT += gui gui-private core-private testlib SOURCES += tst_qopengl.cpp mac: CONFIG += insignificant_test # QTBUG-23061 +win32:CONFIG += insignificant_test # QTBUG-24192 diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index 7eda35efb8..7e0a60c859 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -344,7 +344,6 @@ void tst_QCssParser::term_data() val.variant = QVariant(QColor("#ffbb00")); QTest::newRow("hexcolor2") << true << "#fb0" << val; - QTest::ignoreMessage(QtWarningMsg, "QCssParser::parseHexColor: Unknown color name '#cafebabe'"); QTest::newRow("hexcolor_failure") << false << "#cafebabe" << val; val.type = QCss::Value::Uri; @@ -368,6 +367,9 @@ void tst_QCssParser::term() QFETCH(QString, css); QFETCH(QCss::Value, expectedValue); + if (strcmp(QTest::currentDataTag(), "hexcolor_failure") == 0) + QTest::ignoreMessage(QtWarningMsg, "QCssParser::parseHexColor: Unknown color name '#cafebabe'"); + QCss::Parser parser(css); QCss::Value val; QVERIFY(parser.testTerm()); diff --git a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro index c853aaa100..034d08fc8f 100644 --- a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro @@ -11,3 +11,4 @@ wince* { } mac: CONFIG += insignificant_test # QTBUG-23062 +win32:CONFIG += insignificant_test # QTBUG-24193 diff --git a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro index a636651724..bb0d8e3c4a 100644 --- a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro +++ b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro @@ -4,3 +4,4 @@ QT += testlib SOURCES += tst_qfontmetrics.cpp RESOURCES += testfont.qrc +win32:CONFIG += insignificant_test # QTBUG-24195 diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp index 0b5486dd5a..4dbdf9a4f1 100644 --- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp +++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp @@ -140,7 +140,7 @@ void tst_QFontMetrics::metrics() font = fdb.font(family, style, 12); QFontMetrics fontmetrics(font); - QCOMPARE(fontmetrics.ascent() + fontmetrics.descent() + 1, + QCOMPARE(fontmetrics.ascent() + fontmetrics.descent(), fontmetrics.height()); QCOMPARE(fontmetrics.height() + fontmetrics.leading(), @@ -156,7 +156,7 @@ void tst_QFontMetrics::metrics() font = fdb.font(family, style, size); QFontMetrics fontmetrics(font); - QCOMPARE(fontmetrics.ascent() + fontmetrics.descent() + 1, + QCOMPARE(fontmetrics.ascent() + fontmetrics.descent(), fontmetrics.height()); QCOMPARE(fontmetrics.height() + fontmetrics.leading(), fontmetrics.lineSpacing()); diff --git a/tests/auto/gui/text/qglyphrun/qglyphrun.pro b/tests/auto/gui/text/qglyphrun/qglyphrun.pro index acdff0584f..97b9806c11 100644 --- a/tests/auto/gui/text/qglyphrun/qglyphrun.pro +++ b/tests/auto/gui/text/qglyphrun/qglyphrun.pro @@ -10,3 +10,5 @@ wince* { } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } + +win32:CONFIG += insignificant_test # QTBUG-24196 diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro index 149ad6442e..8cac4abc57 100644 --- a/tests/auto/gui/text/qrawfont/qrawfont.pro +++ b/tests/auto/gui/text/qrawfont/qrawfont.pro @@ -9,3 +9,5 @@ SOURCES += \ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src TESTDATA += testfont_bold_italic.ttf testfont.ttf + +win32:CONFIG += insignificant_test # QTBUG-24197 diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index c2ae853a92..213b388895 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -1171,7 +1171,7 @@ void tst_QTextDocument::toHtml_data() fmt.setVerticalAlignment(QTextCharFormat::AlignMiddle); cursor.insertImage(fmt); - QTest::newRow("image-malign") << QTextDocumentFragment(&doc) + QTest::newRow("image-align-middle") << QTextDocumentFragment(&doc) << QString("<p DEFAULTBLOCKSTYLE><img src=\"foo\" style=\"vertical-align: middle;\" /></p>"); } @@ -1183,7 +1183,7 @@ void tst_QTextDocument::toHtml_data() fmt.setVerticalAlignment(QTextCharFormat::AlignTop); cursor.insertImage(fmt); - QTest::newRow("image-malign") << QTextDocumentFragment(&doc) + QTest::newRow("image-align-top") << QTextDocumentFragment(&doc) << QString("<p DEFAULTBLOCKSTYLE><img src=\"foo\" style=\"vertical-align: top;\" /></p>"); } diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index 33293400c2..50ae22c530 100644 --- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -3078,7 +3078,7 @@ void tst_QTextDocumentFragment::html_preNewlineHandling_data() << QString("Foo\nBar"); QTest::newRow("pre2") << QString("Foo<pre>\nBar") << QString("Foo\nBar"); - QTest::newRow("pre2") << QString("Foo<pre>\n\nBar") + QTest::newRow("pre3") << QString("Foo<pre>\n\nBar") << QString("Foo\n\nBar"); QTest::newRow("pre4") << QString("<html>Foo<pre>\nBar") << QString("Foo\nBar"); diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index e7435743e5..8920e63957 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -352,7 +352,7 @@ void tst_QTextLayout::threeLineBoundingRect() QCOMPARE(qRound(line.naturalTextWidth()), thirdLineWidth); y += qRound(line.ascent() + line.descent()); - QCOMPARE(layout.boundingRect(), QRectF(0, 0, longestLine, y + 1)); + QCOMPARE(layout.boundingRect(), QRectF(0, 0, longestLine, y)); } void tst_QTextLayout::boundingRectWithLongLineAndNoWrap() @@ -386,7 +386,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(), pos); QCOMPARE(line.textLength(),2); QCOMPARE(qRound(line.naturalTextWidth()),testFont.pixelSize()); - QCOMPARE((int) line.height(), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE((int) line.height(), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); pos += line.textLength(); @@ -395,7 +395,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(),pos); QCOMPARE(line.textLength(),1); QCOMPARE(qRound(line.naturalTextWidth()), 0); - QCOMPARE((int) line.height(), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE((int) line.height(), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); pos += line.textLength(); @@ -404,7 +404,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(),pos); QCOMPARE(line.textLength(),2); QCOMPARE(qRound(line.naturalTextWidth()),testFont.pixelSize()); - QCOMPARE(qRound(line.height()), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE(qRound(line.height()), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); pos += line.textLength(); @@ -413,7 +413,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(),pos); QCOMPARE(line.textLength(),1); QCOMPARE(qRound(line.naturalTextWidth()), testFont.pixelSize()); - QCOMPARE((int) line.height(), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE((int) line.height(), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); } |