summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmetatype
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-06-09 10:04:50 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2010-06-11 14:32:22 +0200
commit9a16161889c7f6c15c4d5679148a28fe51f95abb (patch)
tree671eaeb57ebe611350e9e211dfc0c35ff40f0651 /tests/auto/qmetatype
parent3ff9474b8e3812f629869bc349ffb0a7f70c93a4 (diff)
QMetaType: do not crash when registering builtin stream operator
It is not required to register builtin operator, but old code might do so if a type was not builtin before. This is the case of QVariant which became builtin only in Qt 4.7 Task-number: QTBUG-11316 Reviewed-by: Gabriel
Diffstat (limited to 'tests/auto/qmetatype')
-rw-r--r--tests/auto/qmetatype/tst_qmetatype.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qmetatype/tst_qmetatype.cpp b/tests/auto/qmetatype/tst_qmetatype.cpp
index f4e122f3c4..8558e06f95 100644
--- a/tests/auto/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/qmetatype/tst_qmetatype.cpp
@@ -77,6 +77,7 @@ private slots:
void isRegistered_data();
void isRegistered();
void unregisterType();
+ void QTBUG11316_registerStreamBuiltin();
};
@@ -318,5 +319,12 @@ void tst_QMetaType::unregisterType()
QCOMPARE(QMetaType::isRegistered(typeId), false);
}
+void tst_QMetaType::QTBUG11316_registerStreamBuiltin()
+{
+ //should not crash;
+ qRegisterMetaTypeStreamOperators<QString>("QString");
+ qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
+}
+
QTEST_MAIN(tst_QMetaType)
#include "tst_qmetatype.moc"