aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeexpression
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-11-08 11:27:04 +0000
committerQt by Nokia <qt-info@nokia.com>2011-11-08 13:49:28 +0100
commit769d8ca7167cb108d82d3afbbd1cdfec23716375 (patch)
treee9dfc6c5e6453e36930fe21f8730fe441fb32911 /tests/auto/declarative/qdeclarativeexpression
parente74adbb87dc099f217ff89806e55bef41c4fac86 (diff)
Don't crash on invalid expression
Task-number: QTBUG-21310 Change-Id: I93de1c520b6f1c2aa3842e1091bcf2b34d9b0420 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeexpression')
-rw-r--r--tests/auto/declarative/qdeclarativeexpression/tst_qdeclarativeexpression.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeexpression/tst_qdeclarativeexpression.cpp b/tests/auto/declarative/qdeclarativeexpression/tst_qdeclarativeexpression.cpp
index a05c06f23f..a65045b48f 100644
--- a/tests/auto/declarative/qdeclarativeexpression/tst_qdeclarativeexpression.cpp
+++ b/tests/auto/declarative/qdeclarativeexpression/tst_qdeclarativeexpression.cpp
@@ -54,6 +54,7 @@ public:
private slots:
void scriptString();
+ void syntaxError();
};
class TestObject : public QObject
@@ -106,6 +107,15 @@ void tst_qdeclarativeexpression::scriptString()
QCOMPARE(error.line(), 8);
}
+// QTBUG-21310 - crash test
+void tst_qdeclarativeexpression::syntaxError()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeExpression expression(engine.rootContext(), 0, "asd asd");
+ QVariant v = expression.evaluate();
+ QCOMPARE(v, QVariant());
+}
+
QTEST_MAIN(tst_qdeclarativeexpression)
#include "tst_qdeclarativeexpression.moc"