summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdbusinterface
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-02-10 13:26:56 +0100
committerThiago Macieira <thiago.macieira@nokia.com>2011-02-17 16:02:14 +0100
commitcc2db7a49c9208a00a913f7c4a410009814a5580 (patch)
tree9f469afbdfd100d304eb4b943c3df67e15822f08 /tests/auto/qdbusinterface
parent5b53b44a2be8478adeee4a9e4796345828ad0248 (diff)
QtDBus meta object: keep methods, signals and props with unknown types
Use VoidStar as the metatype, with an unknown type called "QDBusRawType". The actual D-Bus type is saved as an hex value as a template parameter. D-Bus type Qt type comment h QDBusRawType<0x68>* Unix file descriptors ~ QDBusRawType<0x7e>* invalid type ai QDBusRawType<0x6169>* array of int32 a{i(ssy)} QDBusRawType<0x617b6928737379297d>* Note that the number in the template doesn't have to be valid. The QDBusRawType class doesn't exist anyway. I thought of just leaving the raw D-Bus type there, but who knows what kind of things can appear there, like other '>' (which may cause problems for anything trying to parse the meta object later). Task-number: QTBUG-17476
Diffstat (limited to 'tests/auto/qdbusinterface')
-rw-r--r--tests/auto/qdbusinterface/tst_qdbusinterface.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
index 37e1c643f1..39f067740b 100644
--- a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
+++ b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
@@ -350,7 +350,16 @@ void tst_QDBusInterface::introspectUnknownTypes()
"com.trolltech.QtDBus.MyObjectUnknownTypes");
const QMetaObject *mo = iface.metaObject();
- QVERIFY(mo->indexOfMethod("regularMethod()") != -1);
+ QVERIFY(mo->indexOfMethod("regularMethod()") != -1); // this is the control
+ QVERIFY(mo->indexOfMethod("somethingHappened(QDBusRawType<0x7e>*)") != -1);
+
+ QVERIFY(mo->indexOfMethod("ping(QDBusRawType<0x7e>*)") != -1);
+ int midx = mo->indexOfMethod("ping(QDBusRawType<0x7e>*)");
+ QCOMPARE(mo->method(midx).typeName(), "QDBusRawType<0x7e>*");
+
+ QVERIFY(mo->indexOfProperty("prop1") != -1);
+ int pidx = mo->indexOfProperty("prop1");
+ QCOMPARE(mo->property(pidx).typeName(), "QDBusRawType<0x7e>*");
}
void tst_QDBusInterface::callMethod()