aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativesqldatabase/data/selection.js')
-rw-r--r--tests/auto/declarative/qdeclarativesqldatabase/data/selection.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js b/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js
deleted file mode 100644
index 18d4dce80f..0000000000
--- a/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js
+++ /dev/null
@@ -1,46 +0,0 @@
-.import QtQuick.LocalStorage 2.0 as Sql
-
-function test() {
- var db = Sql.openDatabaseSync("QmlTestDB-selection", "", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- tx.executeSql('CREATE TABLE IF NOT EXISTS TypeTest(num INTEGER, txt1 TEXT, txt2 TEXT)');
- tx.executeSql("INSERT INTO TypeTest VALUES(1, null, 'hello')");
- }
- );
-
- db.transaction(
- function(tx) {
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- var rs = tx.executeSql('SELECT * FROM Greeting');
- if ( rs.rows.length != 4 )
- r = "SELECT RETURNED WRONG VALUE "+rs.rows.length+rs.rows[0]+rs.rows[1]
- else
- r = "passed";
- }
- );
- if (r == "passed") {
- db.transaction(function (tx) {
- r = "";
- var firstRow = tx.executeSql("SELECT * FROM TypeTest").rows.item(0);
- if (typeof(firstRow.num) != "number")
- r += " num:" + firstRow.num+ "type:" + typeof(firstRow.num);
- if (typeof(firstRow.txt1) != "object" || firstRow.txt1 != null)
- r += " txt1:" + firstRow.txt1 + " type:" + typeof(firstRow.txt1);
- if (typeof(firstRow.txt2) != "string" || firstRow.txt2 != "hello")
- r += " txt2:" + firstRow.txt2 + " type:" + typeof(firstRow.txt2);
- if (r == "")
- r = "passed";
- else
- r = "SELECT RETURNED VALUES WITH WRONG TYPES " + r;
- });
- }
-
- return r;
-}