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/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.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/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp b/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp index 1a6b08cb79..750d3ba715 100644 --- a/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp +++ b/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp @@ -55,7 +55,7 @@ #include <QtCore/qfile.h> #include "../../shared/util.h" -class tst_qdeclarativesqldatabase : public QObject +class tst_qdeclarativesqldatabase : public QDeclarativeDataTest { Q_OBJECT public: @@ -104,6 +104,7 @@ void removeRecursive(const QString& dirname) void tst_qdeclarativesqldatabase::initTestCase() { + QDeclarativeDataTest::initTestCase(); removeRecursive(dbDir()); QDir().mkpath(dbDir()); } @@ -204,7 +205,7 @@ void tst_qdeclarativesqldatabase::testQml() engine->setOfflineStoragePath(dbDir()); QDeclarativeComponent component(engine); - component.setData(qml.toUtf8(), QUrl::fromLocalFile(TESTDATA("empty.qml"))); // just a file for relative local imports + component.setData(qml.toUtf8(), testFileUrl("empty.qml")); // just a file for relative local imports QVERIFY(!component.isError()); QQuickText *text = qobject_cast<QQuickText*>(component.create()); QVERIFY(text != 0); |