diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-01-25 14:14:05 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-07-04 03:04:15 +0000 |
commit | 6c64a9b2d29d5de054d1d8ccec2050c28767c10c (patch) | |
tree | 097da82dfcf980d19911ba86b56a1b025dfa23d2 /tests/auto/corelib/kernel/qmetatype | |
parent | 71e41d7230650e4b25cfe0f2ac8e3c87e8e4119e (diff) |
Metatype: make the Qt CBOR value-like types built-in meta types
This change only adds them to the registry and reserves the IDs. The
next commit will handle conversions.
Change-Id: I56b444f9d6274221a3b7fffd150d2d49f40940c2
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qmetatype')
-rw-r--r-- | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 3 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index e312199980..73618db3f4 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -1574,6 +1574,9 @@ DECLARE_NONSTREAMABLE(QJsonValue) DECLARE_NONSTREAMABLE(QJsonObject) DECLARE_NONSTREAMABLE(QJsonArray) DECLARE_NONSTREAMABLE(QJsonDocument) +DECLARE_NONSTREAMABLE(QCborValue) +DECLARE_NONSTREAMABLE(QCborArray) +DECLARE_NONSTREAMABLE(QCborMap) DECLARE_NONSTREAMABLE(QObject*) DECLARE_NONSTREAMABLE(QWidget*) diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h index 93ff33bb67..6bda9638f7 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h @@ -273,6 +273,24 @@ template<> struct TestValueFactory<QMetaType::QJsonDocument> { ); } }; + +template<> struct TestValueFactory<QMetaType::QCborSimpleType> { + static QCborSimpleType *create() { return new QCborSimpleType(QCborSimpleType::True); } +}; +template<> struct TestValueFactory<QMetaType::QCborValue> { + static QCborValue *create() { return new QCborValue(123.); } +}; +template<> struct TestValueFactory<QMetaType::QCborMap> { + static QCborMap *create() { + return new QCborMap{{0, 0}, {"Hello", 1}, {1, nullptr}}; + } +}; +template<> struct TestValueFactory<QMetaType::QCborArray> { + static QCborArray *create() { + return new QCborArray{0, 1, -2, 2.5, false, nullptr, "Hello", QByteArray("World") }; + } +}; + template<> struct TestValueFactory<QMetaType::QVariant> { static QVariant *create() { return new QVariant(QStringList(QStringList() << "Q" << "t")); } }; |