aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/testtypes.cpp
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-05-25 17:23:42 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-28 02:42:55 +0200
commitf62ab0a3dfaa873bb15cd1526f98f50a17228a9c (patch)
tree483c980f2d17eca24438e47e097bf1034d916daa /tests/auto/qml/qqmlecmascript/testtypes.cpp
parent1deba22774e59458dc2e485f1cdf8f5b547d2941 (diff)
Fix crash caused by unregistered enum types
If the enum type isn't registered with Q_ENUMS, the metatype lookup fails, which results in a crash in certain circumstances. This commit ensures that when assigning an undefined value to an unregistered-enum-type property, no crash occurs. Change-Id: I0b539b591c9c9d6262c748300e4f4b6813d4f9a6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/testtypes.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp
index d3eff3b0ad..fba6cb36e8 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.cpp
+++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp
@@ -226,6 +226,8 @@ void registerTypes()
qmlRegisterType<WriteCounter>("Qt.test", 1, 0, "WriteCounter");
qmlRegisterType<MySequenceConversionObject>("Qt.test", 1, 0, "MySequenceConversionObject");
+
+ qmlRegisterType<MyUnregisteredEnumTypeObject>("Qt.test", 1, 0, "MyUnregisteredEnumTypeObject");
}
#include "testtypes.moc"