summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-06 02:16:48 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-06 02:16:48 (GMT)
commit47db21ecd772a980e0a4a5f91c63cdffafdff8c0 (patch)
treeb4ded96de3be27e7b73baaf04c0955a85d3c47f4 /tests
parent8ca8d4b8b234d6d57e9f963d3c1e7f7522bcaf98 (diff)
downloadQt-47db21ecd772a980e0a4a5f91c63cdffafdff8c0.zip
Qt-47db21ecd772a980e0a4a5f91c63cdffafdff8c0.tar.gz
Qt-47db21ecd772a980e0a4a5f91c63cdffafdff8c0.tar.bz2
Use QDesktopServices::storageLocation() in place of placeform-specific code.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/sql/tst_sql.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/auto/declarative/sql/tst_sql.cpp b/tests/auto/declarative/sql/tst_sql.cpp
index 10ce6d8..22e9ba4 100644
--- a/tests/auto/declarative/sql/tst_sql.cpp
+++ b/tests/auto/declarative/sql/tst_sql.cpp
@@ -14,7 +14,18 @@ class tst_sql : public QObject
{
Q_OBJECT
public:
- tst_sql() {}
+ tst_sql()
+ {
+ qApp->setApplicationName("tst_sql");
+ qApp->setOrganizationName("Nokia");
+ qApp->setOrganizationDomain("nokia.com");
+ engine = new QmlEngine;
+ }
+
+ ~tst_sql()
+ {
+ delete engine;
+ }
private slots:
void initTestCase();
@@ -31,7 +42,7 @@ private slots:
private:
QString dbDir() const;
- QmlEngine engine;
+ QmlEngine *engine;
};
class QWebPageWithJavaScriptConsoleMessages : public QWebPage {
@@ -67,14 +78,16 @@ void tst_sql::cleanupTestCase()
QString tst_sql::dbDir() const
{
- return QString(SRCDIR)+"/output";
+ static QString tmpd = QDir::tempPath()+"/tst_sql_output-"
+ + QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddhhmmss"));
+ return tmpd;
}
void tst_sql::checkDatabasePath()
{
// Check default storage path (we can't use it since we don't want to mess with user's data)
- QVERIFY(engine.offlineStoragePath().contains("Nokia"));
- QVERIFY(engine.offlineStoragePath().contains("OfflineStorage"));
+ QVERIFY(engine->offlineStoragePath().contains("Nokia"));
+ QVERIFY(engine->offlineStoragePath().contains("OfflineStorage"));
}
void tst_sql::testQml_data()
@@ -142,8 +155,8 @@ void tst_sql::testQml()
"import Qt 4.6\n"
"Text { Script { source: \""+jsfile+"\" } text: test() }";
- engine.setOfflineStoragePath(dbDir());
- QmlComponent component(&engine, qml.toUtf8(), QUrl::fromLocalFile(SRCDIR "/empty.qml")); // just a file for relative local imports
+ engine->setOfflineStoragePath(dbDir());
+ QmlComponent component(engine, qml.toUtf8(), QUrl::fromLocalFile(SRCDIR "/empty.qml")); // just a file for relative local imports
QFxText *text = qobject_cast<QFxText*>(component.create());
QVERIFY(text != 0);
QCOMPARE(text->text(),result);