diff options
author | Charles Yin <charles.yin@nokia.com> | 2011-07-25 14:27:52 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-28 10:04:08 +0200 |
commit | db6c099e42f96710f2ad09f6d3d2c94ffba600d7 (patch) | |
tree | 53738ebc9439e1de24f46b76d99600be421e2fc3 /tests/auto/declarative/qdeclarativesqldatabase | |
parent | 43d940fd30ea4728664de393479438f54e888b32 (diff) |
Fix bug 20505: Offline Storage API: wrong types of row fields
fields types should be returned as same as defined, not strings.
Change-Id: I9a0d03acb79850e93cc9266e2595ee61af2089a0
Task-number:QTBUG-20505
Reviewed-on: http://codereview.qt.nokia.com/2065
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativesqldatabase')
-rw-r--r-- | tests/auto/declarative/qdeclarativesqldatabase/data/selection.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js b/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js index f116efffd2..4ae40b105f 100644 --- a/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js +++ b/tests/auto/declarative/qdeclarativesqldatabase/data/selection.js @@ -7,6 +7,8 @@ function test() { 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')"); } ); @@ -21,6 +23,22 @@ function test() { 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; } |