diff options
Diffstat (limited to 'tests/auto/corelib')
21 files changed, 80 insertions, 2 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 Binary files differnew file mode 100644 index 0000000000..e87bf56453 --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/carriagereturn+nul.xml 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 Binary files differnew file mode 100644 index 0000000000..f76dd238ad --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul0.xml 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 Binary files differnew file mode 100644 index 0000000000..aab3ad6ca9 --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul1.xml 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 Binary files differnew file mode 100644 index 0000000000..e14d1b8ae5 --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul2.xml 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 Binary files differnew file mode 100644 index 0000000000..d8260b908e --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul3.xml 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 Binary files differnew file mode 100644 index 0000000000..61e011014e --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul3bis.xml 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 Binary files differnew file mode 100644 index 0000000000..90f20eebf0 --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul4.xml 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 Binary files differnew file mode 100644 index 0000000000..15d2d10685 --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul4bis.xml 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 Binary files differnew file mode 100644 index 0000000000..6a79cbdc75 --- /dev/null +++ b/tests/auto/corelib/xml/qxmlstream/data/nul5.xml |