summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp17
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp3
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp10
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp10
-rw-r--r--tests/baselineserver/shared/qbaselinetest.cpp28
5 files changed, 48 insertions, 20 deletions
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index aee2f970fe..a474acd790 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -139,6 +139,7 @@ private slots:
void superscriptCrash_qtbug53911();
void showLineAndParagraphSeparatorsCrash();
void koreanWordWrap();
+ void tooManyDirectionalCharctersCrash_qtbug77819();
private:
QFont testFont;
@@ -2330,5 +2331,21 @@ void tst_QTextLayout::koreanWordWrap()
QCOMPARE(layout.lineAt(1).textLength(), 4);
}
+void tst_QTextLayout::tooManyDirectionalCharctersCrash_qtbug77819()
+{
+ QString data;
+ data += QString::fromUtf8("\xe2\x81\xa8"); // U+2068 FSI character
+ data += QString::fromUtf8("\xe2\x81\xa7"); // U+2067 RLI character
+
+ // duplicating the text
+ for (int i = 0; i < 10; i++)
+ data += data;
+
+ // Nothing to test. It must not crash in beginLayout().
+ QTextLayout tl(data);
+ tl.beginLayout();
+ tl.endLayout();
+}
+
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index e24a06bc34..c264956d7b 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -477,6 +477,9 @@ void tst_Http2::goaway_data()
// - server waits for some time (enough for ur to init several streams on a
// client side); then suddenly it replies with GOAWAY, never processing any
// request.
+ if (clearTextHTTP2)
+ QSKIP("This test requires TLS with ALPN to work");
+
QTest::addColumn<int>("responseTimeoutMS");
QTest::newRow("ImmediateGOAWAY") << 0;
QTest::newRow("DelayedGOAWAY") << 1000;
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 032580e0f6..fbf906b55d 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -1010,7 +1010,10 @@ void PaintCommands::command_drawPixmap(QRegularExpressionMatch re)
qPrintable(re.captured(1)), pm.width(), pm.height(), pm.depth(),
tx, ty, tw, th, sx, sy, sw, sh);
- m_painter->drawPixmap(QRectF(tx, ty, tw, th), pm, QRectF(sx, sy, sw, sh));
+ if (!re.capturedLength(4)) // at most two coordinates specified
+ m_painter->drawPixmap(QPointF(tx, ty), pm);
+ else
+ m_painter->drawPixmap(QRectF(tx, ty, tw, th), pm, QRectF(sx, sy, sw, sh));
}
/***************************************************************************************************/
@@ -1057,7 +1060,10 @@ void PaintCommands::command_drawImage(QRegularExpressionMatch re)
printf(" -(lance) drawImage('%s' dim=(%d, %d), (%f, %f, %f, %f), (%f, %f, %f, %f)\n",
qPrintable(re.captured(1)), im.width(), im.height(), tx, ty, tw, th, sx, sy, sw, sh);
- m_painter->drawImage(QRectF(tx, ty, tw, th), im, QRectF(sx, sy, sw, sh), Qt::OrderedDither | Qt::OrderedAlphaDither);
+ if (!re.capturedLength(4)) // at most two coordinates specified
+ m_painter->drawImage(QPointF(tx, ty), im);
+ else
+ m_painter->drawImage(QRectF(tx, ty, tw, th), im, QRectF(sx, sy, sw, sh));
}
/***************************************************************************************************/
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index 8c262ff3a5..84120c70e9 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -115,6 +115,7 @@ private slots:
void context();
void duplicatedShortcutOverride();
void shortcutToFocusProxy();
+ void deleteLater();
protected:
static Qt::KeyboardModifiers toButtons( int key );
@@ -1263,5 +1264,14 @@ void tst_QShortcut::shortcutToFocusProxy()
QCOMPARE(le.text(), QString());
}
+void tst_QShortcut::deleteLater()
+{
+ QWidget w;
+ QPointer<QShortcut> sc(new QShortcut(QKeySequence(Qt::Key_1), &w));
+ sc->deleteLater();
+ QTRY_VERIFY(!sc);
+}
+
+
QTEST_MAIN(tst_QShortcut)
#include "tst_qshortcut.moc"
diff --git a/tests/baselineserver/shared/qbaselinetest.cpp b/tests/baselineserver/shared/qbaselinetest.cpp
index 11fb208f20..3587cd01ea 100644
--- a/tests/baselineserver/shared/qbaselinetest.cpp
+++ b/tests/baselineserver/shared/qbaselinetest.cpp
@@ -28,10 +28,8 @@
#include "qbaselinetest.h"
#include "baselineprotocol.h"
-#if QT_CONFIG(process)
-# include <QtCore/QProcess>
-#endif
#include <QtCore/QDir>
+#include <QFile>
#define MAXCMDLINEARGS 128
@@ -146,20 +144,15 @@ void addClientProperty(const QString& key, const QString& value)
*/
void fetchCustomClientProperties()
{
-#if !QT_CONFIG(process)
- QSKIP("This test requires QProcess support");
-#else
- QString script = "hostinfo.sh"; //### TBD: Windows implementation (hostinfo.bat)
-
- QProcess runScript;
- runScript.setWorkingDirectory(QCoreApplication::applicationDirPath());
- runScript.start("sh", QStringList() << script, QIODevice::ReadOnly);
- if (!runScript.waitForFinished(5000) || runScript.error() != QProcess::UnknownError) {
- qWarning() << "QBaselineTest: Error running script" << runScript.workingDirectory() + QDir::separator() + script << ":" << runScript.errorString();
- qDebug() << " stderr:" << runScript.readAllStandardError().trimmed();
- }
- while (!runScript.atEnd()) {
- QByteArray line = runScript.readLine().trimmed(); // ###local8bit? utf8?
+ QFile file("hostinfo.txt");
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
+ return;
+ QTextStream in(&file);
+
+ while (!in.atEnd()) {
+ QString line = in.readLine().trimmed(); // ###local8bit? utf8?
+ if (line.startsWith(QLatin1Char('#'))) // Ignore comments in file
+ continue;
QString key, val;
int colonPos = line.indexOf(':');
if (colonPos > 0) {
@@ -171,7 +164,6 @@ void fetchCustomClientProperties()
else
qDebug() << "Unparseable script output ignored:" << line;
}
-#endif // QT_CONFIG(process)
}