tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    91         qDBusRegisterMetaType<IntStringMap>();
    91         qDBusRegisterMetaType<IntStringMap>();
    92         qDBusRegisterMetaType<MyStruct>();
    92         qDBusRegisterMetaType<MyStruct>();
    93     }
    93     }
    94 
    94 
    95     void init();
    95     void init();
       
    96     void unconnected();
    96     void simpleTypes();
    97     void simpleTypes();
    97     void complexTypes();
    98     void complexTypes();
    98     void wrongTypes();
    99     void wrongTypes();
    99     void multipleTypes();
   100     void multipleTypes();
   100 
   101 
   250 {
   251 {
   251     QVERIFY(iface);
   252     QVERIFY(iface);
   252     QVERIFY(iface->isValid());
   253     QVERIFY(iface->isValid());
   253 }
   254 }
   254 
   255 
       
   256 void tst_QDBusPendingReply::unconnected()
       
   257 {
       
   258     QDBusConnection con("invalid stored connection");
       
   259     QVERIFY(!con.isConnected());
       
   260     QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con);
       
   261     QVERIFY(!iface.isValid());
       
   262 
       
   263     QDBusPendingReply<> rvoid = iface.asyncCall("ReloadConfig");
       
   264     QVERIFY(rvoid.isFinished());
       
   265     QVERIFY(!rvoid.isValid());
       
   266     QVERIFY(rvoid.isError());
       
   267     rvoid.waitForFinished();
       
   268     QVERIFY(!rvoid.isValid());
       
   269     QVERIFY(rvoid.isError());
       
   270 
       
   271     QDBusPendingReply<QString> rstring = iface.asyncCall("GetId");
       
   272     QVERIFY(rstring.isFinished());
       
   273     QVERIFY(!rstring.isValid());
       
   274     QVERIFY(rstring.isError());
       
   275     rstring.waitForFinished();
       
   276     QVERIFY(!rstring.isValid());
       
   277     QVERIFY(rstring.isError());
       
   278 }
       
   279 
   255 void tst_QDBusPendingReply::simpleTypes()
   280 void tst_QDBusPendingReply::simpleTypes()
   256 {
   281 {
   257     QDBusPendingReply<> rvoid = iface->asyncCall("retrieveVoid");
   282     QDBusPendingReply<> rvoid = iface->asyncCall("retrieveVoid");
   258     rvoid.waitForFinished();
   283     rvoid.waitForFinished();
   259     QVERIFY(rvoid.isFinished());
   284     QVERIFY(rvoid.isFinished());