summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-20 07:59:36 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-20 07:59:36 (GMT)
commitc80effb4d3612b68b2d48e3ec6245e2360c83228 (patch)
treef9aa3798f4e67110c492c6a14772d3d976216c1c /tests/auto/declarative/sql
parent1b6bccf66f493844d940a9ea3353aa3ee308fc3d (diff)
downloadQt-c80effb4d3612b68b2d48e3ec6245e2360c83228.zip
Qt-c80effb4d3612b68b2d48e3ec6245e2360c83228.tar.gz
Qt-c80effb4d3612b68b2d48e3ec6245e2360c83228.tar.bz2
Test version mismatch checking
Diffstat (limited to 'tests/auto/declarative/sql')
-rw-r--r--tests/auto/declarative/sql/data/error-creation.js12
-rw-r--r--tests/auto/declarative/sql/tst_sql.cpp5
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/declarative/sql/data/error-creation.js b/tests/auto/declarative/sql/data/error-creation.js
new file mode 100644
index 0000000..92245fd
--- /dev/null
+++ b/tests/auto/declarative/sql/data/error-creation.js
@@ -0,0 +1,12 @@
+function test() {
+ var r="transaction_not_finished";
+ try {
+ var db = openDatabaseSync("QmlTestDB-creation", "2.0", "Test database from Qt autotests", 1000000);
+ } catch (err) {
+ if (err.message == "SQL: database version mismatch")
+ r = "passed";
+ else
+ r = "WRONG ERROR="+err.message;
+ }
+ return r;
+}
diff --git a/tests/auto/declarative/sql/tst_sql.cpp b/tests/auto/declarative/sql/tst_sql.cpp
index 6fd4189..4296279 100644
--- a/tests/auto/declarative/sql/tst_sql.cpp
+++ b/tests/auto/declarative/sql/tst_sql.cpp
@@ -141,6 +141,8 @@ void tst_sql::testQml_data()
// Each test should use a newly named DB to avoid inter-test dependencies
QTest::newRow("creation") << "data/creation.js";
QTest::newRow("creation-a") << "data/creation-a.js";
+ QTest::newRow("creation") << "data/creation.js";
+ QTest::newRow("error-creation") << "data/error-creation.js"; // re-uses above DB
QTest::newRow("changeversion") << "data/changeversion.js";
QTest::newRow("readonly") << "data/readonly.js";
QTest::newRow("readonly-error") << "data/readonly-error.js";
@@ -151,7 +153,7 @@ void tst_sql::testQml_data()
QTest::newRow("error-a") << "data/error-a.js";
QTest::newRow("error-notransaction") << "data/error-notransaction.js";
QTest::newRow("reopen1") << "data/reopen1.js";
- QTest::newRow("reopen2") << "data/reopen2.js";
+ QTest::newRow("reopen2") << "data/reopen2.js"; // re-uses above DB
// If you add a test, you should usually use a new database in the
// test - in which case increment total_databases_created_by_tests above.
@@ -208,6 +210,7 @@ void tst_sql::testQml_cleanopen_data()
QTest::addColumn<QString>("jsfile"); // The input file
QTest::newRow("reopen1") << "data/reopen1.js";
QTest::newRow("reopen2") << "data/reopen2.js";
+ QTest::newRow("error-creation") << "data/error-creation.js"; // re-uses creation DB
}
void tst_sql::testQml_cleanopen()