summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmetatype
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-03-02 11:03:12 +0100
committerOlivier Goffart <ogoffart@trolltech.com>2010-03-02 14:22:45 +0100
commit03daf059647c0a0222e8774b0a083f58c8e64934 (patch)
tree62f7bda5a497c508d98598a4ae4ef8d2fd0157c9 /tests/auto/qmetatype
parenta140e37fab6a1d028fd1b751a98774dacb4f1a89 (diff)
QMetaType: Now we can register typedefs.
Task-number: QTBUG-6833 Task-number: QTBUG-937 Reviewed-by: Brad Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/qmetatype')
-rw-r--r--tests/auto/qmetatype/tst_qmetatype.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/auto/qmetatype/tst_qmetatype.cpp b/tests/auto/qmetatype/tst_qmetatype.cpp
index 943b05b3ca..f4e122f3c4 100644
--- a/tests/auto/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/qmetatype/tst_qmetatype.cpp
@@ -241,6 +241,9 @@ void tst_QMetaType::construct()
QMetaType::destroy(QMetaType::QSize, size);
}
+typedef QString CustomString;
+Q_DECLARE_METATYPE(CustomString) //this line is useless
+
void tst_QMetaType::typedefs()
{
QCOMPARE(QMetaType::type("long long"), int(QMetaType::LongLong));
@@ -256,6 +259,13 @@ void tst_QMetaType::typedefs()
// make sure the qreal typeId is the type id of the type it's defined to
QCOMPARE(QMetaType::type("qreal"), ::qMetaTypeId<qreal>());
+
+ qRegisterMetaType<CustomString>("CustomString");
+ QCOMPARE(QMetaType::type("CustomString"), ::qMetaTypeId<CustomString>());
+
+ typedef Whity<double> WhityDouble;
+ qRegisterMetaType<WhityDouble>("WhityDouble");
+ QCOMPARE(QMetaType::type("WhityDouble"), ::qMetaTypeId<WhityDouble>());
}
class IsRegisteredDummyType { };
@@ -286,9 +296,9 @@ void tst_QMetaType::isRegistered()
QCOMPARE(QMetaType::isRegistered(typeId), registered);
}
-class RegUnreg
+class RegUnreg
{
-public:
+public:
RegUnreg() {};
RegUnreg(const RegUnreg &) {};
~RegUnreg() {};