summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-03-23 15:21:50 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-03-25 15:02:21 (GMT)
commit57909eb88ff571fba18459045bd0f8344b32247a (patch)
tree0e0e1b4b6db269c629c491a93efcf4672e82b46c
parent116fed06f9ed561befb505d94b6b44dc71bf9e45 (diff)
downloadQt-57909eb88ff571fba18459045bd0f8344b32247a.zip
Qt-57909eb88ff571fba18459045bd0f8344b32247a.tar.gz
Qt-57909eb88ff571fba18459045bd0f8344b32247a.tar.bz2
Add a test in QVariant for forward declared classes
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index 2e57264..6ebe84e 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -275,6 +275,8 @@ private slots:
void variantInVariant();
void colorInteger();
+
+ void forwardDeclare();
};
Q_DECLARE_METATYPE(QDate)
@@ -3439,5 +3441,16 @@ void tst_QVariant::colorInteger()
QCOMPARE(v.value<QColor>(), QColor(Qt::yellow));
}
+class Forward;
+Q_DECLARE_METATYPE(Forward*);
+
+void tst_QVariant::forwardDeclare()
+{
+ Forward *f = 0;
+ QVariant v = QVariant::fromValue(f);
+ QCOMPARE(qvariant_cast<Forward*>(v), f);
+}
+
+
QTEST_MAIN(tst_QVariant)
#include "tst_qvariant.moc"