From f9f5b35e7321fded3fdd887fce656475c3d83f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Wed, 16 Aug 2017 09:57:45 +0300 Subject: Blacklist tst_QFont::DefaultFamily in B2Qt Task-number: QTBUG-62528 Change-Id: Iadf9a923b2a624c5082fd1bd61691f8100178f94 Reviewed-by: Sami Nurmenniemi Reviewed-by: Simon Hausmann --- tests/auto/gui/text/qfont/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/gui/text/qfont/BLACKLIST b/tests/auto/gui/text/qfont/BLACKLIST index 8890ec1ef3..295c61ff12 100644 --- a/tests/auto/gui/text/qfont/BLACKLIST +++ b/tests/auto/gui/text/qfont/BLACKLIST @@ -2,3 +2,5 @@ # QTBUG-46054 opensuse-13.1 opensuse-42.1 +[defaultFamily] +b2qt -- cgit v1.2.3 From a3d59c7c7f675b0a4e128efeb781aa1c2f7db4c0 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 15 Aug 2017 10:29:16 +0200 Subject: Block input to a window shown while an application modal dialog is visible Although the window is refused input for the most part from the system, it does not act like that it is blocked by the application modal dialog. This ensures that it is the case and prevents things like being able to double click on the title bar to maximize the window on Windows. Task-number: QTBUG-49102 Change-Id: If1582819b90cb2ec9d891f664da24f13bfec7103 Reviewed-by: Paul Olav Tvete --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'tests') diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 92f7182249..e1366ce2eb 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -105,6 +105,7 @@ private slots: void stateChange(); void flags(); void cleanup(); + void testBlockingWindowShownAfterModalDialog(); private: QPoint m_availableTopLeft; @@ -2241,6 +2242,47 @@ void tst_QWindow::flags() QCOMPARE(window.flags(), baseFlags | Qt::WindowStaysOnTopHint); } +class EventWindow : public QWindow +{ +public: + EventWindow() : QWindow(), gotBlocked(false) {} + bool gotBlocked; +protected: + bool event(QEvent *e) + { + if (e->type() == QEvent::WindowBlocked) + gotBlocked = true; + return QWindow::event(e); + } +}; + +void tst_QWindow::testBlockingWindowShownAfterModalDialog() +{ + EventWindow normalWindow; + normalWindow.setFramePosition(m_availableTopLeft + QPoint(80, 80)); + normalWindow.resize(m_testWindowSize); + normalWindow.show(); + QVERIFY(QTest::qWaitForWindowExposed(&normalWindow)); + QVERIFY(!normalWindow.gotBlocked); + + QWindow dialog; + dialog.setFramePosition(m_availableTopLeft + QPoint(200, 200)); + dialog.resize(m_testWindowSize); + dialog.setModality(Qt::ApplicationModal); + dialog.setFlags(Qt::Dialog); + dialog.show(); + QVERIFY(QTest::qWaitForWindowExposed(&dialog)); + QVERIFY(normalWindow.gotBlocked); + + EventWindow normalWindowAfter; + normalWindowAfter.setFramePosition(m_availableTopLeft + QPoint(80, 80)); + normalWindowAfter.resize(m_testWindowSize); + QVERIFY(!normalWindowAfter.gotBlocked); + normalWindowAfter.show(); + QVERIFY(QTest::qWaitForWindowExposed(&normalWindowAfter)); + QVERIFY(normalWindowAfter.gotBlocked); +} + #include QTEST_MAIN(tst_QWindow) -- cgit v1.2.3 From b9557296cb988c6007ed17f182a03c8205d5dffc Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 7 Aug 2017 12:49:59 +0200 Subject: Fix crash when reading a PKCS12 file with no private key The only reason our code wants PKCS12 files is for a private key, but a valid file needn't contain one; and reading a file without lead to a crash in QSslKeyPrivate::fromEVP_PKEY(). So check for missing key and fail the load, since the file is useless to us. Also ensure the caller's pkey is initialized, as we aren't promised that PKCS12_parse() will set it when there is no private key. Add a test for this case (it crashes without the fix) and update the instructions for how to generate test data to cover it also. (Corrected the wording there, too; at the interactive prompt, "providing no password" really provides an empty password.) Task-number: QTBUG-62335 Change-Id: I617508b903f6d9dee40d539b7136b0be8bc2c747 Reviewed-by: Timur Pocheptsov --- .../auto/network/ssl/qsslcertificate/pkcs12/README | 21 ++++++++++++++++----- .../ssl/qsslcertificate/pkcs12/leaf-nokey.p12 | Bin 0 -> 2216 bytes .../ssl/qsslcertificate/tst_qsslcertificate.cpp | 10 ++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12 (limited to 'tests') diff --git a/tests/auto/network/ssl/qsslcertificate/pkcs12/README b/tests/auto/network/ssl/qsslcertificate/pkcs12/README index 1828d089c1..231567f586 100644 --- a/tests/auto/network/ssl/qsslcertificate/pkcs12/README +++ b/tests/auto/network/ssl/qsslcertificate/pkcs12/README @@ -1,8 +1,19 @@ -The PKCS#12 bundle was created by running the following on -in the qsslsocket/certs directory: +The PKCS#12 bundle was created by running the following in an +interactive shell in ../../qsslsocket/certs/: -openssl pkcs12 -export -in leaf.crt -inkey leaf.key \ - -out leaf.p12 \ +openssl pkcs12 -export -in leaf.crt \ + -inkey leaf.key -out leaf.p12 \ -certfile inter.crt -CAfile ca.crt -No password was provided. +An empty password was provided (twice). The pkcs.crt and pkcs.key +files were then copied here and leaf.p12 was moved here. + + +The test-case with no private key (in a valid PKCS12 file) was created +similarly but with the command adjusted to: + +openssl pkcs12 -export -in leaf.crt \ + -nokeys -out leaf-nokey.p12 \ + -certfile inter.crt -CAfile ca.crt + +The file leaf-nokey.p12 was then moved here. diff --git a/tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12 b/tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12 new file mode 100644 index 0000000000..032bf97b1b Binary files /dev/null and b/tests/auto/network/ssl/qsslcertificate/pkcs12/leaf-nokey.p12 differ diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index fced638ecb..064efc120b 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -1308,6 +1308,7 @@ void tst_QSslCertificate::version() void tst_QSslCertificate::pkcs12() { + // See pkcs12/README for how to generate the PKCS12 files used here. if (!QSslSocket::supportsSsl()) { qWarning("SSL not supported, skipping test"); return; @@ -1349,6 +1350,15 @@ void tst_QSslCertificate::pkcs12() QVERIFY(!caCerts.isEmpty()); QCOMPARE(caCerts.first(), caCert.first()); QCOMPARE(caCerts, caCert); + + // QTBUG-62335 - Fail (found no private key) but don't crash: + QFile nocert(testDataDir + QLatin1String("/pkcs12/leaf-nokey.p12")); + ok = nocert.open(QIODevice::ReadOnly); + QVERIFY(ok); + QTest::ignoreMessage(QtWarningMsg, "Unable to convert private key"); + ok = QSslCertificate::importPkcs12(&nocert, &key, &cert, &caCerts); + QVERIFY(!ok); + nocert.close(); } #endif // QT_NO_SSL -- cgit v1.2.3 From b5d762ae87e8f3a35a84a6c7d6d324c27d487a8c Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 17 Aug 2017 11:31:27 +0200 Subject: macOS: Fix padding around tab label with icon Change c12072c685f7e93d5b84e289ca23106482379eff fixed a problem where tab labels would overlap with the icons if the tab became too small to contain the text. But it did not properly account for the full area occupied by the icon, because the horizontal padding is hardcoded to 4 in the mac style, whereas in the common style (where the icon is drawn) it uses the pixel metric for this. In addition, the change only allocated space on the left side, causing the label to no longer be centered. Task-number: QTBUG-61235 Change-Id: Ieec4f7044584361f92045addbc8bbd81bd5c9fc7 Reviewed-by: Gabriel de Dietrich --- tests/manual/qtabbar/main.cpp | 12 ++- tests/manual/qtabbar/tabbarform.ui | 159 +++++++++++++++++++------------------ 2 files changed, 94 insertions(+), 77 deletions(-) (limited to 'tests') diff --git a/tests/manual/qtabbar/main.cpp b/tests/manual/qtabbar/main.cpp index 466a7e20fc..82bcd838e6 100644 --- a/tests/manual/qtabbar/main.cpp +++ b/tests/manual/qtabbar/main.cpp @@ -103,6 +103,9 @@ int main(int argc, char *argv[]) // right // tabBar.setShape(QTabBar::RoundedEast); + const auto shortLabel = QStringLiteral("Tab %1"); + const auto longLabel = QStringLiteral("An Extremely Long Tab Label %1"); + QMap tabs; for (int i = 0; i < TabCount; i++) { QString tabNumberString = QString::number(i); @@ -110,7 +113,7 @@ int main(int argc, char *argv[]) tabs[i] = label; label->setAlignment(Qt::AlignCenter); stackedWidget.addWidget(label); - tabBar.addTab(QStringLiteral("Tab %1").arg(tabNumberString)); + tabBar.addTab(shortLabel.arg(tabNumberString)); } QObject::connect(&tabBar, &QTabBar::tabMoved, [&tabs](int from, int to) { @@ -205,6 +208,13 @@ int main(int argc, char *argv[]) tabBar.setTabIcon(i, icon); }); + form.ui->longLabelButton->setChecked(false); + QObject::connect(form.ui->longLabelButton, &QCheckBox::toggled, [&] { + const auto &label = form.ui->longLabelButton->isChecked() ? longLabel : shortLabel; + for (int i = 0; i < tabBar.count(); i++) + tabBar.setTabText(i, label.arg(i)); + }); + QObject::connect(form.ui->shapeComboBox, QOverload::of(&QComboBox::currentIndexChanged), [&](int index) { Q_UNUSED(index); // TODO diff --git a/tests/manual/qtabbar/tabbarform.ui b/tests/manual/qtabbar/tabbarform.ui index 17100b3b62..f8766f22f2 100644 --- a/tests/manual/qtabbar/tabbarform.ui +++ b/tests/manual/qtabbar/tabbarform.ui @@ -7,7 +7,7 @@ 0 0 308 - 260 + 308 @@ -22,24 +22,61 @@ - - + + + + false + + + + North + + + + + South + + + + + West + + + + + East + + + + + + + + Qt::Vertical + + + + 20 + 12 + + + + + + - Right aligned + Tab bar options: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - textAlignmentGroup - - - + + - Left aligned + Document mode - - textAlignmentGroup - @@ -49,14 +86,14 @@ - - + + - Tabs alignment: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Left aligned + + textAlignmentGroup + @@ -66,10 +103,13 @@ - - + + - Document mode + Tab shape (TODO): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -80,47 +120,17 @@ - - - - false - - - - North - - - - - South - - - - - West - - - - - East - - - - - - - - Qt::Vertical + + + + Tabs alignment: - - - 20 - 12 - + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + - + Qt::Vertical @@ -133,17 +143,14 @@ - - + + - Tab bar options: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Display icon - + Centered @@ -153,20 +160,20 @@ - - + + - Tab shape (TODO): - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Right aligned + + textAlignmentGroup + - - + + - Display icon + Long tab label -- cgit v1.2.3 From 82e7bd689ace5e07e195db6514cec85ff9bc7688 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jul 2017 15:34:56 +0200 Subject: tst_QPrinter: Disambiguate all file names Introduce helper function which uses a number to build unique names. Remove helper for deleting files since it now uses a temporary directory. Add a few cases that were overlooked in 88c68f4d9ed649f444bb22c52595da71ce4aac4e. Task-number: QTBUG-61827 Change-Id: I53355f99ffc3bfe6ad6994a5439710c9fa8cdad5 Reviewed-by: Andy Shaw --- .../printsupport/kernel/qprinter/tst_qprinter.cpp | 63 +++++++++------------- 1 file changed, 25 insertions(+), 38 deletions(-) (limited to 'tests') diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index 16bb0b7c3e..4806d1a435 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -50,22 +50,7 @@ QT_FORWARD_DECLARE_CLASS(QPrinter) -// Helper class to make sure temp files are cleaned up after test complete -class TempFileCleanup -{ -public: - TempFileCleanup(const QString &file) - : m_file(file) - { - } - - ~TempFileCleanup() - { - QFile::remove(m_file); - } -private: - QString m_file; -}; +static int fileNumber = 0; class tst_QPrinter : public QObject { @@ -133,6 +118,9 @@ private slots: void testPageMetrics(); #endif private: + QString testFileName(const QString &prefix, const QString &suffix); + QString testPdfFileName(const QString &prefix) { return testFileName(prefix, QStringLiteral("pdf")); } + QTemporaryDir m_tempDir; }; @@ -246,9 +234,7 @@ void tst_QPrinter::testPageRectAndPaperRect() QPainter *painter = 0; QPrinter printer(QPrinter::HighResolution); printer.setOrientation(QPrinter::Orientation(orientation)); - const QString fileName = m_tempDir.path() + QLatin1String("/silly"); - printer.setOutputFileName(fileName); - TempFileCleanup tmpFile(fileName); + printer.setOutputFileName(testFileName(QLatin1String("silly"), QString())); QRect pageRect = doPaperRect ? printer.paperRect() : printer.pageRect(); float inchesX = float(pageRect.width()) / float(printer.resolution()); @@ -328,7 +314,7 @@ void tst_QPrinter::testMargins() Q_UNUSED(height); QPrinter printer; QPainter *painter = 0; - printer.setOutputFileName("silly"); + printer.setOutputFileName(testFileName(QLatin1String("silly"), QString())); printer.setOrientation((QPrinter::Orientation)orientation); printer.setFullPage(fullpage); printer.setPageSize((QPrinter::PageSize)pagesize); @@ -337,7 +323,6 @@ void tst_QPrinter::testMargins() if (painter) delete painter; - QFile::remove("silly"); } void tst_QPrinter::testMulitpleSets_data() @@ -420,9 +405,7 @@ void tst_QPrinter::outputFormatFromSuffix() QSKIP("No printers available."); QPrinter p; QCOMPARE(p.outputFormat(), QPrinter::NativeFormat); - const QString fileName = m_tempDir.path() + QLatin1String("/test.pdf"); - p.setOutputFileName(fileName); - TempFileCleanup tmpFile(fileName); + p.setOutputFileName(testPdfFileName(QLatin1String("test"))); QCOMPARE(p.outputFormat(), QPrinter::PdfFormat); p.setOutputFileName(QString()); QCOMPARE(p.outputFormat(), QPrinter::NativeFormat); @@ -510,9 +493,7 @@ void tst_QPrinter::errorReporting() p.setOutputFileName("/foobar/nonwritable.pdf"); QCOMPARE(painter.begin(&p), false); // it should check the output file is writable #endif - const QString fileName = m_tempDir.path() + QLatin1String("/test.pdf"); - p.setOutputFileName(fileName); - TempFileCleanup tmpFile(fileName); + p.setOutputFileName(testPdfFileName(QLatin1String("test"))); QCOMPARE(painter.begin(&p), true); // it should check the output QCOMPARE(p.isValid(), true); painter.end(); @@ -606,8 +587,7 @@ void tst_QPrinter::customPaperSizeAndMargins() void tst_QPrinter::printDialogCompleter() { QPrintDialog dialog; - dialog.printer()->setOutputFileName("file.pdf"); - TempFileCleanup tmpFile("file.pdf"); + dialog.printer()->setOutputFileName(testPdfFileName(QLatin1String("file"))); dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile); dialog.show(); @@ -627,10 +607,8 @@ static void printPage(QPainter *painter) void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles() { - const QString fileName1 = m_tempDir.path() + QLatin1String("/out1.pdf"); - const QString fileName2 = m_tempDir.path() + QLatin1String("/out2.pdf"); - TempFileCleanup tmpFile1(fileName1); - TempFileCleanup tmpFile2(fileName2); + const QString fileName1 = testPdfFileName(QLatin1String("out1_")); + const QString fileName2 = testPdfFileName(QLatin1String("out2_")); QPrinter printer; { @@ -689,7 +667,7 @@ void tst_QPrinter::testCurrentPage() void tst_QPrinter::testPdfTitle() { - const QString fileName = m_tempDir.path() + QLatin1String("/file.pdf"); + const QString fileName = testPdfFileName(QLatin1String("file")); // Check the document name is represented correctly in produced pdf { @@ -703,7 +681,6 @@ void tst_QPrinter::testPdfTitle() painter.begin(&printer); painter.end(); } - TempFileCleanup tmpFile(fileName); QFile file(fileName); QVERIFY(file.open(QIODevice::ReadOnly)); // The we expect the title to appear in the PDF as: @@ -1244,8 +1221,9 @@ void tst_QPrinter::outputFileName() QPrinter pdf; pdf.setOutputFormat(QPrinter::PdfFormat); QCOMPARE(pdf.outputFileName(), QString()); - pdf.setOutputFileName(QStringLiteral("Test File")); - QCOMPARE(pdf.outputFileName(), QString("Test File")); + const QString fileName = testFileName(QStringLiteral("Test File"), QString()); + pdf.setOutputFileName(fileName); + QCOMPARE(pdf.outputFileName(), fileName); QPrinter native; if (native.outputFormat() == QPrinter::NativeFormat) { @@ -1253,7 +1231,7 @@ void tst_QPrinter::outputFileName() QCOMPARE(native.outputFileName(), QString()); // Test set/get - QString expected = QStringLiteral("Test File"); + QString expected = fileName; native.setOutputFileName(expected); QCOMPARE(native.outputFileName(), expected); @@ -1960,6 +1938,15 @@ void tst_QPrinter::testPageMetrics() QCOMPARE(printer.pageRect(QPrinter::Millimeter), QRectF(leftMMf, topMMf, heightMMf - leftMMf - rightMMf, widthMMf - topMMf - bottomMMf)); } +QString tst_QPrinter::testFileName(const QString &prefix, const QString &suffix) +{ + QString result = m_tempDir.path() + QLatin1Char('/') + prefix + + QString::number(fileNumber++); + if (!suffix.isEmpty()) + result += QLatin1Char('.') + suffix; + return result; +} + #endif // QT_CONFIG(printer) QTEST_MAIN(tst_QPrinter) -- cgit v1.2.3 From c1cd8df84ea1180536509d3caa2c1fe802b188ab Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 21 Aug 2017 15:54:24 +0200 Subject: Fix the test for non-English based setups Unsetting the SOFTWARE environment variable will force lpstat to use English for the output, so we can ensure that the test will pass regardless of the language used for the machine. Change-Id: Iddf5e8aadaa546ae3e0dd172df84e4e43ee02c2a Reviewed-by: Friedemann Kleint --- .../printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp index c20fafe158..92a06cda00 100644 --- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp @@ -136,7 +136,7 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem() #ifdef Q_OS_UNIX // This function does roughly the same as the `command substitution` in // the shell. -QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command) +QString getOutputFromCommandInternal(const QStringList &command) { // The command execution does nothing on non-unix systems. int pid; @@ -194,6 +194,16 @@ QString tst_QPrinterInfo::getOutputFromCommand(const QStringList& command) return QString(array); } } + +QString tst_QPrinterInfo::getOutputFromCommand(const QStringList &command) +{ + // Forces the ouptut from the command to be in English + const QByteArray origSoftwareEnv = qgetenv("SOFTWARE"); + qputenv("SOFTWARE", QByteArray()); + QString output = getOutputFromCommandInternal(command); + qputenv("SOFTWARE", origSoftwareEnv); + return output; +} #endif // Windows test support not yet implemented -- cgit v1.2.3 From 1bbad92e83d9fe4f5f75e5b232e1c06cf8bf049d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jul 2017 16:30:24 +0200 Subject: tst_QPrinter: Share printers in testPageRectAndPaperRect/testMargin Speeds up testing by a factor of 2. Task-number: QTBUG-61827 Change-Id: I9d6c9d9786d35af3083bc7e98beb9a79dbcc7e11 Reviewed-by: Andy Shaw --- .../printsupport/kernel/qprinter/tst_qprinter.cpp | 132 +++++++++++---------- 1 file changed, 68 insertions(+), 64 deletions(-) (limited to 'tests') diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index 4806d1a435..cc32e73b9c 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -47,8 +48,13 @@ #include #endif +#if QT_CONFIG(printer) +typedef QSharedPointer PrinterPtr; -QT_FORWARD_DECLARE_CLASS(QPrinter) +Q_DECLARE_METATYPE(PrinterPtr) +Q_DECLARE_METATYPE(QPrinter::Orientation) +Q_DECLARE_METATYPE(QPrinter::PageSize) +#endif // printer static int fileNumber = 0; @@ -190,70 +196,72 @@ void tst_QPrinter::testPrintPreviewDialog() void tst_QPrinter::testPageRectAndPaperRect_data() { - QTest::addColumn("orientation"); + QTest::addColumn("printer"); + QTest::addColumn("orientation"); QTest::addColumn("withPainter"); QTest::addColumn("resolution"); QTest::addColumn("doPaperRect"); + const PrinterPtr printer(new QPrinter(QPrinter::HighResolution)); // paperrect - QTest::newRow("paperRect0") << int(QPrinter::Portrait) << true << 300 << true; - QTest::newRow("paperRect1") << int(QPrinter::Portrait) << false << 300 << true; - QTest::newRow("paperRect2") << int(QPrinter::Landscape) << true << 300 << true; - QTest::newRow("paperRect3") << int(QPrinter::Landscape) << false << 300 << true; - QTest::newRow("paperRect4") << int(QPrinter::Portrait) << true << 600 << true; - QTest::newRow("paperRect5") << int(QPrinter::Portrait) << false << 600 << true; - QTest::newRow("paperRect6") << int(QPrinter::Landscape) << true << 600 << true; - QTest::newRow("paperRect7") << int(QPrinter::Landscape) << false << 600 << true; - QTest::newRow("paperRect8") << int(QPrinter::Portrait) << true << 1200 << true; - QTest::newRow("paperRect9") << int(QPrinter::Portrait) << false << 1200 << true; - QTest::newRow("paperRect10") << int(QPrinter::Landscape) << true << 1200 << true; - QTest::newRow("paperRect11") << int(QPrinter::Landscape) << false << 1200 << true; + QTest::newRow("paperRect0") << printer << QPrinter::Portrait << true << 300 << true; + QTest::newRow("paperRect1") << printer << QPrinter::Portrait << false << 300 << true; + QTest::newRow("paperRect2") << printer << QPrinter::Landscape << true << 300 << true; + QTest::newRow("paperRect3") << printer << QPrinter::Landscape << false << 300 << true; + QTest::newRow("paperRect4") << printer << QPrinter::Portrait << true << 600 << true; + QTest::newRow("paperRect5") << printer << QPrinter::Portrait << false << 600 << true; + QTest::newRow("paperRect6") << printer << QPrinter::Landscape << true << 600 << true; + QTest::newRow("paperRect7") << printer << QPrinter::Landscape << false << 600 << true; + QTest::newRow("paperRect8") << printer << QPrinter::Portrait << true << 1200 << true; + QTest::newRow("paperRect9") << printer << QPrinter::Portrait << false << 1200 << true; + QTest::newRow("paperRect10") << printer << QPrinter::Landscape << true << 1200 << true; + QTest::newRow("paperRect11") << printer << QPrinter::Landscape << false << 1200 << true; // page rect - QTest::newRow("pageRect0") << int(QPrinter::Portrait) << true << 300 << false; - QTest::newRow("pageRect1") << int(QPrinter::Portrait) << false << 300 << false; - QTest::newRow("pageRect2") << int(QPrinter::Landscape) << true << 300 << false; - QTest::newRow("pageRect3") << int(QPrinter::Landscape) << false << 300 << false; - QTest::newRow("pageRect4") << int(QPrinter::Portrait) << true << 600 << false; - QTest::newRow("pageRect5") << int(QPrinter::Portrait) << false << 600 << false; - QTest::newRow("pageRect6") << int(QPrinter::Landscape) << true << 600 << false; - QTest::newRow("pageRect7") << int(QPrinter::Landscape) << false << 600 << false; - QTest::newRow("pageRect8") << int(QPrinter::Portrait) << true << 1200 << false; - QTest::newRow("pageRect9") << int(QPrinter::Portrait) << false << 1200 << false; - QTest::newRow("pageRect10") << int(QPrinter::Landscape) << true << 1200 << false; - QTest::newRow("pageRect11") << int(QPrinter::Landscape) << false << 1200 << false; + QTest::newRow("pageRect0") << printer << QPrinter::Portrait << true << 300 << false; + QTest::newRow("pageRect1") << printer << QPrinter::Portrait << false << 300 << false; + QTest::newRow("pageRect2") << printer << QPrinter::Landscape << true << 300 << false; + QTest::newRow("pageRect3") << printer << QPrinter::Landscape << false << 300 << false; + QTest::newRow("pageRect4") << printer << QPrinter::Portrait << true << 600 << false; + QTest::newRow("pageRect5") << printer << QPrinter::Portrait << false << 600 << false; + QTest::newRow("pageRect6") << printer << QPrinter::Landscape << true << 600 << false; + QTest::newRow("pageRect7") << printer << QPrinter::Landscape << false << 600 << false; + QTest::newRow("pageRect8") << printer << QPrinter::Portrait << true << 1200 << false; + QTest::newRow("pageRect9") << printer << QPrinter::Portrait << false << 1200 << false; + QTest::newRow("pageRect10") << printer << QPrinter::Landscape << true << 1200 << false; + QTest::newRow("pageRect11") << printer << QPrinter::Landscape << false << 1200 << false; } void tst_QPrinter::testPageRectAndPaperRect() { + QFETCH(PrinterPtr, printer); QFETCH(bool, withPainter); - QFETCH(int, orientation); + QFETCH(QPrinter::Orientation, orientation); QFETCH(int, resolution); QFETCH(bool, doPaperRect); QPainter *painter = 0; - QPrinter printer(QPrinter::HighResolution); - printer.setOrientation(QPrinter::Orientation(orientation)); - printer.setOutputFileName(testFileName(QLatin1String("silly"), QString())); + printer->setOrientation(orientation); + printer->setOutputFileName(testFileName(QLatin1String("silly"), QString())); - QRect pageRect = doPaperRect ? printer.paperRect() : printer.pageRect(); - float inchesX = float(pageRect.width()) / float(printer.resolution()); - float inchesY = float(pageRect.height()) / float(printer.resolution()); - printer.setResolution(resolution); + QRect pageRect = doPaperRect ? printer->paperRect() : printer->pageRect(); + float inchesX = float(pageRect.width()) / float(printer->resolution()); + float inchesY = float(pageRect.height()) / float(printer->resolution()); + printer->setResolution(resolution); if (withPainter) - painter = new QPainter(&printer); + painter = new QPainter(printer.data()); - QRect otherRect = doPaperRect ? printer.paperRect() : printer.pageRect(); - float otherInchesX = float(otherRect.width()) / float(printer.resolution()); - float otherInchesY = float(otherRect.height()) / float(printer.resolution()); + QRect otherRect = doPaperRect ? printer->paperRect() : printer->pageRect(); + float otherInchesX = float(otherRect.width()) / float(printer->resolution()); + float otherInchesY = float(otherRect.height()) / float(printer->resolution()); if (painter != 0) delete painter; QVERIFY(qAbs(otherInchesX - inchesX) < 0.01); QVERIFY(qAbs(otherInchesY - inchesY) < 0.01); - QVERIFY(printer.orientation() == QPrinter::Portrait || pageRect.width() > pageRect.height()); - QVERIFY(printer.orientation() != QPrinter::Portrait || pageRect.width() < pageRect.height()); + QVERIFY(printer->orientation() == QPrinter::Portrait || pageRect.width() > pageRect.height()); + QVERIFY(printer->orientation() != QPrinter::Portrait || pageRect.width() < pageRect.height()); } void tst_QPrinter::testSetOptions() @@ -285,41 +293,37 @@ void tst_QPrinter::testSetOptions() void tst_QPrinter::testMargins_data() { - QTest::addColumn("orientation"); + QTest::addColumn("printer"); + QTest::addColumn("orientation"); QTest::addColumn("fullpage"); - QTest::addColumn("pagesize"); - QTest::addColumn("width"); - QTest::addColumn("height"); + QTest::addColumn("pagesize"); QTest::addColumn("withPainter"); - QTest::newRow("data0") << int(QPrinter::Portrait) << true << int(QPrinter::A4) << 210 << 297 << false; - QTest::newRow("data1") << int(QPrinter::Landscape) << true << int(QPrinter::A4) << 297 << 210 << false; - QTest::newRow("data2") << int(QPrinter::Landscape) << false << int(QPrinter::A4) << 297 << 210 << false; - QTest::newRow("data3") << int(QPrinter::Portrait) << false << int(QPrinter::A4) << 210 << 297 << false; - QTest::newRow("data4") << int(QPrinter::Portrait) << true << int(QPrinter::A4) << 210 << 297 << true; - QTest::newRow("data5") << int(QPrinter::Landscape) << true << int(QPrinter::A4) << 297 << 210 << true; - QTest::newRow("data6") << int(QPrinter::Landscape) << false << int(QPrinter::A4) << 297 << 210 << true; - QTest::newRow("data7") << int(QPrinter::Portrait) << false << int(QPrinter::A4) << 210 << 297 << true; + const PrinterPtr printer(new QPrinter); + QTest::newRow("data0") << printer << QPrinter::Portrait << true << QPrinter::A4 << false; + QTest::newRow("data1") << printer << QPrinter::Landscape << true << QPrinter::A4 << false; + QTest::newRow("data2") << printer << QPrinter::Landscape << false << QPrinter::A4 << false; + QTest::newRow("data3") << printer << QPrinter::Portrait << false << QPrinter::A4 << false; + QTest::newRow("data4") << printer << QPrinter::Portrait << true << QPrinter::A4 << true; + QTest::newRow("data5") << printer << QPrinter::Landscape << true << QPrinter::A4 << true; + QTest::newRow("data6") << printer << QPrinter::Landscape << false << QPrinter::A4 << true; + QTest::newRow("data7") << printer << QPrinter::Portrait << false << QPrinter::A4 << true; } void tst_QPrinter::testMargins() { + QFETCH(PrinterPtr, printer); QFETCH(bool, withPainter); - QFETCH(int, orientation); - QFETCH(int, pagesize); - QFETCH(int, width); - QFETCH(int, height); + QFETCH(QPrinter::Orientation, orientation); + QFETCH(QPrinter::PageSize, pagesize); QFETCH(bool, fullpage); - Q_UNUSED(width); - Q_UNUSED(height); - QPrinter printer; QPainter *painter = 0; - printer.setOutputFileName(testFileName(QLatin1String("silly"), QString())); - printer.setOrientation((QPrinter::Orientation)orientation); - printer.setFullPage(fullpage); - printer.setPageSize((QPrinter::PageSize)pagesize); + printer->setOutputFileName(testFileName(QLatin1String("silly"), QString())); + printer->setOrientation(orientation); + printer->setFullPage(fullpage); + printer->setPageSize(pagesize); if (withPainter) - painter = new QPainter(&printer); + painter = new QPainter(printer.data()); if (painter) delete painter; -- cgit v1.2.3 From b65e30c861af308d142c36b5f96f1a4cfedde1f3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 12 Jun 2017 16:55:03 -0700 Subject: QWidget: Call appropriate QWindow method from setGeometry_sys() When calling resize() from showEvent(), we'd set the full geometry on the widget's QWindow. This resulted in the top-level window being moved to the top-left corner, even though no other call to move() or setGeometry() had happened before. The solution consists on calling the proper QWindow methods depending on whether setGeometry_sys() is called for a move, a resize or both. Furthermore, this needs QWindow::resize() to set its position policy to frame-exclusive. The documentation states that is already the case and we're setting the full geometry on the platform window, so we need to convey that bit of information. This also solves the age-old conundrum: "### why do we have isMove as a parameter?" Change-Id: I2e00fd632929ade14b35ae5e6495ed1ab176d32f Task-number: QTBUG-56277 Reviewed-by: Gabriel de Dietrich Reviewed-by: Friedemann Kleint --- .../kernel/qwidget_window/tst_qwidget_window.cpp | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp index 6aaac6d135..f20978c295 100644 --- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp +++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp @@ -99,6 +99,8 @@ private slots: void tst_eventfilter_on_toplevel(); void QTBUG_50561_QCocoaBackingStore_paintDevice_crash(); + + void QTBUG_56277_resize_on_showEvent(); }; void tst_QWidget_window::initTestCase() @@ -861,5 +863,34 @@ void tst_QWidget_window::QTBUG_50561_QCocoaBackingStore_paintDevice_crash() w.close(); } +class ResizedOnShowEventWidget : public QWidget +{ +public: + void showEvent(QShowEvent *) override + { + const auto *primaryScreen = QApplication::primaryScreen(); + auto newSize = primaryScreen->availableGeometry().size() / 4; + if (newSize == geometry().size()) + newSize -= QSize(10, 10); + resize(newSize); + } +}; + +void tst_QWidget_window::QTBUG_56277_resize_on_showEvent() +{ + const auto platformName = QGuiApplication::platformName().toLower(); + if (platformName != "cocoa" && platformName != "windows") + QSKIP("This can only be consistently tested on desktop platforms with well-known behavior."); + + ResizedOnShowEventWidget w; + w.show(); + QVERIFY(QTest::qWaitForWindowExposed(&w)); + const auto *screen = w.windowHandle()->screen(); + const auto geometry = w.geometry(); + const int frameHeight = geometry.top() - w.frameGeometry().top(); + const int topmostY = screen->availableGeometry().top() + frameHeight; + QVERIFY(geometry.top() > topmostY || geometry.left() > screen->availableGeometry().left()); +} + QTEST_MAIN(tst_QWidget_window) #include "tst_qwidget_window.moc" -- cgit v1.2.3 From 6522d4c487bbb19bceb466762f8bc611f8d78444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Wed, 14 Jun 2017 00:02:14 +0100 Subject: Fix invalid placeholder name in tst_qsqlthread.cpp Change-Id: I88c0c48888b86b58d85223ad1dc4cafdaea01d77 Reviewed-by: Andy Shaw --- tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp index c21223886a..5482dc393b 100644 --- a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp +++ b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp @@ -177,7 +177,7 @@ public: for (int i = 0; i < ProdConIterations; ++i) { QVERIFY_SQL(q1, exec("select max(id) from " + qtest)); q1.first(); - q2.bindValue("id", q1.value(0)); + q2.bindValue(":id", q1.value(0)); q1.clear(); QVERIFY_SQL(q2, exec()); QThread::yieldCurrentThread(); -- cgit v1.2.3 From 515b9051505d61af6be0eba87616c7281ee4ce62 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 6 Sep 2016 19:21:50 +0200 Subject: Adapt qmake's raw-string parser to avoid confusion by macros A macro name ending in R might expand to a string; if this precedes a string constant, we're juxtaposing the strings. My first parser for raw strings would mistake it for a raw string instead, ignoring the part of the identifier before R. Re-worked the exploration of what came before the string to catch these cases, too. The backwards parsing would also allow any messy jumble of [RLUu8]* as prefix for the string; but in fact R must (if present) be last in the prefix and *it* can have at most one prefix, [LUu] or u8. Anything else is an identifier that happens to precede the string. Reworked the parsing to allow only one prefix and not treat R specially unless it's immediately (modulo BSNL) before the string's open-quotes. Add link to the cppreference page about string literals, on which the grammar now parsed is based. Added a test for the issue this addresses. Verified that this fails on 5.6, dev and 5.9 without the fix. Expanded the existing test to cover R-with-prefix cases. Task-number: QTBUG-55633 Change-Id: I541486c2ec909cfb42050907c84bee83ead4a2f4 Reviewed-by: Oswald Buddenhagen --- tests/auto/tools/qmake/testdata/rawString/main.cpp | 101 ++++++++++++++++++++- .../auto/tools/qmake/testdata/rawString/object2.h | 54 +++++++++++ .../tools/qmake/testdata/rawString/rawString.pro | 2 +- 3 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 tests/auto/tools/qmake/testdata/rawString/object2.h (limited to 'tests') diff --git a/tests/auto/tools/qmake/testdata/rawString/main.cpp b/tests/auto/tools/qmake/testdata/rawString/main.cpp index 53a28f7bc0..bc557f39f8 100644 --- a/tests/auto/tools/qmake/testdata/rawString/main.cpp +++ b/tests/auto/tools/qmake/testdata/rawString/main.cpp @@ -26,8 +26,107 @@ ** ****************************************************************************/ +// macro names that *aren't* string-literal-prefixes: +#define Ru8 "rue-it" +#define RL "real life" +#define Ru "are you ?" +#define RU "Are You ?" +#define LLR "double-hockey-sticks" +#define LUR "Tricky" +#define LuR "tricky" +#define Lu8R "l'uber" +#define UUR "Double-Yew" +#define ULR "Eweler" +#define UuR "You ... you-are" +#define Uu8R "You ... you *ate* our ..." +#define uuR "water" +#define uLR "eweler" +#define uUR "double-Your" +#define uu8R "totally uber" +#define u8u8R "rubber-you" +#define u8LR "Uber left-to-right" +#define u8UR "Uber Upper-Right" +#define u8uR "Uber upper-right" +#define Ru8R "bouncy" +#define RLR "Marching" +#define RuR "Rossum's general-purpose workers" +#define RUR "Rossum's Universal Robots" + +static const char monstrosity[] = + Ru8"Ru8(" + RL"RL(" + Ru"Ru(" + RU"RU(" + LLR"LLR(" + LUR"LUR(" + LuR"LuR(" + Lu8R"Lu8R(" + UUR"UUR(" + ULR"ULR(" + UuR"UuR(" + Uu8R"Uu8R(" + uuR"uuR(" + uLR"uLR(" + uUR"uUR(" + uu8R"uu8R(" + u8u8R"u8u8R(" + u8LR"u8LR(" + u8UR"u8UR(" + u8uR"u8uR(" + Ru8R"Ru8R(" + RLR"RLR(" + RuR"RuR(" + RUR"RUR(" + "Finally, some content"; + +#include + +static const char closure[] = + ")RUR" + ")RuR" + ")RLR" + ")Ru8R" + ")u8uR" + ")u8UR" + ")u8LR" + ")u8u8R" + ")uu8R" + ")uUR" + ")uLR" + ")uuR" + ")Uu8R" + ")UuR" + ")ULR" + ")UUR" + ")Lu8R" + ")LuR" + ")LUR" + ")LLR" + ")RU" + ")Ru" + ")RL" + ")Ru8"; +// If moc got confused, the confusion should now be over + +// Real raw strings, not actually leaving us inside any comments: static const char raw[] = R"blah(lorem " ipsum /*)blah"\ ; +static const wchar_t wider[] = LR"blah(lorem " ipsum /*)blah"\ +; +static const char32_t UCS4[] = UR"blah(lorem " ipsum /*)blah"\ +; +static const char16_t UCS2[] = uR"blah(lorem " ipsum /*)blah"\ +; +static const char utf8[] = u8R"blah(lorem " ipsum /*)blah"\ +; #include -int main () { return 0; } +/* Avoid unused variable warnings by silly uses of arrays: */ +#define final(x) x[sizeof(x) - 1] // 0, of course +int main () { + return final(raw) + * (final(wider) - final(UCS4)) + * (final(UCS2) - final(utf8)) + * (final(monstrosity) - final(closure)); +} +#undef final diff --git a/tests/auto/tools/qmake/testdata/rawString/object2.h b/tests/auto/tools/qmake/testdata/rawString/object2.h new file mode 100644 index 0000000000..2ab77cd3bd --- /dev/null +++ b/tests/auto/tools/qmake/testdata/rawString/object2.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef TEST_QMAKE_RAWSTRING_OBJECT2_H +#define TEST_QMAKE_RAWSTRING_OBJECT2_H + +#define Lu8UR "land" +inline char opener(int i) { + const char text[] = Lu8UR"blah( not a raw string; just juxtaposed"; + return text[i]; +} + +#include + +class Object2 : public QObject +{ + Q_OBJECT +}; + +inline char closer(int i) { + const char text[] = "pretend to close it, all the same )blah"; + return text[i]; +} + +#endif // TEST_QMAKE_RAWSTRING_OBJECT2_H diff --git a/tests/auto/tools/qmake/testdata/rawString/rawString.pro b/tests/auto/tools/qmake/testdata/rawString/rawString.pro index d2d8132ceb..19c81dfe97 100644 --- a/tests/auto/tools/qmake/testdata/rawString/rawString.pro +++ b/tests/auto/tools/qmake/testdata/rawString/rawString.pro @@ -1,4 +1,4 @@ DESTDIR = ./ -HEADERS += object1.h +HEADERS += object1.h object2.h SOURCES += main.cpp -- cgit v1.2.3 From 0f11fab6f75dec78d3721280971448cc2edd6e72 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sat, 26 Aug 2017 23:02:07 +0300 Subject: Fix resolution of relative symlinks from relative path on unix Consider the following: /root/target - a file /root/path/link -> ../target /root/path/other/exe - executable Running from /root/path/other. exe is: #include #include int main() { qDebug() << QFileInfo("../link").symLinkTarget() return 0; } The link references /root/target, but the current output is /root/path/target. The link doesn't depend on the PWD. It depends on its own directory. Change-Id: I61e95018154a75e0e0d795ee801068e18870a5df Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 87b579bb2b..17f41cba2b 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1261,6 +1261,7 @@ void tst_QFileInfo::isSymLink_data() QFile::remove("link.lnk"); QFile::remove("brokenlink.lnk"); QFile::remove("dummyfile"); + QFile::remove("relative/link.lnk"); QFile file1(m_sourceFile); QVERIFY(file1.link("link.lnk")); @@ -1277,6 +1278,12 @@ void tst_QFileInfo::isSymLink_data() QTest::newRow("existent file") << m_sourceFile << false << ""; QTest::newRow("link") << "link.lnk" << true << QFileInfo(m_sourceFile).absoluteFilePath(); QTest::newRow("broken link") << "brokenlink.lnk" << true << QFileInfo("dummyfile").absoluteFilePath(); + +#ifndef Q_OS_WIN + QDir::current().mkdir("relative"); + QFile::link("../dummyfile", "relative/link.lnk"); + QTest::newRow("relative link") << "relative/link.lnk" << true << QFileInfo("dummyfile").absoluteFilePath(); +#endif #endif } -- cgit v1.2.3 From 3380c7949e897cb65fe4ea4d8f58b44ccd6c999c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 18 Aug 2017 16:04:42 +0200 Subject: Remove QMAKE_LIBS_NETWORK from QSqlQuery benchmark This was added in c6612de3 for WEC7 which we do not support anymore. Change-Id: I329374bb8375d629a6f7619236371c0fc953792d Reviewed-by: Oswald Buddenhagen --- tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro | 1 - 1 file changed, 1 deletion(-) (limited to 'tests') diff --git a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro index 18425f4a25..0b710ab89c 100644 --- a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro +++ b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro @@ -3,4 +3,3 @@ TARGET = tst_bench_qsqlquery SOURCES += main.cpp QT = core sql testlib core-private sql-private -LIBS += $$QMAKE_LIBS_NETWORK -- cgit v1.2.3 From de6d6eb13ebfeefc6e628cc46d695d7693d364ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni=20J=C3=A4ntti?= Date: Tue, 29 Aug 2017 14:37:54 +0300 Subject: Revert "tst_qgraphicswidget expect fail on Win 10" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3d5bf00f18b5b9d1f5de4ff610ad15d5d0ed8c3d. This change needs to be reverted because Windows 10 Creator's Update doesn't fail on this test anymore during CI runs. Reason for this is unknown. Change-Id: I9f1c88606c97afc5952af34e04310612b783a9c2 Reviewed-by: Tony Sarajärvi --- .../widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index 5e3cb66aae..1be17b552e 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -41,7 +41,6 @@ #include #include #include -#include typedef QList QGraphicsItemList; @@ -1776,17 +1775,11 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie() QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, center); #ifdef Q_OS_MAC QEXPECT_FAIL("", "QTBUG-23699", Continue); -#endif -#ifdef Q_OS_WIN - if (QSysInfo::kernelVersion() == "10.0.15063") { - QEXPECT_FAIL("", "This fails on Windows 10 Creators Update (10.0.15063)", Continue); - } #endif QTRY_COMPARE(qApp->activeWindow(), static_cast(&view)); QTRY_COMPARE(scene.focusItem(), static_cast(w)); } - void tst_QGraphicsWidget::sizeHint_data() { QTest::addColumn("layout"); -- cgit v1.2.3 From e938150412d22e61926fe16791158805b71268bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni=20J=C3=A4ntti?= Date: Wed, 30 Aug 2017 15:45:44 +0300 Subject: Revert "tst_qwidget::activation expect fail on Win 10" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 85612817685f8b64307276a2ce9ef79d9e048be4. This change needs to be reverted because Windows 10 Creator's Update doesn't fail on this test anymore during CI runs. Reason for this is unknown. Change-Id: Ice250ecedb14ac96fb3693b2d9884ef452a91cc2 Reviewed-by: Tony Sarajärvi --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index ef851f38b2..63ff8380f8 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1774,12 +1774,6 @@ void tst_QWidget::activation() QCOMPARE(QApplication::activeWindow(), &widget2); widget2.hide(); QTest::qWait(waitTime); -#ifdef Q_OS_WIN - if (QSysInfo::kernelVersion() == "10.0.15063") { - QEXPECT_FAIL("", "This fails on Windows 10 Creators Update (10.0.15063)", Continue); - // This happens in automated Windows 10 Creators Update (10.0.15063) CI builds! - } -#endif QCOMPARE(QApplication::activeWindow(), &widget1); } #endif // Q_OS_WIN -- cgit v1.2.3