summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-04 06:45:59 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-04 06:45:59 (GMT)
commitcf70be2c6a1f5633e7167f9953a384af9011f130 (patch)
tree71daf55cd19b3f14dc88dbd02ccccaa54552cf09 /tests/auto/declarative
parent510a85d350d4a5a538818af0f6b00c17cf081ea2 (diff)
parent898ccd0b94cf8c6b7fe3b33f85fb40ee7ea759b7 (diff)
downloadQt-cf70be2c6a1f5633e7167f9953a384af9011f130.zip
Qt-cf70be2c6a1f5633e7167f9953a384af9011f130.tar.gz
Qt-cf70be2c6a1f5633e7167f9953a384af9011f130.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp13
-rw-r--r--tests/auto/declarative/sql/data/error-outsidetransaction.js17
-rw-r--r--tests/auto/declarative/sql/tst_sql.cpp1
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index fb8bfb3..c3c7977 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -106,6 +106,7 @@ private slots:
void signalTriggeredBindings();
void listProperties();
void exceptionClearsOnReeval();
+ void exceptionProducesWarning();
void transientErrors();
void shutdownErrors();
void externalScript();
@@ -909,6 +910,18 @@ void tst_qmlecmascript::exceptionClearsOnReeval()
QCOMPARE(object->property("test").toBool(), true);
}
+void tst_qmlecmascript::exceptionProducesWarning()
+{
+ QmlComponent component(&engine, TEST_FILE("exceptionProducesWarning.qml"));
+ QString url = component.url().toString();
+
+ QString warning = "Expected error - QTBUG-6507";
+
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+}
+
static int transientErrorsMsgCount = 0;
static void transientErrorsMsgHandler(QtMsgType, const char *)
{
diff --git a/tests/auto/declarative/sql/data/error-outsidetransaction.js b/tests/auto/declarative/sql/data/error-outsidetransaction.js
new file mode 100644
index 0000000..a7af3bd
--- /dev/null
+++ b/tests/auto/declarative/sql/data/error-outsidetransaction.js
@@ -0,0 +1,17 @@
+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/tst_sql.cpp b/tests/auto/declarative/sql/tst_sql.cpp
index 4296279..1e4e6f8 100644
--- a/tests/auto/declarative/sql/tst_sql.cpp
+++ b/tests/auto/declarative/sql/tst_sql.cpp
@@ -152,6 +152,7 @@ void tst_sql::testQml_data()
QTest::newRow("iteration-forwardonly") << "data/iteration-forwardonly.js";
QTest::newRow("error-a") << "data/error-a.js";
QTest::newRow("error-notransaction") << "data/error-notransaction.js";
+ QTest::newRow("error-outsidetransaction") << "data/error-outsidetransaction.js"; // reuse above
QTest::newRow("reopen1") << "data/reopen1.js";
QTest::newRow("reopen2") << "data/reopen2.js"; // re-uses above DB