summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-13 10:51:04 +0100
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-13 10:51:11 +0100
commit63856f13721bce420fe94dab31c36329af976276 (patch)
tree5a2c1d5d49a76a7794fcfd46a6fa664f657ae0fe /tests
parentf5c5cc585cef8d2d2f77e7d83d7a07c6d70f0d09 (diff)
parent6e209bb09f3feef210bc65f94cf8f58dd8e3b4a9 (diff)
Merge commit upstream/4.6 into oslo-staging-2/4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qcoreapplication/tst_qcoreapplication.cpp36
-rw-r--r--tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp10
2 files changed, 41 insertions, 5 deletions
diff --git a/tests/auto/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/qcoreapplication/tst_qcoreapplication.cpp
index c5f06e2bb9..3c61f81513 100644
--- a/tests/auto/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/qcoreapplication/tst_qcoreapplication.cpp
@@ -58,6 +58,7 @@ private slots:
#endif
void applicationPid();
void globalPostedEventsCount();
+ void processEventsAlwaysSendsPostedEvents();
};
class EventSpy : public QObject
@@ -488,5 +489,40 @@ void tst_QCoreApplication::globalPostedEventsCount()
QCOMPARE(x.globalPostedEventsCount, expected);
}
+class ProcessEventsAlwaysSendsPostedEventsObject : public QObject
+{
+public:
+ int counter;
+
+ inline ProcessEventsAlwaysSendsPostedEventsObject()
+ : counter(0)
+ { }
+
+ bool event(QEvent *event)
+ {
+ if (event->type() == QEvent::User)
+ ++counter;
+ return QObject::event(event);
+ }
+};
+
+void tst_QCoreApplication::processEventsAlwaysSendsPostedEvents()
+{
+ int argc = 1;
+ char *argv[] = { "tst_qcoreapplication" };
+ QCoreApplication app(argc, argv);
+
+ ProcessEventsAlwaysSendsPostedEventsObject object;
+ QTime t;
+ t.start();
+ int i = 1;
+ do {
+ QCoreApplication::postEvent(&object, new QEvent(QEvent::User));
+ QCoreApplication::processEvents();
+ QCOMPARE(object.counter, i);
+ ++i;
+ } while (t.elapsed() < 3000);
+}
+
QTEST_APPLESS_MAIN(tst_QCoreApplication)
#include "tst_qcoreapplication.moc"
diff --git a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
index a47cb4880d..2b78d200fe 100644
--- a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
+++ b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
@@ -292,13 +292,13 @@ void tst_QVideoSurfaceFormat::frameRate_data()
QTest::addColumn<qreal>("frameRate");
QTest::newRow("null")
- << 0.0;
+ << qreal(0.0);
QTest::newRow("1/1")
- << 1.0;
+ << qreal(1.0);
QTest::newRow("24/1")
- << 24.0;
+ << qreal(24.0);
QTest::newRow("15/2")
- << 7.5;
+ << qreal(7.5);
}
void tst_QVideoSurfaceFormat::frameRate()
@@ -583,7 +583,7 @@ void tst_QVideoSurfaceFormat::compare()
QCOMPARE(format1 == format2, false);
QCOMPARE(format1 != format2, true);
- format2.setFrameRate(7.50001);
+ format2.setFrameRate(qreal(7.50001));
// Equal.
QCOMPARE(format1 == format2, true);