diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-12-21 09:06:26 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-21 15:35:22 +0100 |
commit | 8249c72213bc7d212c05aa086b3145a5742706a3 (patch) | |
tree | 4a34b97b0d57a05707c65b7328d5ab1bf4254920 /tests/auto/qtquick2/qquickscreen/tst_qquickscreen.cpp | |
parent | 3c211558f6b571555558bd1fc59774e36a6da710 (diff) |
QDeclarative tests: Introduce base class for data tests.
In tests/auto/shared/util.* replace macros/find functions by
a base class QDeclarativeDataTest with accessors for the
data directory helper functions to create URLs from it.
The class relies on QFINDTESTDATA, which is the standard
way of locating test data. Using the class should reduce
the number of calls to QFileInfo.exists(), etc significantly.
In addition, provide utility functions for messages.
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Change-Id: Id2beacb157922ee9412f9e45cf9695cec1f8379a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qquickscreen/tst_qquickscreen.cpp')
-rw-r--r-- | tests/auto/qtquick2/qquickscreen/tst_qquickscreen.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/tests/auto/qtquick2/qquickscreen/tst_qquickscreen.cpp b/tests/auto/qtquick2/qquickscreen/tst_qquickscreen.cpp index f74f2845e0..89462230bf 100644 --- a/tests/auto/qtquick2/qquickscreen/tst_qquickscreen.cpp +++ b/tests/auto/qtquick2/qquickscreen/tst_qquickscreen.cpp @@ -46,35 +46,17 @@ #include <QtGui/QScreen> #include "../../shared/util.h" -class tst_qquickscreen : public QObject +class tst_qquickscreen : public QDeclarativeDataTest { Q_OBJECT -public: - tst_qquickscreen (); - private slots: - void initTestCase(); - void cleanupTestCase(); - void basicProperties(); }; -tst_qquickscreen::tst_qquickscreen() -{ -} - -void tst_qquickscreen::initTestCase() -{ -} - -void tst_qquickscreen::cleanupTestCase() -{ -} - void tst_qquickscreen::basicProperties() { QQuickView view; - view.setSource(TESTDATA("screen.qml")); + view.setSource(testFileUrl("screen.qml")); view.show(); QTest::qWaitForWindowShown(&view); |