aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlsqldatabase/data/error-creation.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlsqldatabase/data/error-creation.js')
-rw-r--r--tests/auto/qml/qqmlsqldatabase/data/error-creation.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlsqldatabase/data/error-creation.js b/tests/auto/qml/qqmlsqldatabase/data/error-creation.js
new file mode 100644
index 0000000000..d66977d1e2
--- /dev/null
+++ b/tests/auto/qml/qqmlsqldatabase/data/error-creation.js
@@ -0,0 +1,16 @@
+.import QtQuick.LocalStorage 2.0 as Sql
+
+function test() {
+ var r="transaction_not_finished";
+ try {
+ var db = Sql.openDatabaseSync("QmlTestDB-creation", "2.0", "Test database from Qt autotests", 1000000);
+ } catch (err) {
+ if (err.code != SQLException.VERSION_ERR)
+ r = "WRONG ERROR CODE="+err.code;
+ else if (err.message != "SQL: database version mismatch")
+ r = "WRONG ERROR="+err.message;
+ else
+ r = "passed";
+ }
+ return r;
+}