summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-08-31 04:59:26 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-08-31 04:59:26 (GMT)
commit0a3d5098320a72853bad643f01b08774af131cb4 (patch)
tree47a2db1e5c7433cd29c0418169a39aea50822776 /tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
parenta0b413c14b94c1ac3f394f22076fd12c370d07f3 (diff)
downloadQt-0a3d5098320a72853bad643f01b08774af131cb4.zip
Qt-0a3d5098320a72853bad643f01b08774af131cb4.tar.gz
Qt-0a3d5098320a72853bad643f01b08774af131cb4.tar.bz2
Don't double call classBegin()
QTBUG-13114
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index fcdf926..b43fbf4 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -126,6 +126,7 @@ private slots:
void scriptString();
void defaultPropertyListOrder();
void declaredPropertyValues();
+ void dontDoubleCallClassBegin();
void basicRemote_data();
void basicRemote();
@@ -1192,6 +1193,20 @@ void tst_qdeclarativelanguage::declaredPropertyValues()
VERIFY_ERRORS(0);
}
+void tst_qdeclarativelanguage::dontDoubleCallClassBegin()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("dontDoubleCallClassBegin.qml"));
+ QObject *o = component.create();
+ QVERIFY(o);
+
+ MyParserStatus *o2 = qobject_cast<MyParserStatus *>(qvariant_cast<QObject *>(o->property("object")));
+ QVERIFY(o2);
+ QCOMPARE(o2->classBeginCount(), 1);
+ QCOMPARE(o2->componentCompleteCount(), 1);
+
+ delete o;
+}
+
// Check that first child of qml is of given type. Empty type insists on error.
void tst_qdeclarativelanguage::testType(const QString& qml, const QString& type, const QString& expectederror)
{