summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql/data
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-12-04 04:53:08 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-12-04 04:53:08 (GMT)
commit80fe1a635d4bee97f5e6b15be34b59c7536ae54d (patch)
treec8ca810059a7b6c5b0619648c6708036340b6682 /tests/auto/declarative/sql/data
parent69d4e0a18f6efaf3d7660e4b708b9fcdb9a64250 (diff)
downloadQt-80fe1a635d4bee97f5e6b15be34b59c7536ae54d.zip
Qt-80fe1a635d4bee97f5e6b15be34b59c7536ae54d.tar.gz
Qt-80fe1a635d4bee97f5e6b15be34b59c7536ae54d.tar.bz2
Test for 69d4e0a18f6efaf3d7660e4b708b9fcdb9a64250
Diffstat (limited to 'tests/auto/declarative/sql/data')
-rw-r--r--tests/auto/declarative/sql/data/error-outsidetransaction.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/sql/data/error-outsidetransaction.js b/tests/auto/declarative/sql/data/error-outsidetransaction.js
new file mode 100644
index 0000000..a7af3bd
--- /dev/null
+++ b/tests/auto/declarative/sql/data/error-outsidetransaction.js
@@ -0,0 +1,17 @@
+function test() {
+ var db = openDatabaseSync("QmlTestDB-data/error-notransaction", "1.0", "Test database from Qt autotests", 1000000);
+ var r="transaction_not_finished";
+ var v;
+
+ try {
+ db.transaction(function(tx) { v = tx });
+ v.executeSql("SELECT 'bad'")
+ } catch (err) {
+ if (err.message == "executeSql called outside transaction()")
+ r = "passed";
+ else
+ r = "WRONG ERROR="+err.message;
+ }
+
+ return r;
+}