summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp32
-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/qsqlquery/tst_qsqlquery.cpp38
7 files changed, 85 insertions, 10 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 304330e..fa163d8 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -246,6 +246,7 @@ private slots:
void itemClipsToShape();
void itemClipsChildrenToShape();
void itemClipsChildrenToShape2();
+ void itemClipsChildrenToShape3();
void itemClipsTextChildToShape();
void itemClippingDiscovery();
void ancestorFlags();
@@ -5050,6 +5051,37 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2()
#endif
}
+void tst_QGraphicsItem::itemClipsChildrenToShape3()
+{
+ // Construct a scene with nested children, each 50 pixels offset from the elder.
+ // Set a top-level clipping flag
+ QGraphicsScene scene;
+ QGraphicsRectItem *parent = scene.addRect( 0, 0, 150, 150 );
+ QGraphicsRectItem *child = scene.addRect( 0, 0, 150, 150 );
+ QGraphicsRectItem *grandchild = scene.addRect( 0, 0, 150, 150 );
+ child->setParentItem(parent);
+ grandchild->setParentItem(child);
+ child->setPos( 50, 50 );
+ grandchild->setPos( 50, 50 );
+ parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+
+ QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)parent);
+ QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)child);
+ QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0);
+
+ // Move child to fully overlap the parent. The grandchild should
+ // now occupy two-thirds of the scene
+ child->prepareGeometryChange();
+ child->setPos( 0, 0 );
+
+ QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)child);
+ QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0);
+}
+
+
void tst_QGraphicsItem::itemClipsTextChildToShape()
{
// Construct a scene with a rect that clips its children, with one text
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/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"