summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-29 22:46:48 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-29 22:46:48 (GMT)
commit3bee0c34590e6696d4477835aaa883e930903109 (patch)
tree0981eb821f634c514e01b32912c0ffefe09f0e53 /tests
parente8c01ab0e5fb6134617a69d88ed0cbce24a33da5 (diff)
parent1fff0c3c764500c755c615f9eb8dc90433406a10 (diff)
downloadQt-3bee0c34590e6696d4477835aaa883e930903109.zip
Qt-3bee0c34590e6696d4477835aaa883e930903109.tar.gz
Qt-3bee0c34590e6696d4477835aaa883e930903109.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: 32bit => 16bit conversion has 4byte-aligned output. Fix gcc bug in qReallocAligned Prevented threading related crash in OpenGL module. Fix possible crash in QStaticText and QDeclarativeTextLayout Fix QTBUG-14132 oracle (xe) stored procedures with bind variables get errors
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgl/tst_qgl.cpp118
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp21
2 files changed, 139 insertions, 0 deletions
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index e411508..4220b45 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -96,6 +96,7 @@ private slots:
void shareRegister();
void qglContextDefaultBindTexture();
void textureCleanup();
+ void threadImages();
};
tst_QGL::tst_QGL()
@@ -2253,6 +2254,123 @@ void tst_QGL::textureCleanup()
#endif
}
+namespace ThreadImages {
+
+class Producer : public QObject
+{
+ Q_OBJECT
+public:
+ Producer()
+ {
+ startTimer(20);
+
+ QThread *thread = new QThread;
+ thread->start();
+
+ connect(this, SIGNAL(destroyed()), thread, SLOT(quit()));
+
+ moveToThread(thread);
+ connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
+ }
+
+signals:
+ void imageReady(const QImage &image);
+
+protected:
+ void timerEvent(QTimerEvent *)
+ {
+ QImage image(256, 256, QImage::Format_RGB32);
+ QLinearGradient g(0, 0, 0, 256);
+ g.setColorAt(0, QColor(255, 180, 180));
+ g.setColorAt(1, Qt::white);
+ g.setSpread(QGradient::ReflectSpread);
+
+ QBrush brush(g);
+ brush.setTransform(QTransform::fromTranslate(0, delta));
+ delta += 10;
+
+ QPainter p(&image);
+ p.fillRect(image.rect(), brush);
+
+ if (images.size() > 10)
+ images.removeFirst();
+
+ images.append(image);
+
+ emit imageReady(image);
+ }
+
+private:
+ QList<QImage> images;
+ int delta;
+};
+
+
+class DisplayWidget : public QGLWidget
+{
+ Q_OBJECT
+public:
+ DisplayWidget(QWidget *parent) : QGLWidget(parent) {}
+ void paintEvent(QPaintEvent *)
+ {
+ QPainter p(this);
+ p.drawImage(rect(), m_image);
+ }
+
+public slots:
+ void setImage(const QImage &image)
+ {
+ m_image = image;
+ update();
+ }
+
+private:
+ QImage m_image;
+};
+
+class Widget : public QWidget
+{
+ Q_OBJECT
+public:
+ Widget()
+ : iterations(0)
+ , display(0)
+ {
+ startTimer(400);
+ }
+
+ int iterations;
+
+protected:
+ void timerEvent(QTimerEvent *)
+ {
+ ++iterations;
+
+ delete display;
+ display = new DisplayWidget(this);
+ connect(&producer, SIGNAL(imageReady(const QImage &)), display, SLOT(setImage(const QImage &)));
+
+ display->setGeometry(rect());
+ display->show();
+ }
+
+private:
+ Producer producer;
+ DisplayWidget *display;
+};
+
+}
+
+void tst_QGL::threadImages()
+{
+ ThreadImages::Widget *widget = new ThreadImages::Widget;
+ widget->show();
+
+ while (widget->iterations <= 5) {
+ qApp->processEvents();
+ }
+}
+
class tst_QGLDummy : public QObject
{
Q_OBJECT
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index c7a61a5..7c93c7a 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -209,6 +209,8 @@ private slots:
void QTBUG_6852();
void QTBUG_5765_data() { generic_data("QMYSQL"); }
void QTBUG_5765();
+ void QTBUG_14132_data() { generic_data("QOCI"); }
+ void QTBUG_14132();
void sqlite_constraint_data() { generic_data("QSQLITE"); }
void sqlite_constraint();
@@ -2933,6 +2935,25 @@ void tst_QSqlQuery::QTBUG_551()
QCOMPARE(res_outLst[2].toString(), QLatin1String("3. Value is 2"));
}
+void tst_QSqlQuery::QTBUG_14132()
+{
+ QFETCH( QString, dbName );
+ QSqlDatabase db = QSqlDatabase::database( dbName );
+ CHECK_DATABASE( db );
+ QSqlQuery q(db);
+ const QString procedureName(qTableName("procedure", __FILE__));
+ QVERIFY_SQL(q, exec("CREATE OR REPLACE PROCEDURE "+ procedureName + " (outStr OUT varchar2) \n\
+ is \n\
+ begin \n\
+ outStr := 'OUTSTRING'; \n\
+ end;"));
+ QString outValue = "XXXXXXXXX";
+ q.prepare("CALL "+procedureName+"(?)");
+ q.addBindValue(outValue, QSql::Out);
+ QVERIFY_SQL(q, exec());
+ QCOMPARE(outValue, QLatin1String("OUTSTRING"));
+}
+
void tst_QSqlQuery::QTBUG_5251()
{
QFETCH( QString, dbName );