diff options
Diffstat (limited to 'tests/auto/dbus/qdbusmarshall/common.h')
-rw-r--r-- | tests/auto/dbus/qdbusmarshall/common.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/auto/dbus/qdbusmarshall/common.h b/tests/auto/dbus/qdbusmarshall/common.h index 6ae3de6676..9a7c1e1553 100644 --- a/tests/auto/dbus/qdbusmarshall/common.h +++ b/tests/auto/dbus/qdbusmarshall/common.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGlobal> #include <QMap> @@ -152,7 +152,9 @@ void commonInit() qDBusRegisterMetaType<QMap<QDBusObjectPath, QString> >(); qDBusRegisterMetaType<QMap<qlonglong, QDateTime> >(); qDBusRegisterMetaType<QMap<QDBusSignature, QString> >(); + qDBusRegisterMetaType<QMap<QString, std::pair<int, int>>>(); + qDBusRegisterMetaType<std::pair<int, int>>(); qDBusRegisterMetaType<MyStruct>(); qDBusRegisterMetaType<MyVariantMapStruct>(); qDBusRegisterMetaType<QList<MyVariantMapStruct> >(); @@ -206,15 +208,17 @@ inline const char* mapName(const PropertyMap&) QString printable(const QDBusIntrospection::Method& m) { QString result = "method " + m.name + "("; - foreach (QDBusIntrospection::Argument arg, m.inputArgs) + for (QDBusIntrospection::Argument arg : m.inputArgs) { result += QString("in %1 %2, ") .arg(arg.type, arg.name); - foreach (QDBusIntrospection::Argument arg, m.outputArgs) + } + for (QDBusIntrospection::Argument arg : m.outputArgs) { result += QString("out %1 %2, ") .arg(arg.type, arg.name); + } AnnotationsMap::const_iterator it = m.annotations.begin(); for ( ; it != m.annotations.end(); ++it) - result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value()); + result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value().value); result += ")"; return result; @@ -223,12 +227,13 @@ QString printable(const QDBusIntrospection::Method& m) QString printable(const QDBusIntrospection::Signal& s) { QString result = "signal " + s.name + "("; - foreach (QDBusIntrospection::Argument arg, s.outputArgs) + for (QDBusIntrospection::Argument arg : s.outputArgs) { result += QString("out %1 %2, ") .arg(arg.type, arg.name); + } AnnotationsMap::const_iterator it = s.annotations.begin(); for ( ; it != s.annotations.end(); ++it) - result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value()); + result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value().value); result += ")"; return result; @@ -247,7 +252,7 @@ QString printable(const QDBusIntrospection::Property& p) AnnotationsMap::const_iterator it = p.annotations.begin(); for ( ; it != p.annotations.end(); ++it) - result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value()); + result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value().value); return result; } @@ -334,7 +339,7 @@ bool compare(const QDBusVariant &s1, const QDBusVariant &s2) template<typename T> bool compare(const QList<T> &l1, const QList<T> &l2) { - if (l1.count() != l2.count()) + if (l1.size() != l2.size()) return false; typename QList<T>::ConstIterator it1 = l1.constBegin(); @@ -349,7 +354,7 @@ bool compare(const QList<T> &l1, const QList<T> &l2) template<typename Key, typename T> bool compare(const QMap<Key, T> &m1, const QMap<Key, T> &m2) { - if (m1.count() != m2.size()) + if (m1.size() != m2.size()) return false; typename QMap<Key, T>::ConstIterator i1 = m1.constBegin(); typename QMap<Key, T>::ConstIterator end = m1.constEnd(); @@ -468,6 +473,8 @@ bool compareToArgument(const QDBusArgument &arg, const QVariant &v2) return compare<QMap<qlonglong, QDateTime> >(arg, v2); else if (id == qMetaTypeId<QMap<QDBusSignature, QString> >()) return compare<QMap<QDBusSignature, QString> >(arg, v2); + else if (id == qMetaTypeId<QMap<QString, std::pair<int, int>>>()) + return compare<QMap<QString, std::pair<int, int>>>(arg, v2); else if (id == qMetaTypeId<QList<QByteArray> >()) return compare<QList<QByteArray> >(arg, v2); |