diff -r 89e065397ea6 -r e24348a560a6 tests/auto/qdbusinterface/tst_qdbusinterface.cpp --- a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp Thu May 27 13:40:48 2010 +0300 +++ b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp Fri Jun 11 14:24:45 2010 +0300 @@ -157,6 +157,18 @@ } }; +class DerivedFromQDBusInterface: public QDBusInterface +{ + Q_OBJECT +public: + DerivedFromQDBusInterface() + : QDBusInterface("com.example.Test", "/") + {} + +public slots: + void method() {} +}; + // helper function void emitSignal(const QString &interface, const QString &name, const QString &arg) { @@ -183,6 +195,7 @@ void notConnected(); void notValid(); + void notValidDerived(); void invalidAfterServiceOwnerChanged(); void introspect(); void callMethod(); @@ -219,6 +232,7 @@ connection); QVERIFY(!interface.isValid()); + QVERIFY(!QMetaObject::invokeMethod(&interface, "ListNames", Qt::DirectConnection)); } void tst_QDBusInterface::notValid() @@ -230,6 +244,14 @@ connection); QVERIFY(!interface.isValid()); + QVERIFY(!QMetaObject::invokeMethod(&interface, "ListNames", Qt::DirectConnection)); +} + +void tst_QDBusInterface::notValidDerived() +{ + DerivedFromQDBusInterface c; + QVERIFY(!c.isValid()); + QMetaObject::invokeMethod(&c, "method", Qt::DirectConnection); } void tst_QDBusInterface::invalidAfterServiceOwnerChanged()