| 1 | /* |
| 2 | * Copyright (C) 2013 Canonical Ltd. |
| 3 | * |
| 4 | * Contact: Alberto Mardegan <[email protected]> |
| 5 | * |
| 6 | * This file is part of lomiri-online-accounts-service |
| 7 | * |
| 8 | * This program is free software: you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License version 3, as published |
| 10 | * by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranties of |
| 14 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include <online-accounts-common/globals.h>cxx . . $ `<file>/online-accounts-common/globals.h`/ |
| 22 | #include "request.h"cxx . . $ `<file>/online-accounts-service/src/request.h`/ |
| 23 | #include "request-manager.h"cxx . . $ `<file>/online-accounts-service/src/request-manager.h`/ |
| 24 | #include "service.h"cxx . . $ `<file>/online-accounts-service/src/service.h`/ |
| 25 | #include "ui-proxy.h"cxx . . $ `<file>/online-accounts-service/src/ui-proxy.h`/ |
| 26 | |
| 27 | #include <QDBusArgument> |
| 28 | #include <QDBusConnection> |
| 29 | #include <QDBusMessage> |
| 30 | #include <QDBusPendingCallWatcher> |
| 31 | #include <QDBusPendingReply> |
| 32 | #include <QDBusServer> |
| 33 | #include <QDebug> |
| 34 | #include <QSignalSpy> |
| 35 | #include <QString> |
| 36 | #include <QTest> |
| 37 | #include <QTimer> |
| 38 | |
| 39 | using namespace OnlineAccountsUi; |
| 40 | |
| 41 | #define P2P_SOCKETcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:41:9`! "unix:path=" TMP_DIRcxx . . $ `<built-in>:483:9`! "/tst_service_%1" |
| 42 | #define TEST_SERVICE_NAMEcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:42:9`! \ |
| 43 | QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("com.lomiri.OnlineAccountsUi.Test") |
| 44 | #define TEST_OBJECT_PATHcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:44:9`! QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("/") |
| 45 | |
| 46 | QListcxx . . $ QList#<UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate# *> m_uiProxiescxx . . $ m_uiProxies.; |
| 47 | |
| 48 | class RequestReplycxx . . $ RequestReply#: public QDBusPendingCallWatchercxx . . $ QDBusPendingCallWatcher# |
| 49 | { |
| 50 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 51 | |
| 52 | public: |
| 53 | RequestReplycxx . . $ RequestReply#RequestReply(a613d4c11aa30e35).(const QDBusPendingCallcxx . . $ QDBusPendingCall# &call, QObjectcxx . . $ QObject# *parent = 0): |
| 54 | QDBusPendingCallWatchercxx . . $ QDBusPendingCallWatcher#QDBusPendingCallWatcher(a613d4c11aa30e35).(call, parent), |
| 55 | m_isErrorcxx . . $ RequestReply#m_isError.(false) |
| 56 | { |
| 57 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished(QDBusPendingCallWatcher*)), |
| 58 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onFinished())); |
| 59 | } |
| 60 | |
| 61 | bool isErrorcxx . . $ RequestReply#isError(50ce9a9e25b4a850).() const { return m_isErrorcxx . . $ RequestReply#m_isError.; } |
| 62 | QVariantMapcxx . . $ QVariantMap# replycxx . . $ RequestReply#reply(87f780dbe64191c4).() const { return m_replycxx . . $ QMap#QMap(21739d87639e1d56).; } |
| 63 | QStringcxx . . $ QString# errorNamecxx . . $ RequestReply#errorName(6ef7b6c27b00b43d).() const { return m_errorNamecxx . . $ QString#QString(132dd6869045752b).; } |
| 64 | QStringcxx . . $ QString# errorMessagecxx . . $ RequestReply#errorMessage(6ef7b6c27b00b43d).() const { return m_errorMessagecxx . . $ QString#QString(132dd6869045752b).; } |
| 65 | |
| 66 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 67 | void onFinishedcxx . . $ RequestReply#onFinished(49f6e7a06ebc5aa8).() { |
| 68 | QDBusPendingReplycxx . . $ QDBusPendingReply#<QVariantMapcxx . . $ QVariantMap#> reply = *cxx . . $ QDBusPendingReply#QDBusPendingReply(8091e1e063dfdcb5).this; |
| 69 | if (reply.isErrorcxx . . $ QDBusPendingCall#isError(50ce9a9e25b4a850).()) { |
| 70 | m_isErrorcxx . . $ RequestReply#m_isError. = true; |
| 71 | m_errorNamecxx . . $ RequestReply#m_errorName. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). reply.errorcxx . . $ QDBusPendingCall#error(1d9100e4f448fa26).().namecxx . . $ QDBusError#name(6ef7b6c27b00b43d).(); |
| 72 | m_errorMessagecxx . . $ RequestReply#m_errorMessage. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). reply.errorcxx . . $ QDBusPendingCall#error(1d9100e4f448fa26).().messagecxx . . $ QDBusError#message(6ef7b6c27b00b43d).(); |
| 73 | } else { |
| 74 | m_replycxx . . $ RequestReply#m_reply. =cxx . . $ QMap#`operator=`(86243d55ea3d6313). qdbus_castcxx . . $ qdbus_cast(77fb564ca0a1ed4b).<QVariantMapcxx . . $ QVariantMap#>(reply.argumentAtcxx . . $ QDBusPendingReplyData#argumentAt(fb36142a814bbf95).(0). |
| 75 | valuecxx . . $ QVariant#value(8f5363d873dd4781).<QDBusArgumentcxx . . $ QDBusArgument#>()); |
| 76 | } |
| 77 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! finishedcxx . . $ RequestReply#finished(49f6e7a06ebc5aa8).(); |
| 78 | } |
| 79 | |
| 80 | Q_SIGNALScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:93:10`!: |
| 81 | void finishedcxx . . $ RequestReply#finished(49f6e7a06ebc5aa8).(); |
| 82 | |
| 83 | private: |
| 84 | bool m_isErrorcxx . . $ RequestReply#m_isError.; |
| 85 | QVariantMapcxx . . $ QVariantMap# m_replycxx . . $ RequestReply#m_reply.; |
| 86 | QStringcxx . . $ QString# m_errorNamecxx . . $ RequestReply#m_errorName.; |
| 87 | QStringcxx . . $ QString# m_errorMessagecxx . . $ RequestReply#m_errorMessage.; |
| 88 | }; |
| 89 | |
| 90 | class ServiceTestcxx . . $ ServiceTest#: public QObjectcxx . . $ QObject# |
| 91 | { |
| 92 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 93 | |
| 94 | public: |
| 95 | ServiceTestcxx . . $ ServiceTest#ServiceTest(49f6e7a06ebc5aa8).(); |
| 96 | |
| 97 | private: |
| 98 | RequestReplycxx . . $ RequestReply# *sendRequestcxx . . $ ServiceTest#sendRequest(d0f21114cf5b9738).(const QVariantMapcxx . . $ QVariantMap# ¶meters) { |
| 99 | QDBusMessagecxx . . $ QDBusMessage# msg = |
| 100 | QDBusMessagecxx . . $ QDBusMessage#::createMethodCallcxx . . $ QDBusMessage#createMethodCall(53922711d019cf27).(TEST_SERVICE_NAMEcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:42:9`!, |
| 101 | TEST_OBJECT_PATHcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:44:9`!, |
| 102 | "com.lomiri.OnlineAccountsUi"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 103 | "requestAccess"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 104 | msg.setArgumentscxx . . $ QDBusMessage#setArguments(2f4009bfc0c7e161).(QVariantListcxx . . $ QList#QList(ced63f7c635d850d).() <<cxx . . $ QList#`operator<<`(309d1580d8f5dc58). parameterscxx . . $ QVariant#QVariant(3e95df3e31f2cce8).); |
| 105 | QDBusPendingCallcxx . . $ QDBusPendingCall# call = m_connectioncxx . . $ ServiceTest#m_connection..asyncCallcxx . . $ QDBusConnection#asyncCall(736a370b23ad872a).(msg); |
| 106 | return new RequestReplycxx . . $ RequestReply#(call, this); |
| 107 | } |
| 108 | |
| 109 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 110 | void initTestCasecxx . . $ ServiceTest#initTestCase(49f6e7a06ebc5aa8).(); |
| 111 | void testResultscxx . . $ ServiceTest#testResults(49f6e7a06ebc5aa8).(); |
| 112 | void testFailurecxx . . $ ServiceTest#testFailure(49f6e7a06ebc5aa8).(); |
| 113 | void testIdlecxx . . $ ServiceTest#testIdle(49f6e7a06ebc5aa8).(); |
| 114 | |
| 115 | protected Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 116 | void onNewConnectioncxx . . $ ServiceTest#onNewConnection(970609fd3373f52d).(const QDBusConnectioncxx . . $ QDBusConnection# &connection); |
| 117 | |
| 118 | private: |
| 119 | RequestManagercxx . . $ OnlineAccountsUi/RequestManager# m_requestManagercxx . . $ ServiceTest#m_requestManager.; |
| 120 | Servicecxx . . $ OnlineAccountsUi/Service# m_servicecxx . . $ ServiceTest#m_service.; |
| 121 | QDBusConnectioncxx . . $ QDBusConnection# m_connectioncxx . . $ ServiceTest#m_connection.; |
| 122 | }; |
| 123 | |
| 124 | /* Mocking UiProxy { */ |
| 125 | namespace OnlineAccountsUicxx . . $ OnlineAccountsUi/ { |
| 126 | |
| 127 | class UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate#: public QObjectcxx . . $ QObject# |
| 128 | { |
| 129 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 130 | Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(UiProxy) |
| 131 | |
| 132 | public: |
| 133 | UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate#UiProxyPrivate(cdcd0b22d5c2bff8).(UiProxycxx . . $ OnlineAccountsUi/UiProxy# *uiProxy): |
| 134 | QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(uiProxy), |
| 135 | m_initCountcxx . . $ OnlineAccountsUi/UiProxyPrivate#m_initCount.(0), |
| 136 | m_initReplycxx . . $ OnlineAccountsUi/UiProxyPrivate#m_initReply.(true), |
| 137 | q_ptrcxx . . $ OnlineAccountsUi/UiProxyPrivate#q_ptr.(uiProxy) |
| 138 | { |
| 139 | } |
| 140 | ~cxx . . $ OnlineAccountsUi/UiProxyPrivate#`~UiProxyPrivate`(ced63f7c635d850d).UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate#() {}; |
| 141 | |
| 142 | void emitFinishedcxx . . $ OnlineAccountsUi/UiProxyPrivate#emitFinished(49f6e7a06ebc5aa8).() { Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q_ptrcxx . . $ OnlineAccountsUi/UiProxyPrivate#q_ptr.->finishedcxx . . $ OnlineAccountsUi/UiProxy#finished(49f6e7a06ebc5aa8).(); } |
| 143 | |
| 144 | Q_SIGNALScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:93:10`!: |
| 145 | void handleRequestCalledcxx . . $ OnlineAccountsUi/UiProxyPrivate#handleRequestCalled(49f6e7a06ebc5aa8).(); |
| 146 | |
| 147 | public: |
| 148 | int m_initCountcxx . . $ OnlineAccountsUi/UiProxyPrivate#m_initCount.; |
| 149 | bool m_initReplycxx . . $ OnlineAccountsUi/UiProxyPrivate#m_initReply.; |
| 150 | QListcxx . . $ QList#<Requestcxx . . $ OnlineAccountsUi/Request#*> m_requestscxx . . $ OnlineAccountsUi/UiProxyPrivate#m_requests.; |
| 151 | QVariantMapcxx . . $ QVariantMap# m_expectedHasHandlerForcxx . . $ OnlineAccountsUi/UiProxyPrivate#m_expectedHasHandlerFor.; |
| 152 | mutable UiProxycxx . . $ OnlineAccountsUi/UiProxy# *q_ptrcxx . . $ OnlineAccountsUi/UiProxyPrivate#q_ptr.; |
| 153 | }; |
| 154 | |
| 155 | } // namespace |
| 156 | |
| 157 | UiProxycxx . . $ OnlineAccountsUi/UiProxy#::UiProxycxx . . $ OnlineAccountsUi/UiProxy#UiProxy(1ee1e1ac455d3e6e).(pid_t, QObjectcxx . . $ QObject# *parent): |
| 158 | QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent), |
| 159 | d_ptrcxx . . $ OnlineAccountsUi/UiProxy#d_ptr.(new UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate#UiProxyPrivate(cdcd0b22d5c2bff8).(this)) |
| 160 | { |
| 161 | m_uiProxiescxx . . $ m_uiProxies..appendcxx . . $ QList#append(77d9f17553126ecb).(d_ptrcxx . . $ OnlineAccountsUi/UiProxy#d_ptr.); |
| 162 | } |
| 163 | |
| 164 | UiProxycxx . . $ OnlineAccountsUi/UiProxy#::~cxx . . $ OnlineAccountsUi/UiProxy#`~UiProxy`(ced63f7c635d850d).UiProxycxx . . $ OnlineAccountsUi/UiProxy#() |
| 165 | { |
| 166 | m_uiProxiescxx . . $ m_uiProxies..removeOnecxx . . $ QList#removeOne(fe1ba53999e710f3).(d_ptrcxx . . $ OnlineAccountsUi/UiProxy#d_ptr.); |
| 167 | } |
| 168 | |
| 169 | bool UiProxycxx . . $ OnlineAccountsUi/UiProxy#::initcxx . . $ OnlineAccountsUi/UiProxy#init(c9857a73d68e59ba).() |
| 170 | { |
| 171 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(UiProxy); |
| 172 | d->m_initCountcxx . . $ OnlineAccountsUi/UiProxyPrivate#m_initCount.++; |
| 173 | return d->m_initReplycxx . . $ OnlineAccountsUi/UiProxyPrivate#m_initReply.; |
| 174 | } |
| 175 | |
| 176 | void UiProxycxx . . $ OnlineAccountsUi/UiProxy#::handleRequestcxx . . $ OnlineAccountsUi/UiProxy#handleRequest(5accaa2ad66e8668).(Requestcxx . . $ OnlineAccountsUi/Request# *request) |
| 177 | { |
| 178 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(UiProxy); |
| 179 | d->m_requestscxx . . $ OnlineAccountsUi/UiProxyPrivate#m_requests..appendcxx . . $ QList#append(77d9f17553126ecb).(request); |
| 180 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! d->handleRequestCalledcxx . . $ OnlineAccountsUi/UiProxyPrivate#handleRequestCalled(49f6e7a06ebc5aa8).(); |
| 181 | } |
| 182 | |
| 183 | bool UiProxycxx . . $ OnlineAccountsUi/UiProxy#::hasHandlerForcxx . . $ OnlineAccountsUi/UiProxy#hasHandlerFor(749620a94a1e100c).(const QVariantMapcxx . . $ QVariantMap# ¶meters) |
| 184 | { |
| 185 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(UiProxy); |
| 186 | return parameters ==cxx . . $ QMap#`operator==`(273b8a10d4ccd454). d->m_expectedHasHandlerForcxx . . $ OnlineAccountsUi/UiProxyPrivate#m_expectedHasHandlerFor.; |
| 187 | } |
| 188 | |
| 189 | /* } mocking UiProxy */ |
| 190 | |
| 191 | ServiceTestcxx . . $ ServiceTest#::ServiceTestcxx . . $ ServiceTest#ServiceTest(49f6e7a06ebc5aa8).(): |
| 192 | QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(0), |
| 193 | m_connectioncxx . . $ ServiceTest#m_connection.(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("uninitialized")) |
| 194 | { |
| 195 | } |
| 196 | |
| 197 | void ServiceTestcxx . . $ ServiceTest#::onNewConnectioncxx . . $ ServiceTest#onNewConnection(970609fd3373f52d).(const QDBusConnectioncxx . . $ QDBusConnection# &connection) |
| 198 | { |
| 199 | QDBusConnectioncxx . . $ QDBusConnection# conncxx . . $ QDBusConnection#QDBusConnection(970609fd3373f52d).(connection); |
| 200 | conn.registerServicecxx . . $ QDBusConnection#registerService(e1defb592416720d).(TEST_SERVICE_NAMEcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:42:9`!); |
| 201 | conn.registerObjectcxx . . $ QDBusConnection#registerObject(3ca2fdce2ef96dc8).(TEST_OBJECT_PATHcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:44:9`!, &m_servicecxx . . $ ServiceTest#m_service.); |
| 202 | } |
| 203 | |
| 204 | void ServiceTestcxx . . $ ServiceTest#::initTestCasecxx . . $ ServiceTest#initTestCase(49f6e7a06ebc5aa8).() |
| 205 | { |
| 206 | QDBusServercxx . . $ QDBusServer# *server; |
| 207 | for (int i = 0; i < 10; i++) { |
| 208 | server = new QDBusServercxx . . $ QDBusServer#(QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).(P2P_SOCKETcxx . . $ `tests/online-accounts-service/tst_service/tst_service.cpp:41:9`!).argcxx . . $ QString#arg(64ab2ed17cc11715).(i), this); |
| 209 | if (!server->isConnectedcxx . . $ QDBusServer#isConnected(50ce9a9e25b4a850).()) { |
| 210 | delete server; |
| 211 | } else { |
| 212 | break; |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(server->isConnected()); |
| 217 | |
| 218 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(server, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(newConnection(const QDBusConnection &)), |
| 219 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onNewConnection(const QDBusConnection &))); |
| 220 | |
| 221 | m_connectioncxx . . $ ServiceTest#m_connection. =cxx . . $ QDBusConnection#`operator=`(8112cd6b708ca82c). QDBusConnectioncxx . . $ QDBusConnection#::connectToPeercxx . . $ QDBusConnection#connectToPeer(bb2333c2d9ff249b).(server->addresscxx . . $ QDBusServer#address(6ef7b6c27b00b43d).(), |
| 222 | QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("tst")); |
| 223 | QTestcxx . . $ QTest/::qWaitcxx . . $ QTest/qWait(d4f767463ce0a6b3).(10); |
| 224 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(m_connection.isConnected()); |
| 225 | } |
| 226 | |
| 227 | void ServiceTestcxx . . $ ServiceTest#::testResultscxx . . $ ServiceTest#testResults(49f6e7a06ebc5aa8).() |
| 228 | { |
| 229 | QVariantMapcxx . . $ QVariantMap# parameterscxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 230 | parameters.insertcxx . . $ QMap#insert(929a1ed410fe8423).("hello"cxx . . $ QString#QString(85c52e162fed56f9)., QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).("world")); |
| 231 | RequestReplycxx . . $ RequestReply# *call = sendRequestcxx . . $ ServiceTest#sendRequest(d0f21114cf5b9738).(parameters); |
| 232 | QSignalSpycxx . . $ QSignalSpy# callFinishedcxx . . $ QSignalSpy#QSignalSpy(593025bf41bda872).(call, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished())); |
| 233 | |
| 234 | QTRY_COMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:185:9`!(m_uiProxies.count(), 1); |
| 235 | |
| 236 | UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate# *proxy = m_uiProxiescxx . . $ m_uiProxies.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]; |
| 237 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(proxy->m_initCount, 1); |
| 238 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(proxy->m_requests.count(), 1); |
| 239 | |
| 240 | Requestcxx . . $ OnlineAccountsUi/Request# *request = proxy->m_requestscxx . . $ OnlineAccountsUi/UiProxyPrivate#m_requests..lastcxx . . $ QList#last(19b2b6f17af048b).(); |
| 241 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(request->parameters(), parameters); |
| 242 | |
| 243 | request->setInProgresscxx . . $ OnlineAccountsUi/Request#setInProgress(b45ddcbc8423892c).(true); |
| 244 | request->setResultcxx . . $ OnlineAccountsUi/Request#setResult(3e95df3e31f2cce8).(parameters); |
| 245 | |
| 246 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(callFinished.wait()); |
| 247 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(call->isError(), false); |
| 248 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(call->reply(), parameters); |
| 249 | delete call; |
| 250 | |
| 251 | proxy->emitFinishedcxx . . $ OnlineAccountsUi/UiProxyPrivate#emitFinished(49f6e7a06ebc5aa8).(); |
| 252 | QTRY_COMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:185:9`!(m_uiProxies.count(), 0); |
| 253 | } |
| 254 | |
| 255 | void ServiceTestcxx . . $ ServiceTest#::testFailurecxx . . $ ServiceTest#testFailure(49f6e7a06ebc5aa8).() |
| 256 | { |
| 257 | QVariantMapcxx . . $ QVariantMap# parameterscxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 258 | parameters.insertcxx . . $ QMap#insert(929a1ed410fe8423).("hi"cxx . . $ QString#QString(85c52e162fed56f9)., "there"cxx . . $ QVariant#QVariant(85c52e162fed56f9).); |
| 259 | RequestReplycxx . . $ RequestReply# *call = sendRequestcxx . . $ ServiceTest#sendRequest(d0f21114cf5b9738).(parameters); |
| 260 | QSignalSpycxx . . $ QSignalSpy# callFinishedcxx . . $ QSignalSpy#QSignalSpy(593025bf41bda872).(call, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished())); |
| 261 | |
| 262 | QTRY_COMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:185:9`!(m_uiProxies.count(), 1); |
| 263 | |
| 264 | UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate# *proxy = m_uiProxiescxx . . $ m_uiProxies.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]; |
| 265 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(proxy->m_initCount, 1); |
| 266 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(proxy->m_requests.count(), 1); |
| 267 | |
| 268 | Requestcxx . . $ OnlineAccountsUi/Request# *request = proxy->m_requestscxx . . $ OnlineAccountsUi/UiProxyPrivate#m_requests..lastcxx . . $ QList#last(19b2b6f17af048b).(); |
| 269 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(request->parameters(), parameters); |
| 270 | |
| 271 | request->setInProgresscxx . . $ OnlineAccountsUi/Request#setInProgress(b45ddcbc8423892c).(true); |
| 272 | QStringcxx . . $ QString# errorNamecxx . . $ QString#QString(85c52e162fed56f9).("com.lomiri.OnlineAccountsUi.BadLuck"); |
| 273 | QStringcxx . . $ QString# errorMessagecxx . . $ QString#QString(85c52e162fed56f9).("really unlucky"); |
| 274 | request->failcxx . . $ OnlineAccountsUi/Request#fail(c1427772cd1877b0).(errorName, errorMessage); |
| 275 | |
| 276 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(callFinished.wait()); |
| 277 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(call->isError(), true); |
| 278 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(call->errorName(), errorName); |
| 279 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(call->errorMessage(), errorMessage); |
| 280 | delete call; |
| 281 | |
| 282 | proxy->emitFinishedcxx . . $ OnlineAccountsUi/UiProxyPrivate#emitFinished(49f6e7a06ebc5aa8).(); |
| 283 | QTRY_COMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:185:9`!(m_uiProxies.count(), 0); |
| 284 | } |
| 285 | |
| 286 | void ServiceTestcxx . . $ ServiceTest#::testIdlecxx . . $ ServiceTest#testIdle(49f6e7a06ebc5aa8).() |
| 287 | { |
| 288 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m_requestManager.isIdle(), true); |
| 289 | |
| 290 | QSignalSpycxx . . $ QSignalSpy# isIdleChangedcxx . . $ QSignalSpy#QSignalSpy(593025bf41bda872).(&m_requestManagercxx . . $ ServiceTest#m_requestManager., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(isIdleChanged())); |
| 291 | |
| 292 | QVariantMapcxx . . $ QVariantMap# parameterscxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 293 | parameters.insertcxx . . $ QMap#insert(929a1ed410fe8423).("time"cxx . . $ QString#QString(85c52e162fed56f9)., "out"cxx . . $ QVariant#QVariant(85c52e162fed56f9).); |
| 294 | RequestReplycxx . . $ RequestReply# *call = sendRequestcxx . . $ ServiceTest#sendRequest(d0f21114cf5b9738).(parameters); |
| 295 | QSignalSpycxx . . $ QSignalSpy# callFinishedcxx . . $ QSignalSpy#QSignalSpy(593025bf41bda872).(call, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished())); |
| 296 | |
| 297 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(isIdleChanged.wait()); |
| 298 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m_requestManager.isIdle(), false); |
| 299 | isIdleChanged.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 300 | |
| 301 | QTRY_COMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:185:9`!(m_uiProxies.count(), 1); |
| 302 | |
| 303 | UiProxyPrivatecxx . . $ OnlineAccountsUi/UiProxyPrivate# *proxy = m_uiProxiescxx . . $ m_uiProxies.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]; |
| 304 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(proxy->m_initCount, 1); |
| 305 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(proxy->m_requests.count(), 1); |
| 306 | |
| 307 | Requestcxx . . $ OnlineAccountsUi/Request# *request = proxy->m_requestscxx . . $ OnlineAccountsUi/UiProxyPrivate#m_requests..lastcxx . . $ QList#last(19b2b6f17af048b).(); |
| 308 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(request->parameters(), parameters); |
| 309 | |
| 310 | request->setInProgresscxx . . $ OnlineAccountsUi/Request#setInProgress(b45ddcbc8423892c).(true); |
| 311 | request->setResultcxx . . $ OnlineAccountsUi/Request#setResult(3e95df3e31f2cce8).(parameters); |
| 312 | |
| 313 | /* the request will terminate, so expect the service |
| 314 | * to be idle again */ |
| 315 | QTRY_COMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:185:9`!(isIdleChanged.count(), 1); |
| 316 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(m_requestManager.isIdle(), true); |
| 317 | |
| 318 | QVERIFYcxx . . $ `<external>/8602788698586413231/qtestcase.h:63:9`!(callFinished.wait()); |
| 319 | QCOMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:86:9`!(call->isError(), false); |
| 320 | delete call; |
| 321 | |
| 322 | proxy->emitFinishedcxx . . $ OnlineAccountsUi/UiProxyPrivate#emitFinished(49f6e7a06ebc5aa8).(); |
| 323 | QTRY_COMPAREcxx . . $ `<external>/8602788698586413231/qtestcase.h:185:9`!(m_uiProxies.count(), 0); |
| 324 | } |
| 325 | |
| 326 | QTEST_MAINcxx . . $ `<external>/4204159469433502174/qtest.h:508:9`!(ServiceTest); |
| 327 | |
| 328 | #include "tst_service.moc"cxx . . $ `<file>/build/tests/online-accounts-service/tst_service/tst_service_autogen/include/tst_service.moc`/ |