summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql/data/3-iteration-item-function.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/sql/data/3-iteration-item-function.js')
-rw-r--r--tests/auto/declarative/sql/data/3-iteration-item-function.js38
1 files changed, 15 insertions, 23 deletions
diff --git a/tests/auto/declarative/sql/data/3-iteration-item-function.js b/tests/auto/declarative/sql/data/3-iteration-item-function.js
index bad9b82..57c8a17 100644
--- a/tests/auto/declarative/sql/data/3-iteration-item-function.js
+++ b/tests/auto/declarative/sql/data/3-iteration-item-function.js
@@ -1,27 +1,19 @@
-var db = openDatabase("QmlTestDB", "", "Test database from Qt autotests", 1000000);
-var r=0;
+function test() {
+ var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
+ var r="transaction_not_finished";
-db.transaction(
- function(tx) {
- tx.executeSql('SELECT * FROM Greeting', [],
- function(tx, rs) {
- var r1=""
- for(var i = 0; i < rs.rows.length; i++) {
- r1 += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + ";"
- }
- if (r1 != "hello, world;hello, world;hello, world;hello, world;")
- r = "SELECTED DATA WRONG: "+r1;
- },
- function(tx, error) { if (r==0) r="SELECT FAILED: "+error.message }
- );
- },
- function(tx, error) { if (r==0) r="TRANSACTION FAILED: "+error.message },
- function(tx, result) { if (r==0) r="passed" }
-);
+ db.transaction(
+ function(tx) {
+ var rs = tx.executeSql('SELECT * FROM Greeting');
+ var r1=""
+ for(var i = 0; i < rs.rows.length; i++)
+ r1 += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + ";"
+ if (r1 != "hello, world;hello, world;hello, world;hello, world;")
+ r = "SELECTED DATA WRONG: "+r1;
+ else
+ r = "passed";
+ }
+ );
-
-function test()
-{
- if (r == 0) r = "transaction_not_finished";
return r;
}