summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp11
-rw-r--r--tests/auto/qkeysequence/qkeysequence.pro4
-rw-r--r--tests/auto/qkeysequence/qkeysequence.qrc6
-rw-r--r--tests/auto/qkeysequence/qt_de.qmbin0 -> 186240 bytes
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp4
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp25
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp38
-rw-r--r--tests/auto/qtwidgets/tst_qtwidgets.cpp2
8 files changed, 80 insertions, 10 deletions
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index cab8fda..c0d5051 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -719,13 +719,14 @@ void tst_QImageReader::gifHandlerBugs()
void tst_QImageReader::animatedGif()
{
- QImageReader io(prefix + "qt.gif");
- QImage image= io.read();
- int i=0;
+ QImageReader io(":images/qt.gif");
+ QImage image = io.read();
+ QVERIFY(!image.isNull());
+ int i = 0;
while(!image.isNull()){
- QString frameName = QString(prefix + "qt%1.gif").arg(++i);
+ QString frameName = QString(":images/qt%1.gif").arg(++i);
QCOMPARE(image, QImage(frameName));
- image=io.read();
+ image = io.read();
}
}
#endif
diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro
index 6566340..bd85402 100644
--- a/tests/auto/qkeysequence/qkeysequence.pro
+++ b/tests/auto/qkeysequence/qkeysequence.pro
@@ -1,6 +1,4 @@
load(qttest_p4)
SOURCES += tst_qkeysequence.cpp
-TRANSLATIONS += keys_de.ts
-
-
+RESOURCES += qkeysequence.qrc \ No newline at end of file
diff --git a/tests/auto/qkeysequence/qkeysequence.qrc b/tests/auto/qkeysequence/qkeysequence.qrc
new file mode 100644
index 0000000..e224faa
--- /dev/null
+++ b/tests/auto/qkeysequence/qkeysequence.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource>
+ <file>keys_de.qm</file>
+ <file>qt_de.qm</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/qkeysequence/qt_de.qm b/tests/auto/qkeysequence/qt_de.qm
new file mode 100644
index 0000000..595e4d7
--- /dev/null
+++ b/tests/auto/qkeysequence/qt_de.qm
Binary files differ
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index 88d1d55..1c257bf 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -166,9 +166,9 @@ tst_QKeySequence::~tst_QKeySequence()
void tst_QKeySequence::initTestCase()
{
ourTranslator = new QTranslator(this);
- ourTranslator->load(QLatin1String("keys_de"), ".");
+ ourTranslator->load(":/keys_de");
qtTranslator = new QTranslator(this);
- qtTranslator->load(QLatin1String("qt_de"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+ qtTranslator->load(":/qt_de");
}
void tst_QKeySequence::operatorQString_data()
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 5d14d88..9515d87 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -236,6 +236,8 @@ private slots:
void clippingBug();
void emptyClip();
+ void taskQT4444_dontOverflowDashOffset();
+
private:
void fillData();
QColor baseColor( int k, int intensity=255 );
@@ -4287,5 +4289,28 @@ void tst_QPainter::drawImage_1x1()
QCOMPARE(img, expected);
}
+void tst_QPainter::taskQT4444_dontOverflowDashOffset()
+{
+ QPainter p;
+
+ QPen pen;
+ pen.setWidth(2);
+ pen.setStyle(Qt::DashDotLine);
+
+ QPointF point[4];
+ point[0] = QPointF(182.50868749707968,347.78457234212630);
+ point[1] = QPointF(182.50868749707968,107.22501998401277);
+ point[2] = QPointF(182.50868749707968,107.22501998401277);
+ point[3] = QPointF(520.46600762283651,107.22501998401277);
+
+ QImage crashImage(QSize(1000, 120), QImage::Format_ARGB32_Premultiplied);
+ p.begin(&crashImage);
+ p.setPen(pen);
+ p.drawLines(point, 2);
+ p.end();
+
+ QVERIFY(true); // Don't crash
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index 4bea26d..eb95d611c 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -191,6 +191,9 @@ private slots:
void task_233829_data() { generic_data("QPSQL"); }
void task_233829();
+ void sqlServerReturn0_data() { generic_data(); }
+ void sqlServerReturn0();
+
private:
// returns all database connections
@@ -312,6 +315,13 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
tablenames << qTableName( "task_250026" );
tablenames << qTableName( "task_234422" );
+ if (tst_Databases::isSqlServer( db )) {
+ QSqlQuery q( db );
+ q.exec("DROP PROCEDURE " + qTableName("test141895_proc"));
+ }
+
+ tablenames << qTableName("test141895");
+
tst_Databases::safeDropTables( db, tablenames );
}
@@ -2808,5 +2818,33 @@ void tst_QSqlQuery::task_233829()
QVERIFY_SQL(q,exec());
}
+void tst_QSqlQuery::sqlServerReturn0()
+{
+ QFETCH( QString, dbName );
+ QSqlDatabase db = QSqlDatabase::database( dbName );
+ CHECK_DATABASE( db );
+ if (!tst_Databases::isSqlServer( db ))
+ QSKIP("SQL Server specific test", SkipSingle);
+
+ QString tableName(qTableName("test141895")), procName(qTableName("test141895_proc"));
+ QSqlQuery q( db );
+ q.exec("DROP TABLE " + tableName);
+ q.exec("DROP PROCEDURE " + procName);
+ QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+" (id integer)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (3)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)"));
+ QVERIFY_SQL(q, exec("CREATE PROCEDURE "+procName+
+ " AS "
+ "SELECT * FROM "+tableName+" WHERE ID = 2 "
+ "RETURN 0"));
+
+ QVERIFY_SQL(q, exec("{CALL "+procName+"}"));
+
+ QVERIFY_SQL(q, next());
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"
diff --git a/tests/auto/qtwidgets/tst_qtwidgets.cpp b/tests/auto/qtwidgets/tst_qtwidgets.cpp
index a765bde..fa5cd3e 100644
--- a/tests/auto/qtwidgets/tst_qtwidgets.cpp
+++ b/tests/auto/qtwidgets/tst_qtwidgets.cpp
@@ -74,6 +74,8 @@ void tst_QtWidgets::snapshot()
{
QSKIP("Jesper will fix this test when he has time.", SkipAll);
#if 0
+ QSKIP("This test doesn't do anything useful at the moment.", SkipAll);
+
StyleWidget widget(0, Qt::X11BypassWindowManagerHint);
widget.show();