summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp14
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp37
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring_mac.mm10
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.ref3
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.xmlbin0 -> 60 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul0.ref2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul0.xmlbin0 -> 1 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul1.ref2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul1.xmlbin0 -> 3 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul2.ref3
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul2.xmlbin0 -> 4 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul3.ref2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul3.xmlbin0 -> 7 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul3bis.ref2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul3bis.xmlbin0 -> 9 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul4.ref2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul4.xmlbin0 -> 8 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul4bis.ref2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul4bis.xmlbin0 -> 10 bytes
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul5.ref3
-rw-r--r--tests/auto/corelib/xml/qxmlstream/data/nul5.xmlbin0 -> 23 bytes
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp2
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp2
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp2
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp11
25 files changed, 90 insertions, 9 deletions
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
index a68a1185b8..e909b90a12 100644
--- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
+++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
@@ -70,6 +70,8 @@ private slots:
void QTBUG_4796_data();
void QTBUG_4796();
+ void QTBUG43352_failedSetPermissions();
+
public:
};
@@ -419,5 +421,17 @@ void tst_QTemporaryDir::QTBUG_4796() // unicode support
cleaner.reset();
}
+void tst_QTemporaryDir::QTBUG43352_failedSetPermissions()
+{
+ QString path = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + QStringLiteral("/");
+ int count = QDir(path).entryList().size();
+
+ {
+ QTemporaryDir dir(path);
+ }
+
+ QCOMPARE(QDir(path).entryList().size(), count);
+}
+
QTEST_MAIN(tst_QTemporaryDir)
#include "tst_qtemporarydir.moc"
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 53ed1bc9a0..5bb7ffc401 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -96,6 +96,7 @@ private slots:
void changeSourceData_data();
void changeSourceData();
void changeSourceDataKeepsStableSorting_qtbug1548();
+ void resortingDoesNotBreakTreeModels();
void sortFilterRole();
void selectionFilteredOut();
void match_data();
@@ -2029,6 +2030,8 @@ static void checkSortedTableModel(const QAbstractItemModel *model, const QString
void tst_QSortFilterProxyModel::changeSourceDataKeepsStableSorting_qtbug1548()
{
+ QSKIP("This test will fail, see QTBUG-1548");
+
// Check that emitting dataChanged from the source model
// for a change of a role which is not the sorting role
// doesn't alter the sorting. In this case, we sort on the DisplayRole,
@@ -4028,5 +4031,39 @@ void tst_QSortFilterProxyModel::canDropMimeData()
QCOMPARE(proxy.canDropMimeData(0, Qt::CopyAction, -1, -1, proxy.index(row, 0)), row < 5);
}
+void tst_QSortFilterProxyModel::resortingDoesNotBreakTreeModels()
+{
+ QStandardItemModel *treeModel = new QStandardItemModel(this);
+ QStandardItem *e1 = new QStandardItem("Loading...");
+ e1->appendRow(new QStandardItem("entry10"));
+ treeModel->appendRow(e1);
+ QStandardItem *e0 = new QStandardItem("Loading...");
+ e0->appendRow(new QStandardItem("entry00"));
+ e0->appendRow(new QStandardItem("entry01"));
+ treeModel->appendRow(e0);
+
+ QSortFilterProxyModel proxy;
+ proxy.setDynamicSortFilter(true);
+ proxy.sort(0);
+ proxy.setSourceModel(treeModel);
+
+ ModelTest modelTest(&proxy);
+
+ QCOMPARE(proxy.rowCount(), 2);
+ e1->setText("entry1");
+ e0->setText("entry0");
+
+ QModelIndex pi0 = proxy.index(0, 0);
+ QCOMPARE(pi0.data().toString(), QString("entry0"));
+ QCOMPARE(proxy.rowCount(pi0), 2);
+
+ QModelIndex pi01 = proxy.index(1, 0, pi0);
+ QCOMPARE(pi01.data().toString(), QString("entry01"));
+
+ QModelIndex pi1 = proxy.index(1, 0);
+ QCOMPARE(pi1.data().toString(), QString("entry1"));
+ QCOMPARE(proxy.rowCount(pi1), 1);
+}
+
QTEST_MAIN(tst_QSortFilterProxyModel)
#include "tst_qsortfilterproxymodel.moc"
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
index 9061b6c39d..4cec5b3798 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
+++ b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
@@ -63,17 +63,23 @@ void tst_QString_macTypes()
}
// QString <-> NSString
{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
QString qtString("test string");
const NSString *nsString = qtString.toNSString();
QCOMPARE(QString::fromNSString(nsString), qtString);
- [nsString release];
+
+ [pool release];
}
{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
QString qtString("test string");
const NSString *nsString = qtString.toNSString();
QString qtStringCopy(qtString);
qtString = qtString.toUpper(); // modify
QCOMPARE(QString::fromNSString(nsString), qtStringCopy);
- [nsString release];
+
+ [pool release];
}
}
diff --git a/tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.ref b/tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.ref
new file mode 100644
index 0000000000..b636d80294
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.ref
@@ -0,0 +1,3 @@
+StartDocument( )
+Invalid( processingInstructionTarget="xml_" )
+ERROR: Invalid XML character.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.xml b/tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.xml
new file mode 100644
index 0000000000..e87bf56453
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul0.ref b/tests/auto/corelib/xml/qxmlstream/data/nul0.ref
new file mode 100644
index 0000000000..a76455ee07
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul0.ref
@@ -0,0 +1,2 @@
+Invalid( )
+ERROR: Premature end of document.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul0.xml b/tests/auto/corelib/xml/qxmlstream/data/nul0.xml
new file mode 100644
index 0000000000..f76dd238ad
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul0.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul1.ref b/tests/auto/corelib/xml/qxmlstream/data/nul1.ref
new file mode 100644
index 0000000000..a76455ee07
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul1.ref
@@ -0,0 +1,2 @@
+Invalid( )
+ERROR: Premature end of document.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul1.xml b/tests/auto/corelib/xml/qxmlstream/data/nul1.xml
new file mode 100644
index 0000000000..aab3ad6ca9
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul1.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul2.ref b/tests/auto/corelib/xml/qxmlstream/data/nul2.ref
new file mode 100644
index 0000000000..08bbcc6aa4
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul2.ref
@@ -0,0 +1,3 @@
+StartDocument( )
+Invalid( )
+ERROR: Expected '[a-zA-Z]', but got ' '.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul2.xml b/tests/auto/corelib/xml/qxmlstream/data/nul2.xml
new file mode 100644
index 0000000000..e14d1b8ae5
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul2.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul3.ref b/tests/auto/corelib/xml/qxmlstream/data/nul3.ref
new file mode 100644
index 0000000000..cf4dd3848b
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul3.ref
@@ -0,0 +1,2 @@
+Invalid( )
+ERROR: Expected 'version', but got ''.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul3.xml b/tests/auto/corelib/xml/qxmlstream/data/nul3.xml
new file mode 100644
index 0000000000..d8260b908e
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul3.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul3bis.ref b/tests/auto/corelib/xml/qxmlstream/data/nul3bis.ref
new file mode 100644
index 0000000000..cf4dd3848b
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul3bis.ref
@@ -0,0 +1,2 @@
+Invalid( )
+ERROR: Expected 'version', but got ''.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul3bis.xml b/tests/auto/corelib/xml/qxmlstream/data/nul3bis.xml
new file mode 100644
index 0000000000..61e011014e
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul3bis.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul4.ref b/tests/auto/corelib/xml/qxmlstream/data/nul4.ref
new file mode 100644
index 0000000000..cf4dd3848b
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul4.ref
@@ -0,0 +1,2 @@
+Invalid( )
+ERROR: Expected 'version', but got ''.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul4.xml b/tests/auto/corelib/xml/qxmlstream/data/nul4.xml
new file mode 100644
index 0000000000..90f20eebf0
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul4.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul4bis.ref b/tests/auto/corelib/xml/qxmlstream/data/nul4bis.ref
new file mode 100644
index 0000000000..cf4dd3848b
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul4bis.ref
@@ -0,0 +1,2 @@
+Invalid( )
+ERROR: Expected 'version', but got ''.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul4bis.xml b/tests/auto/corelib/xml/qxmlstream/data/nul4bis.xml
new file mode 100644
index 0000000000..15d2d10685
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul4bis.xml
Binary files differ
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul5.ref b/tests/auto/corelib/xml/qxmlstream/data/nul5.ref
new file mode 100644
index 0000000000..9432b74a99
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul5.ref
@@ -0,0 +1,3 @@
+StartDocument( documentVersion="1.0" )
+Invalid( )
+ERROR: Start tag expected.
diff --git a/tests/auto/corelib/xml/qxmlstream/data/nul5.xml b/tests/auto/corelib/xml/qxmlstream/data/nul5.xml
new file mode 100644
index 0000000000..6a79cbdc75
--- /dev/null
+++ b/tests/auto/corelib/xml/qxmlstream/data/nul5.xml
Binary files differ
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index aa954429de..a355cfeb17 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -772,7 +772,7 @@ void tst_QSslSocket::peerCertificateChain()
QVERIFY(socket->waitForDisconnected());
// connect again to a different server
- socket->connectToHostEncrypted("qt-project.org", 443);
+ socket->connectToHostEncrypted("www.qt.io", 443);
socket->ignoreSslErrors();
QCOMPARE(socket->mode(), QSslSocket::UnencryptedMode);
QVERIFY(socket->peerCertificateChain().isEmpty());
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
index 94d7c3905c..1a65d5f9f3 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
@@ -185,7 +185,7 @@ void tst_QSslSocket_onDemandCertificates_member::proxyAuthenticationRequired(con
void tst_QSslSocket_onDemandCertificates_member::onDemandRootCertLoadingMemberMethods()
{
- QString host("qt-project.org");
+ QString host("www.qt.io");
// not using any root certs -> should not work
QSslSocketPtr socket2 = newSocket();
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
index 418c702030..ad1f218471 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
@@ -181,7 +181,7 @@ void tst_QSslSocket_onDemandCertificates_static::proxyAuthenticationRequired(con
void tst_QSslSocket_onDemandCertificates_static::onDemandRootCertLoadingStaticMethods()
{
- QString host("qt-project.org");
+ QString host("www.qt.io");
// not using any root certs -> should not work
QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index ac32ee4968..23d0ffd2d2 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -124,7 +124,7 @@ private slots:
void pixmapIcon();
void mouseWheel_data();
void mouseWheel();
- void wheelClosingPopup();
+ void popupWheelHandling();
void layoutDirection();
void itemListPosition();
void separatorItem_data();
@@ -2037,9 +2037,9 @@ void tst_QComboBox::mouseWheel()
}
}
-void tst_QComboBox::wheelClosingPopup()
+void tst_QComboBox::popupWheelHandling()
{
- // QTBUG-40656, combo and other popups should close when the main window gets a wheel event.
+ // QTBUG-40656, QTBUG-42731 combo and other popups should not be affected by wheel events.
QScrollArea scrollArea;
scrollArea.move(300, 300);
QWidget *widget = new QWidget;
@@ -2058,9 +2058,12 @@ void tst_QComboBox::wheelClosingPopup()
QVERIFY(QTest::qWaitForWindowExposed(&scrollArea));
comboBox->showPopup();
QTRY_VERIFY(comboBox->view() && comboBox->view()->isVisible());
+ const QPoint popupPos = comboBox->view()->pos();
QWheelEvent event(QPointF(10, 10), WHEEL_DELTA, Qt::NoButton, Qt::NoModifier);
QVERIFY(QCoreApplication::sendEvent(scrollArea.windowHandle(), &event));
- QTRY_VERIFY(!comboBox->view()->isVisible());
+ QCoreApplication::processEvents();
+ QVERIFY(comboBox->view()->isVisible());
+ QCOMPARE(comboBox->view()->pos(), popupPos);
}
void tst_QComboBox::layoutDirection()