summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp2
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp13
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp34
-rw-r--r--tests/auto/network/access/qnetworkreply/BLACKLIST2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp2
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanagerqappless/tst_qnetworkconfigurationmanagerqappless.cpp2
-rw-r--r--tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp2
-rw-r--r--tests/auto/other/lancelot/scripts/text.qps20
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp2
-rw-r--r--tests/auto/widgets/util/qscroller/tst_qscroller.cpp6
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp52
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp2
-rw-r--r--tests/manual/diaglib/eventfilter.cpp2
13 files changed, 131 insertions, 10 deletions
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index e0eaba9896..f6b8fbcab9 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -791,7 +791,7 @@ void tst_QImageReader::animatedGif()
}
}
-// http://bugreports.qt-project.org/browse/QTBUG-6696
+// QTBUG-6696
// Check the count of images in various call orders...
void tst_QImageReader::gifImageCount()
{
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 1f6bcbd341..12ca2bb68a 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -155,6 +155,7 @@ public:
void reset()
{
m_received.clear();
+ m_framePositionsOnMove.clear();
}
bool event(QEvent *event)
@@ -170,6 +171,9 @@ public:
m_surfaceventType = static_cast<QPlatformSurfaceEvent *>(event)->surfaceEventType();
break;
+ case QEvent::Move:
+ m_framePositionsOnMove << framePosition();
+ break;
default:
break;
}
@@ -197,6 +201,7 @@ public:
return m_surfaceventType;
}
+ QVector<QPoint> m_framePositionsOnMove;
private:
QHash<QEvent::Type, int> m_received;
QVector<QEvent::Type> m_order;
@@ -321,9 +326,17 @@ void tst_QWindow::positioning()
QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().center();
window.reset();
+ const QPoint oldFramePos = window.framePosition();
window.setFramePosition(framePos);
QTRY_VERIFY(window.received(QEvent::Move));
+ if (window.framePosition() != framePos) {
+ qDebug() << "About to fail auto-test. Here is some additional information:";
+ qDebug() << "window.framePosition() == " << window.framePosition();
+ qDebug() << "old frame position == " << oldFramePos;
+ qDebug() << "We received " << window.received(QEvent::Move) << " move events";
+ qDebug() << "frame positions after each move event:" << window.m_framePositionsOnMove;
+ }
QTRY_COMPARE(framePos, window.framePosition());
QTRY_COMPARE(originalMargins, window.frameMargins());
QCOMPARE(window.position(), window.framePosition() + QPoint(originalMargins.left(), originalMargins.top()));
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index a9a358711b..4b2970cd17 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -116,6 +116,7 @@ private slots:
void boundingRectForSetLineWidth();
void glyphLessItems();
void justifyTrailingSpaces();
+ void layoutWithCustomTabStops();
// QTextLine stuff
void setNumColumnsWrapAtWordBoundaryOrAnywhere();
@@ -2050,5 +2051,38 @@ void tst_QTextLayout::nbsp()
layout.endLayout();
}
+void tst_QTextLayout::layoutWithCustomTabStops()
+{
+ QScopedPointer<QTextLayout> textLayout(new QTextLayout);
+ QList<QTextOption::Tab> tabStops;
+
+ const int tabWidth = 18;
+ const int maxTabPos = 2500;
+ for (int tabPos = tabWidth; tabPos < maxTabPos; tabPos += tabWidth)
+ tabStops << QTextOption::Tab(tabPos, QTextOption::LeftTab);
+
+ QTextOption textOption;
+ textOption.setTabs(tabStops);
+ textLayout->setTextOption(textOption);
+
+ textLayout->setText(QStringLiteral("\ta aa aa aa aa aa aa"));
+
+ textLayout->beginLayout();
+ textLayout->createLine();
+ textLayout->endLayout();
+
+ qreal shortWidth = textLayout->maximumWidth();
+
+ textLayout->setText(QStringLiteral("\ta aa aa aa aa aa aa aa aa aa aa aa aa a"));
+
+ textLayout->beginLayout();
+ textLayout->createLine();
+ textLayout->endLayout();
+
+ qreal longWidth = textLayout->maximumWidth();
+
+ QVERIFY(longWidth > shortWidth);
+}
+
QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc"
diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST
index 7792e05e0f..84ccb49e58 100644
--- a/tests/auto/network/access/qnetworkreply/BLACKLIST
+++ b/tests/auto/network/access/qnetworkreply/BLACKLIST
@@ -2,6 +2,8 @@
osx
[ioGetFromBuiltinHttp:https+limited]
osx
+[ioGetFromHttpBrokenServer:no-newline]
+osx
[synchronousRequest:https]
osx
[SslHandshakeFailedError]
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 533f7a7289..7afffff00b 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -7290,7 +7290,7 @@ void tst_QNetworkReply::synchronousRequest()
// workaround for HTTPS requests: add self-signed server cert to list of CA certs,
// since we cannot react to the sslErrors() signal
// to fix this properly we would need to have an ignoreSslErrors() method in the
- // QNetworkRequest, see http://bugreports.qt-project.org/browse/QTBUG-14774
+ // QNetworkRequest, see QTBUG-14774
if (url.scheme() == "https") {
QSslConfiguration sslConf;
QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanagerqappless/tst_qnetworkconfigurationmanagerqappless.cpp b/tests/auto/network/bearer/qnetworkconfigurationmanagerqappless/tst_qnetworkconfigurationmanagerqappless.cpp
index 39d5a22dbe..00a63ff132 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanagerqappless/tst_qnetworkconfigurationmanagerqappless.cpp
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanagerqappless/tst_qnetworkconfigurationmanagerqappless.cpp
@@ -47,7 +47,7 @@ private slots:
void tst_QNetworkConfigurationManager::staticsInitialization()
{
// This code should not crash. The test was introduced as
- // a fix for https://bugreports.qt-project.org/browse/QTBUG-36897
+ // a fix for QTBUG-36897
for (int i = 0; i < 2; i++)
{
int argc = 1;
diff --git a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
index 87342508df..a225bbdb1e 100644
--- a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
+++ b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
@@ -195,7 +195,7 @@ void tst_QGLBuffer::testBuffer(QGLBuffer::Type type)
void tst_QGLBuffer::bufferSharing()
{
#if defined(Q_OS_WIN)
- // Needs investigation on Windows: https://bugreports.qt-project.org/browse/QTBUG-29692
+ // Needs investigation on Windows: QTBUG-29692
QSKIP("Unreproducible timeout on Windows (MSVC/MinGW) CI bots");
#endif
diff --git a/tests/auto/other/lancelot/scripts/text.qps b/tests/auto/other/lancelot/scripts/text.qps
index b3d8475411..344c7a813d 100644
--- a/tests/auto/other/lancelot/scripts/text.qps
+++ b/tests/auto/other/lancelot/scripts/text.qps
@@ -139,4 +139,24 @@ save
setClipPath clip
setPen black
repeat_block text_drawing
+restore
+
+translate 150 0
+save
+ setPen black
+ setFont "sansserif" 10 normal
+ drawText 0 20 "testing glyph cache textures"
+
+ # Important that this gradient doesn't match any earlier
+ # gradients, so that it's not cached from before.
+ gradient_clearStops
+ gradient_appendStop 0 blue
+ gradient_appendStop 0.5 #00ff00
+ gradient_appendStop 1 red
+ gradient_setLinear 0 0 100 0
+ setPen nopen
+ drawRect 0 30 100 20
+
+ setPen black
+ drawText 0 70 "testing glyph cache textures"
restore \ No newline at end of file
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index e3a72f4ab4..78aa0af43d 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -735,7 +735,7 @@ void tst_QPrinter::customPaperNameSettingBySize()
// Fail with the original values
if (!paperNameFound) {
qDebug() << "supportedPageSizes() = " << sizes;
- QEXPECT_FAIL("", "Paper Name mismatch: please report this failure at bugreports.qt-project.org", Continue);
+ QEXPECT_FAIL("", "Paper Name mismatch: please report this failure at bugreports.qt.io", Continue);
QCOMPARE(sizes.at(i).name(), printer.paperName());
}
}
diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
index 5c299bab42..03b748c0dd 100644
--- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
+++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
@@ -356,7 +356,7 @@ void tst_QScroller::scrollerProperties()
void tst_QScroller::scrollTo()
{
#ifdef Q_OS_MAC
- QSKIP("Flakey test - https://bugreports.qt-project.org/browse/QTBUG-29950");
+ QSKIP("Flakey test - QTBUG-29950");
#endif
{
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
@@ -385,7 +385,7 @@ void tst_QScroller::scrollTo()
void tst_QScroller::scroll()
{
#ifdef Q_OS_MAC
- QSKIP("Flakey test - https://bugreports.qt-project.org/browse/QTBUG-30133");
+ QSKIP("Flakey test - QTBUG-30133");
#endif
#ifndef QT_NO_GESTURES
// -- good case. normal scroll
@@ -430,7 +430,7 @@ void tst_QScroller::scroll()
void tst_QScroller::overshoot()
{
#ifdef Q_OS_MAC
- QSKIP("Flakey test - https://bugreports.qt-project.org/browse/QTBUG-29950");
+ QSKIP("Flakey test - QTBUG-29950");
#endif
#ifndef QT_NO_GESTURES
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index d309b0840e..2ac31bfe1b 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -34,6 +34,11 @@
#include <QtWidgets/QOpenGLWidget>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QPainter>
+#include <QtWidgets/QGraphicsView>
+#include <QtWidgets/QGraphicsScene>
+#include <QtWidgets/QGraphicsRectItem>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QPushButton>
#include <QtTest/QtTest>
#include <QSignalSpy>
@@ -49,6 +54,7 @@ private slots:
void painter();
void reparentToAlreadyCreated();
void reparentToNotYetCreated();
+ void asViewport();
};
void tst_QOpenGLWidget::create()
@@ -253,6 +259,52 @@ void tst_QOpenGLWidget::reparentToNotYetCreated()
QVERIFY(image.pixel(20, 10) == qRgb(0, 0, 255));
}
+class CountingGraphicsView : public QGraphicsView
+{
+public:
+ CountingGraphicsView(): m_count(0) { }
+ int paintCount() const { return m_count; }
+ void resetPaintCount() { m_count = 0; }
+
+protected:
+ void drawForeground(QPainter *, const QRectF &) Q_DECL_OVERRIDE;
+ int m_count;
+};
+
+void CountingGraphicsView::drawForeground(QPainter *, const QRectF &)
+{
+ ++m_count;
+}
+
+void tst_QOpenGLWidget::asViewport()
+{
+ // Have a QGraphicsView with a QOpenGLWidget as its viewport.
+ QGraphicsScene scene;
+ scene.addItem(new QGraphicsRectItem(10, 10, 100, 100));
+ CountingGraphicsView *view = new CountingGraphicsView;
+ view->setScene(&scene);
+ view->setViewport(new QOpenGLWidget);
+ QWidget widget;
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(view);
+ QPushButton *btn = new QPushButton("Test");
+ layout->addWidget(btn);
+ widget.setLayout(layout);
+ widget.show();
+ QTest::qWaitForWindowExposed(&widget);
+
+ QVERIFY(view->paintCount() > 0);
+ view->resetPaintCount();
+
+ // And now trigger a repaint on the push button. We must not
+ // receive paint events for the graphics view. If we do, that's a
+ // side effect of QOpenGLWidget's special behavior and handling in
+ // the widget stack.
+ btn->update();
+ qApp->processEvents();
+ QVERIFY(view->paintCount() == 0);
+}
+
QTEST_MAIN(tst_QOpenGLWidget)
#include "tst_qopenglwidget.moc"
diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
index 78f30f4e42..cb0383c398 100644
--- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
@@ -151,7 +151,7 @@ void tst_QScrollBar::task_209492()
#define WHEEL_DELTA 120 // copied from tst_QAbstractSlider / tst_QComboBox
void tst_QScrollBar::QTBUG_27308()
{
- // https://bugreports.qt-project.org/browse/QTBUG-27308
+ // QTBUG-27308
// Check that a disabled scrollbar doesn't react on wheel events anymore
QScrollBar testWidget(Qt::Horizontal);
diff --git a/tests/manual/diaglib/eventfilter.cpp b/tests/manual/diaglib/eventfilter.cpp
index 4968780e82..23a6d44fef 100644
--- a/tests/manual/diaglib/eventfilter.cpp
+++ b/tests/manual/diaglib/eventfilter.cpp
@@ -59,7 +59,7 @@ void EventFilter::init(EventCategories eventCategories)
<< QEvent::MouseButtonDblClick << QEvent::NonClientAreaMouseButtonPress
<< QEvent::NonClientAreaMouseButtonRelease
<< QEvent::NonClientAreaMouseButtonDblClick
- << QEvent::Enter << QEvent::Leave;
+ << QEvent::Wheel << QEvent::Enter << QEvent::Leave;
}
if (eventCategories & MouseMoveEvents)
m_eventTypes << QEvent::MouseMove << QEvent::NonClientAreaMouseMove;