diff options
Diffstat (limited to 'tests/utils/qt-fixture.h')
-rw-r--r-- | tests/utils/qt-fixture.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/utils/qt-fixture.h b/tests/utils/qt-fixture.h index 321d56e..0f5722b 100644 --- a/tests/utils/qt-fixture.h +++ b/tests/utils/qt-fixture.h @@ -22,12 +22,13 @@ #define QT_NO_KEYWORDS #include <tests/utils/dbus-types.h> -#include <tests/utils/qdbus-helpers.h> #include <tests/utils/glib-fixture.h> #include <tests/utils/gtest-qt-print-helpers.h> #include <gtest/gtest.h> +#include <QDBusArgument> +#include <QVariant> #include <QSignalSpy> class QtFixture: public GlibFixture @@ -54,5 +55,20 @@ protected: ASSERT_EQ(signalsExpected, signalSpy.size()); } + + bool qDBusArgumentToMap(QVariant const& variant, QVariantMap& map) + { + if (variant.canConvert<QDBusArgument>()) + { + QDBusArgument value(variant.value<QDBusArgument>()); + if (value.currentType() == QDBusArgument::MapType) + { + value >> map; + return true; + } + } + + return false; + } }; |