summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql/data
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-04-14 04:53:13 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-04-15 04:48:55 (GMT)
commit35afac3d3a275aa69c74e174cfeb5e411816e94a (patch)
tree533d0c13a2bb52eaf914aedce87e4076dedd6635 /tests/auto/declarative/sql/data
parentfa93b3fb3956f77f36c520e41b0c5065e51a56ce (diff)
downloadQt-35afac3d3a275aa69c74e174cfeb5e411816e94a.zip
Qt-35afac3d3a275aa69c74e174cfeb5e411816e94a.tar.gz
Qt-35afac3d3a275aa69c74e174cfeb5e411816e94a.tar.bz2
Rename "sql" test so autotester doesn't get confused.
Diffstat (limited to 'tests/auto/declarative/sql/data')
-rw-r--r--tests/auto/declarative/sql/data/README3
-rw-r--r--tests/auto/declarative/sql/data/changeversion.js53
-rw-r--r--tests/auto/declarative/sql/data/creation-a.js18
-rw-r--r--tests/auto/declarative/sql/data/creation.js14
-rw-r--r--tests/auto/declarative/sql/data/error-a.js20
-rw-r--r--tests/auto/declarative/sql/data/error-b.js13
-rw-r--r--tests/auto/declarative/sql/data/error-creation.js14
-rw-r--r--tests/auto/declarative/sql/data/error-notransaction.js15
-rw-r--r--tests/auto/declarative/sql/data/error-outsidetransaction.js17
-rw-r--r--tests/auto/declarative/sql/data/iteration-forwardonly.js29
-rw-r--r--tests/auto/declarative/sql/data/iteration.js28
-rw-r--r--tests/auto/declarative/sql/data/readonly-error.js27
-rw-r--r--tests/auto/declarative/sql/data/readonly.js24
-rw-r--r--tests/auto/declarative/sql/data/reopen1.js14
-rw-r--r--tests/auto/declarative/sql/data/reopen2.js16
-rw-r--r--tests/auto/declarative/sql/data/selection-bindnames.js26
-rw-r--r--tests/auto/declarative/sql/data/selection.js26
17 files changed, 0 insertions, 357 deletions
diff --git a/tests/auto/declarative/sql/data/README b/tests/auto/declarative/sql/data/README
deleted file mode 100644
index 7efca3a..0000000
--- a/tests/auto/declarative/sql/data/README
+++ /dev/null
@@ -1,3 +0,0 @@
-These tests are executed in sequence - the database persist until the end of the
-testing. This is done to better exercise the persistence of the database, since
-that is how it is used.
diff --git a/tests/auto/declarative/sql/data/changeversion.js b/tests/auto/declarative/sql/data/changeversion.js
deleted file mode 100644
index 680d7a6..0000000
--- a/tests/auto/declarative/sql/data/changeversion.js
+++ /dev/null
@@ -1,53 +0,0 @@
-function test() {
- var r="transaction_not_finished";
-
- var db = openDatabaseSync("QmlTestDB-changeversion", "", "Test database from Qt autotests", 1000000,
- function(db) {
- db.changeVersion("","1.0")
- db.transaction(function(tx){
- tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
- })
- });
-
- db.transaction(function(tx){
- tx.executeSql('INSERT INTO Greeting VALUES ("Hello", "world")');
- tx.executeSql('INSERT INTO Greeting VALUES ("Goodbye", "cruel world")');
- });
-
-
- db = openDatabaseSync("QmlTestDB-changeversion", "", "Test database from Qt autotests", 1000000);
-
- if (db.version == "1.0")
- db.changeVersion("1.0","2.0",function(tx)
- {
- tx.executeSql('CREATE TABLE Utterance(type TEXT, phrase TEXT)')
- var rs = tx.executeSql('SELECT * FROM Greeting');
- for (var i=0; i<rs.rows.length; ++i) {
- var type = "Greeting";
- var phrase = rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee;
- if (rs.rows.item(i).salutation == "Goodbye"
- || rs.rows.item(i).salutation == "Farewell"
- || rs.rows.item(i).salutation == "Good-bye") type = "Valediction";
- var ins = tx.executeSql('INSERT INTO Utterance VALUES(?,?)',[type,phrase]);
- }
- tx.executeSql('DROP TABLE Greeting');
- });
- else
- return "db.version should be 1.0, but is " + db.version;
-
- var db = openDatabaseSync("QmlTestDB-changeversion", "2.0", "Test database from Qt autotests", 1000000);
-
- db.transaction(function(tx){
- var rs = tx.executeSql('SELECT * FROM Utterance');
- r = ""
- for (var i=0; i<rs.rows.length; ++i) {
- r += "(" + rs.rows.item(i).type + ": " + rs.rows.item(i).phrase + ")";
- }
- if (r == "(Greeting: Hello, world)(Valediction: Goodbye, cruel world)")
- r = "passed"
- else
- r = "WRONG DATA: " + r;
- })
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/creation-a.js b/tests/auto/declarative/sql/data/creation-a.js
deleted file mode 100644
index bd7d5c5..0000000
--- a/tests/auto/declarative/sql/data/creation-a.js
+++ /dev/null
@@ -1,18 +0,0 @@
-function test() {
- var r="transaction_not_finished";
-
- var db = openDatabaseSync("QmlTestDB-creation-a", "1.0", "Test database from Qt autotests", 1000000,
- function(db) {
- db.transaction(function(tx){
- tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
- r = "passed";
- })
- });
-
- var db = openDatabaseSync("QmlTestDB-creation-a", "1.0", "Test database from Qt autotests", 1000000,
- function(db) {
- r = "FAILED: should have already been created";
- });
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/creation.js b/tests/auto/declarative/sql/data/creation.js
deleted file mode 100644
index 317b4c1..0000000
--- a/tests/auto/declarative/sql/data/creation.js
+++ /dev/null
@@ -1,14 +0,0 @@
-function test() {
- var r="transaction_not_finished";
- var db = openDatabaseSync("QmlTestDB-creation", "1.0", "Test database from Qt autotests", 1000000);
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/error-a.js b/tests/auto/declarative/sql/data/error-a.js
deleted file mode 100644
index 10a23f6..0000000
--- a/tests/auto/declarative/sql/data/error-a.js
+++ /dev/null
@@ -1,20 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB-error-a", "1.0", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- try {
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM NotExists');
- r = "SHOULD NOT SUCCEED";
- }
- );
- } catch (err) {
- if (err.message == "no such table: NotExists Unable to execute statement")
- r = "passed";
- else
- r = "WRONG ERROR="+err.message;
- }
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/error-b.js b/tests/auto/declarative/sql/data/error-b.js
deleted file mode 100644
index 4dd0ecf..0000000
--- a/tests/auto/declarative/sql/data/error-b.js
+++ /dev/null
@@ -1,13 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB-error-b", "1.0", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- tx.executeSql('INSERT INTO Greeting VALUES("junk","junk")');
- notexist[123] = "oops"
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/error-creation.js b/tests/auto/declarative/sql/data/error-creation.js
deleted file mode 100644
index 0ab2a35..0000000
--- a/tests/auto/declarative/sql/data/error-creation.js
+++ /dev/null
@@ -1,14 +0,0 @@
-function test() {
- var r="transaction_not_finished";
- try {
- var db = openDatabaseSync("QmlTestDB-creation", "2.0", "Test database from Qt autotests", 1000000);
- } catch (err) {
- if (err.code != SQLException.VERSION_ERR)
- r = "WRONG ERROR CODE="+err.code;
- else if (err.message != "SQL: database version mismatch")
- r = "WRONG ERROR="+err.message;
- else
- r = "passed";
- }
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/error-notransaction.js b/tests/auto/declarative/sql/data/error-notransaction.js
deleted file mode 100644
index b9cc647..0000000
--- a/tests/auto/declarative/sql/data/error-notransaction.js
+++ /dev/null
@@ -1,15 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB-data/error-notransaction", "1.0", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- try {
- db.transaction();
- } catch (err) {
- if (err.message == "transaction: missing callback")
- r = "passed";
- else
- r = "WRONG ERROR="+err.message;
- }
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/error-outsidetransaction.js b/tests/auto/declarative/sql/data/error-outsidetransaction.js
deleted file mode 100644
index a7af3bd..0000000
--- a/tests/auto/declarative/sql/data/error-outsidetransaction.js
+++ /dev/null
@@ -1,17 +0,0 @@
-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;
-}
diff --git a/tests/auto/declarative/sql/data/iteration-forwardonly.js b/tests/auto/declarative/sql/data/iteration-forwardonly.js
deleted file mode 100644
index 45947c0..0000000
--- a/tests/auto/declarative/sql/data/iteration-forwardonly.js
+++ /dev/null
@@ -1,29 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB-iteration-forwardonly", "", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
- tx.executeSql('INSERT INTO Greeting VALUES ("Hello", "world")');
- tx.executeSql('INSERT INTO Greeting VALUES ("Goodbye", "cruel world")');
- }
- )
-
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting');
- rs.forwardOnly = !rs.forwardOnly
- 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;")
- if (r1 != "Hello, world;Goodbye, cruel world;")
- r = "SELECTED DATA WRONG: "+r1;
- else
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/iteration.js b/tests/auto/declarative/sql/data/iteration.js
deleted file mode 100644
index c34cbbb..0000000
--- a/tests/auto/declarative/sql/data/iteration.js
+++ /dev/null
@@ -1,28 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB-iteration", "", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
- tx.executeSql('INSERT INTO Greeting VALUES ("Hello", "world")');
- tx.executeSql('INSERT INTO Greeting VALUES ("Goodbye", "cruel world")');
- }
- )
-
- 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;")
- if (r1 != "Hello, world;Goodbye, cruel world;")
- r = "SELECTED DATA WRONG: "+r1;
- else
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/readonly-error.js b/tests/auto/declarative/sql/data/readonly-error.js
deleted file mode 100644
index 69ec67f..0000000
--- a/tests/auto/declarative/sql/data/readonly-error.js
+++ /dev/null
@@ -1,27 +0,0 @@
-function test() {
- var r="transaction_not_finished";
- var db = openDatabaseSync("QmlTestDB-readonly-error", "1.0", "Test database from Qt autotests", 1000000);
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- }
- );
-
- try {
- db.readTransaction(
- function(tx) {
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- r = "FAILED";
- }
- );
- } catch (err) {
- if (err.message == "Read-only Transaction")
- r = "passed";
- else
- r = "WRONG ERROR="+err.message;
- }
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/readonly.js b/tests/auto/declarative/sql/data/readonly.js
deleted file mode 100644
index 5ee862c..0000000
--- a/tests/auto/declarative/sql/data/readonly.js
+++ /dev/null
@@ -1,24 +0,0 @@
-function test() {
- var r="transaction_not_finished";
- var db = openDatabaseSync("QmlTestDB-readonly", "1.0", "Test database from Qt autotests", 1000000);
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- r = "passed";
- }
- );
-
- db.readTransaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting');
- if (rs.rows.item(0).salutation == 'hello')
- r = "passed";
- else
- r = "FAILED";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/reopen1.js b/tests/auto/declarative/sql/data/reopen1.js
deleted file mode 100644
index c1a8157..0000000
--- a/tests/auto/declarative/sql/data/reopen1.js
+++ /dev/null
@@ -1,14 +0,0 @@
-function test() {
- var r="transaction_not_finished";
- var db = openDatabaseSync("QmlTestDB-reopen", "1.0", "Test database from Qt autotests", 1000000);
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/reopen2.js b/tests/auto/declarative/sql/data/reopen2.js
deleted file mode 100644
index 4f7248f..0000000
--- a/tests/auto/declarative/sql/data/reopen2.js
+++ /dev/null
@@ -1,16 +0,0 @@
-function test() {
- var r="transaction_not_finished";
- var db = openDatabaseSync("QmlTestDB-reopen", "1.0", "Test database from Qt autotests", 1000000);
-
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting');
- if (rs.rows.item(0).salutation == 'hello')
- r = "passed";
- else
- r = "FAILED";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/selection-bindnames.js b/tests/auto/declarative/sql/data/selection-bindnames.js
deleted file mode 100644
index 9786821..0000000
--- a/tests/auto/declarative/sql/data/selection-bindnames.js
+++ /dev/null
@@ -1,26 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB-bindnames", "", "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(?, ?)', [ 'goodbye', 'world' ]);
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'there' ]);
- }
- );
-
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting WHERE salutation=:p2 AND salutee=:p1', {':p1':'world', ':p2':'hello'});
- if ( rs.rows.length != 2 )
- r = "SELECT RETURNED WRONG VALUE "+rs.rows.length+rs.rows.item(0)+rs.rows.item(1)
- else
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/selection.js b/tests/auto/declarative/sql/data/selection.js
deleted file mode 100644
index f116eff..0000000
--- a/tests/auto/declarative/sql/data/selection.js
+++ /dev/null
@@ -1,26 +0,0 @@
-function test() {
- var db = 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' ]);
- }
- );
-
- 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";
- }
- );
-
- return r;
-}