summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius@trolltech.com>2009-06-30 12:58:16 +0200
committerMarius Storm-Olsen <marius@trolltech.com>2009-06-30 12:58:16 +0200
commit116683d4284646d91013e6f3a8d940c8855fbca3 (patch)
tree93bdc46bec4f274ef28939e1840cdfc39bcfcc05 /tests/auto
parent5a54b2c4c448ea22adb56bc191303abca34f230b (diff)
parent238a618b5482e0471f46ed71362492be9c4df4a6 (diff)
Merge branch '4.5'
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qmake/testcompiler.cpp2
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp10
-rw-r--r--tests/auto/qstyle/qstyle.pro3
-rw-r--r--tests/auto/qstyle/tst_qstyle.cpp3
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp33
5 files changed, 43 insertions, 8 deletions
diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp
index 2f8dae8326..38876d0179 100644
--- a/tests/auto/qmake/testcompiler.cpp
+++ b/tests/auto/qmake/testcompiler.cpp
@@ -56,7 +56,7 @@ static QString targetName( BuildType buildMode, const QString& target, const QSt
targetName.append(".exe");
break;
case Dll: // dll
- if (!version.empty())
+ if (!version.isEmpty())
targetName.append(version.section(".", 0, 0));
targetName.append(".dll");
break;
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index 9604fa8d4f..ab7f0c9ddc 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -175,13 +175,14 @@ private slots:
void emptyTableNavigate();
#ifdef NOT_READY_YET
- void task_217003_data() { generic_data(); }
- void task_217003();
void task_229811();
void task_229811_data() { generic_data(); }
void task_234422_data() { generic_data(); }
void task_234422();
#endif
+ void task_217003_data() { generic_data(); }
+ void task_217003();
+
void task_250026_data() { generic_data("QODBC"); }
void task_250026();
void task_205701_data() { generic_data("QMYSQL"); }
@@ -300,9 +301,8 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
tablenames << qTableName( "qtest_lockedtable" );
-#ifdef NOT_READY_YET
tablenames << qTableName( "Planet" );
-#endif
+
tablenames << qTableName( "task_250026" );
tablenames << qTableName( "task_234422" );
@@ -2616,7 +2616,6 @@ void tst_QSqlQuery::emptyTableNavigate()
}
}
-#ifdef NOT_READY_YET
void tst_QSqlQuery::task_217003()
{
QFETCH( QString, dbName );
@@ -2643,7 +2642,6 @@ void tst_QSqlQuery::task_217003()
QVERIFY_SQL( q, seek( 1 ) );
QCOMPARE( q.value( 0 ).toString(), QString( "Venus" ) );
}
-#endif
void tst_QSqlQuery::task_250026()
{
diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro
index 71ee2e6a41..ba0908afa9 100644
--- a/tests/auto/qstyle/qstyle.pro
+++ b/tests/auto/qstyle/qstyle.pro
@@ -2,9 +2,12 @@ load(qttest_p4)
SOURCES += tst_qstyle.cpp
wince*: {
+ DEFINES += SRCDIR=\\\".\\\"
addPixmap.sources = task_25863.png
addPixmap.path = .
DEPLOYMENT += addPixmap
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp
index 667d4594cb..4009e66f3f 100644
--- a/tests/auto/qstyle/tst_qstyle.cpp
+++ b/tests/auto/qstyle/tst_qstyle.cpp
@@ -257,7 +257,8 @@ void tst_QStyle::drawItemPixmap()
{
testWidget->resize(300, 300);
testWidget->show();
- QPixmap p("task_25863.png", "PNG");
+
+ QPixmap p(QString(SRCDIR) + "/task_25863.png", "PNG");
QPixmap actualPix = QPixmap::grabWidget(testWidget);
QVERIFY(pixmapsAreEqual(&actualPix,&p));
testWidget->hide();
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index d7c0574f91..66896a834c 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -88,6 +88,7 @@ private slots:
void rename();
void renameFdLeak();
void reOpenThroughQFile();
+ void keepOpenMode();
public:
};
@@ -439,5 +440,37 @@ void tst_QTemporaryFile::reOpenThroughQFile()
QCOMPARE(file.readAll(), data);
}
+void tst_QTemporaryFile::keepOpenMode()
+{
+ QByteArray data("abcdefghij");
+
+ {
+ QTemporaryFile file;
+ QVERIFY(((QFile &)file).open(QIODevice::WriteOnly));
+ QVERIFY(QIODevice::WriteOnly == file.openMode());
+
+ QCOMPARE(file.write(data), (qint64)data.size());
+ file.close();
+
+ QVERIFY(((QFile &)file).open(QIODevice::ReadOnly));
+ QVERIFY(QIODevice::ReadOnly == file.openMode());
+ QCOMPARE(file.readAll(), data);
+ }
+
+ {
+ QTemporaryFile file;
+ QVERIFY(file.open());
+ QCOMPARE(file.write(data), (qint64)data.size());
+ QVERIFY(file.rename("temporary-file.txt"));
+
+ QVERIFY(((QFile &)file).open(QIODevice::ReadOnly));
+ QVERIFY(QIODevice::ReadOnly == file.openMode());
+ QCOMPARE(file.readAll(), data);
+
+ QVERIFY(((QFile &)file).open(QIODevice::WriteOnly));
+ QVERIFY(QIODevice::WriteOnly == file.openMode());
+ }
+}
+
QTEST_MAIN(tst_QTemporaryFile)
#include "tst_qtemporaryfile.moc"