summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql/data
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-17 03:55:35 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-17 03:55:35 (GMT)
commitf7a1e0a2ca7eec54966fb4c0d14ffa5e93731194 (patch)
treeb9bacdb9a9c25c2cb83a469231699fa6f8893a2e /tests/auto/declarative/sql/data
parentf1efdb342224cfb1e22b55ae4c704635edbbf46a (diff)
downloadQt-f7a1e0a2ca7eec54966fb4c0d14ffa5e93731194.zip
Qt-f7a1e0a2ca7eec54966fb4c0d14ffa5e93731194.tar.gz
Qt-f7a1e0a2ca7eec54966fb4c0d14ffa5e93731194.tar.bz2
test more
Diffstat (limited to 'tests/auto/declarative/sql/data')
-rw-r--r--tests/auto/declarative/sql/data/2-selection-bindnames.js24
-rw-r--r--tests/auto/declarative/sql/data/6-iteration-efficient.js6
2 files changed, 29 insertions, 1 deletions
diff --git a/tests/auto/declarative/sql/data/2-selection-bindnames.js b/tests/auto/declarative/sql/data/2-selection-bindnames.js
new file mode 100644
index 0000000..c00acc14
--- /dev/null
+++ b/tests/auto/declarative/sql/data/2-selection-bindnames.js
@@ -0,0 +1,24 @@
+var db = openDatabase("QmlTestDB", "", "Test database from Qt autotests", 1000000);
+var r=0;
+
+db.transaction(
+ function(tx) {
+ tx.executeSql('SELECT * FROM Greeting WHERE salutation=:p2 AND salutee=:p1', {':p1':'world', ':p2':'hello'},
+ function(tx, rs) {
+ if ( rs.rows.length != 4 ) {
+ if (r==0) r = "SELECT RETURNED WRONG VALUE "+rs.rows.length+rs.rows.item(0)+rs.rows.item(1)
+ }
+ },
+ 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" }
+);
+
+
+function test()
+{
+ if (r == 0) r = "transaction_not_finished";
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/6-iteration-efficient.js b/tests/auto/declarative/sql/data/6-iteration-efficient.js
index 2222b8a..6711fb0 100644
--- a/tests/auto/declarative/sql/data/6-iteration-efficient.js
+++ b/tests/auto/declarative/sql/data/6-iteration-efficient.js
@@ -1,12 +1,16 @@
var db = openDatabase("QmlTestDB", "", "Test database from Qt autotests", 1000000);
var r=0;
+var fbefore="FORWARD WRONG"
+var fafter="FORWARD WRONG"
db.transaction(
function(tx) {
tx.executeSql('SELECT * FROM Greeting', [],
function(tx, rs) {
var r1=""
+ if (!rs.rows.forwardOnly) fbefore=""
rs.rows.forwardOnly = true;
+ if (rs.rows.forwardOnly) fafter="";
for(var i=0; rs.rows[i]; ++i) {
r1 += rs.rows[i].salutation + ", " + rs.rows[i].salutee + ";"
}
@@ -17,7 +21,7 @@ db.transaction(
);
},
function(tx, error) { if (r==0) r="TRANSACTION FAILED: "+error.message },
- function(tx, result) { if (r==0) r="passed" }
+ function(tx, result) { if (r==0) r=fbefore+"passed"+fafter }
);