summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql/data/error-outsidetransaction.js
blob: a7af3bddbc7244800cdcd10f3a62d2340b7a23af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
}