tests/auto/qdbusreply/tst_qdbusreply.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 };
   100 };
   100 
   101 
   234 {
   235 {
   235     QVERIFY(iface);
   236     QVERIFY(iface);
   236     QVERIFY(iface->isValid());
   237     QVERIFY(iface->isValid());
   237 }
   238 }
   238 
   239 
       
   240 void tst_QDBusReply::unconnected()
       
   241 {
       
   242     QDBusConnection con("invalid stored connection");
       
   243     QVERIFY(!con.isConnected());
       
   244     QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con);
       
   245     QVERIFY(!iface.isValid());
       
   246 
       
   247     QDBusReply<void> rvoid = iface.asyncCall("ReloadConfig");
       
   248     QVERIFY(!rvoid.isValid());
       
   249 
       
   250     QDBusReply<QString> rstring = iface.asyncCall("GetId");
       
   251     QVERIFY(!rstring.isValid());
       
   252     QVERIFY(rstring.value().isEmpty());
       
   253 }
       
   254 
   239 void tst_QDBusReply::simpleTypes()
   255 void tst_QDBusReply::simpleTypes()
   240 {
   256 {
   241     QDBusReply<bool> rbool = iface->call(QDBus::BlockWithGui, "retrieveBool");
   257     QDBusReply<bool> rbool = iface->call(QDBus::BlockWithGui, "retrieveBool");
   242     QVERIFY(rbool.isValid());
   258     QVERIFY(rbool.isValid());
   243     QCOMPARE(rbool.value(), adaptor->retrieveBool());
   259     QCOMPARE(rbool.value(), adaptor->retrieveBool());