diff options
author | Charles Yin <charles.yin@nokia.com> | 2012-04-19 13:50:39 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-20 08:05:15 +0200 |
commit | 644f469cfffb2eb433128ef273fd6d15dbd15de1 (patch) | |
tree | e7103d7c77949af23febf0e3b005b8ac8f167553 /tests/auto/qml/qqmlsqldatabase | |
parent | 04794c29cee0d97fb3b32e1c71a072e34ee37e9c (diff) |
Disable local storage if the standard data location is empty
Change-Id: I05ea7fa9521c807099b39e610f965a331e538f6e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlsqldatabase')
-rw-r--r-- | tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp index c1a8a63a4d..04fc5e1c7c 100644 --- a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp +++ b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp @@ -104,6 +104,8 @@ void removeRecursive(const QString& dirname) void tst_qqmlsqldatabase::initTestCase() { + if (engine->offlineStoragePath().isEmpty()) + QSKIP("offlineStoragePath is empty, skip this test."); QQmlDataTest::initTestCase(); removeRecursive(dbDir()); QDir().mkpath(dbDir()); @@ -111,6 +113,8 @@ void tst_qqmlsqldatabase::initTestCase() void tst_qqmlsqldatabase::cleanupTestCase() { + if (engine->offlineStoragePath().isEmpty()) + QSKIP("offlineStoragePath is empty, skip this test."); removeRecursive(dbDir()); } @@ -123,6 +127,9 @@ QString tst_qqmlsqldatabase::dbDir() const void tst_qqmlsqldatabase::checkDatabasePath() { + if (engine->offlineStoragePath().isEmpty()) + QSKIP("offlineStoragePath is empty, skip this test."); + // Check default storage path (we can't use it since we don't want to mess with user's data) QVERIFY(engine->offlineStoragePath().contains("tst_qqmlsqldatabase")); QVERIFY(engine->offlineStoragePath().contains("OfflineStorage")); @@ -193,6 +200,9 @@ void tst_qqmlsqldatabase::validateAgainstWebkit() void tst_qqmlsqldatabase::testQml() { + if (engine->offlineStoragePath().isEmpty()) + QSKIP("offlineStoragePath is empty, skip this test."); + // Tests QML SQL Database support with tests // that have been validated against Webkit. // @@ -222,6 +232,9 @@ void tst_qqmlsqldatabase::testQml_cleanopen_data() void tst_qqmlsqldatabase::testQml_cleanopen() { + if (engine->offlineStoragePath().isEmpty()) + QSKIP("offlineStoragePath is empty, skip this test."); + // Same as testQml, but clean connections between tests, // making it more like the tests are running in new processes. testQml(); @@ -235,6 +248,9 @@ void tst_qqmlsqldatabase::testQml_cleanopen() void tst_qqmlsqldatabase::totalDatabases() { + if (engine->offlineStoragePath().isEmpty()) + QSKIP("offlineStoragePath is empty, skip this test."); + QCOMPARE(QDir(dbDir()+"/Databases").entryInfoList(QDir::Files|QDir::NoDotAndDotDot).count(), total_databases_created_by_tests*2); } |