clienttest.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. /*
  2. * MIT License
  3. *
  4. * Copyright (c) 2019 Alexey Edelev <semlanik@gmail.com>
  5. *
  6. * This file is part of QtProtobuf project https://git.semlanik.org/semlanik/qtprotobuf
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy of this
  9. * software and associated documentation files (the "Software"), to deal in the Software
  10. * without restriction, including without limitation the rights to use, copy, modify,
  11. * merge, publish, distribute, sublicense, and/or sell copies of the Software, and
  12. * to permit persons to whom the Software is furnished to do so, subject to the following
  13. * conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in all copies
  16. * or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  19. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  20. * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
  21. * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  22. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. * DEALINGS IN THE SOFTWARE.
  24. */
  25. #include "testservice_grpc.qpb.h"
  26. #include "qtprotobuf_global.qpb.h"
  27. #include <QGrpcHttp2Channel>
  28. #include <QGrpcCredentials>
  29. #include <QGrpcInsecureCredentials>
  30. #include <QTimer>
  31. #include <QFile>
  32. #include <QCryptographicHash>
  33. #include <QCoreApplication>
  34. #include <gtest/gtest.h>
  35. #include <qprotobufserializer.h>
  36. using namespace qtprotobufnamespace::tests;
  37. using namespace QtProtobuf;
  38. class ClientTest : public ::testing::Test
  39. {
  40. protected:
  41. static void SetUpTestCase() {
  42. QtProtobuf::qRegisterProtobufTypes();
  43. qRegisterProtobufType<SimpleStringMessage>();
  44. }
  45. static QCoreApplication m_app;
  46. static int m_argc;
  47. static QUrl m_echoServerAddress;
  48. };
  49. int ClientTest::m_argc(0);
  50. QCoreApplication ClientTest::m_app(m_argc, nullptr);
  51. QUrl ClientTest::m_echoServerAddress("http://localhost:50051", QUrl::StrictMode);
  52. TEST_F(ClientTest, CheckMethodsGeneration)
  53. {
  54. //Dummy compile time check of functions generation and interface compatibility
  55. TestServiceClient testClient;
  56. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(QUrl(), QGrpcInsecureChannelCredentials() | QGrpcInsecureCallCredentials()));
  57. SimpleStringMessage request;
  58. QPointer<SimpleStringMessage> result(new SimpleStringMessage);
  59. testClient.testMethod(request, result);
  60. testClient.testMethod(request);
  61. testClient.testMethod(request, &testClient, [](QGrpcAsyncReply *) {});
  62. delete result;
  63. }
  64. TEST_F(ClientTest, StringEchoTest)
  65. {
  66. TestServiceClient testClient;
  67. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureChannelCredentials() | QGrpcInsecureCallCredentials()));
  68. SimpleStringMessage request;
  69. QPointer<SimpleStringMessage> result(new SimpleStringMessage);
  70. request.setTestFieldString("Hello beach!");
  71. ASSERT_TRUE(testClient.testMethod(request, result) == QGrpcStatus::Ok);
  72. ASSERT_STREQ(result->testFieldString().toStdString().c_str(), "Hello beach!");
  73. delete result;
  74. }
  75. TEST_F(ClientTest, StringEchoAsyncTest)
  76. {
  77. TestServiceClient testClient;
  78. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureChannelCredentials() | QGrpcInsecureCallCredentials()));
  79. SimpleStringMessage request;
  80. SimpleStringMessage result;
  81. request.setTestFieldString("Hello beach!");
  82. QEventLoop waiter;
  83. QGrpcAsyncReply *reply = testClient.testMethod(request);
  84. QObject::connect(reply, &QGrpcAsyncReply::finished, &m_app, [reply, &result, &waiter]() {
  85. result = reply->read<SimpleStringMessage>();
  86. waiter.quit();
  87. });
  88. waiter.exec();
  89. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), "Hello beach!");
  90. }
  91. TEST_F(ClientTest, StringEchoAsync2Test)
  92. {
  93. TestServiceClient testClient;
  94. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  95. SimpleStringMessage result;
  96. SimpleStringMessage request;
  97. request.setTestFieldString("Hello beach!");
  98. QEventLoop waiter;
  99. testClient.testMethod(request, &m_app, [&result, &waiter](QGrpcAsyncReply *reply) {
  100. result = reply->read<SimpleStringMessage>();
  101. waiter.quit();
  102. });
  103. waiter.exec();
  104. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), "Hello beach!");
  105. }
  106. TEST_F(ClientTest, StringEchoImmediateAsyncAbortTest)
  107. {
  108. TestServiceClient testClient;
  109. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  110. SimpleStringMessage result;
  111. SimpleStringMessage request;
  112. request.setTestFieldString("sleep");
  113. QEventLoop waiter;
  114. QGrpcAsyncReply *reply = testClient.testMethod(request);
  115. result.setTestFieldString("Result not changed by echo");
  116. QObject::connect(reply, &QGrpcAsyncReply::finished, &m_app, [&waiter, &result, reply]() {
  117. result = reply->read<SimpleStringMessage>();
  118. waiter.quit();
  119. });
  120. QGrpcStatus::StatusCode asyncStatus = QGrpcStatus::StatusCode::Ok;
  121. QObject::connect(reply, &QGrpcAsyncReply::error, reply, [&asyncStatus](const QGrpcStatus &status) {
  122. asyncStatus = status.code();
  123. });
  124. QGrpcStatus::StatusCode clientStatus = QGrpcStatus::StatusCode::Ok;
  125. QObject::connect(&testClient, &TestServiceClient::error, reply, [&clientStatus](const QGrpcStatus &status) {
  126. clientStatus = status.code();
  127. std::cerr << status.code() << ":" << status.message().toStdString();
  128. });
  129. QTimer::singleShot(5000, &waiter, &QEventLoop::quit);
  130. reply->abort();
  131. waiter.exec();
  132. ASSERT_EQ(clientStatus, QGrpcStatus::StatusCode::Aborted);
  133. ASSERT_EQ(asyncStatus, QGrpcStatus::StatusCode::Aborted);
  134. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), "Result not changed by echo");
  135. }
  136. TEST_F(ClientTest, StringEchoDeferredAsyncAbortTest)
  137. {
  138. TestServiceClient testClient;
  139. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  140. SimpleStringMessage result;
  141. SimpleStringMessage request;
  142. request.setTestFieldString("sleep");
  143. QEventLoop waiter;
  144. QGrpcAsyncReply *reply = testClient.testMethod(request);
  145. result.setTestFieldString("Result not changed by echo");
  146. bool errorCalled = false;
  147. reply = testClient.testMethod(request);
  148. QObject::connect(reply, &QGrpcAsyncReply::finished, &m_app, [reply, &result, &waiter]() {
  149. result = reply->read<SimpleStringMessage>();
  150. waiter.quit();
  151. });
  152. QObject::connect(reply, &QGrpcAsyncReply::error, reply, [&errorCalled]() {
  153. errorCalled = true;
  154. });
  155. QTimer::singleShot(500, reply, &QGrpcAsyncReply::abort);
  156. QTimer::singleShot(5000, &waiter, &QEventLoop::quit);
  157. waiter.exec();
  158. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), "Result not changed by echo");
  159. ASSERT_TRUE(errorCalled);
  160. }
  161. TEST_F(ClientTest, StringEchoStreamTest)
  162. {
  163. TestServiceClient testClient;
  164. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  165. SimpleStringMessage result;
  166. SimpleStringMessage request;
  167. request.setTestFieldString("Stream");
  168. QEventLoop waiter;
  169. int i = 0;
  170. QObject::connect(&testClient, &TestServiceClient::testMethodServerStreamUpdated, &m_app, [&result, &i, &waiter](const SimpleStringMessage &ret) {
  171. ++i;
  172. result.setTestFieldString(result.testFieldString() + ret.testFieldString());
  173. if (i == 4) {
  174. waiter.quit();
  175. }
  176. });
  177. testClient.subscribeTestMethodServerStreamUpdates(request);
  178. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  179. waiter.exec();
  180. ASSERT_EQ(i, 4);
  181. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), "Stream1Stream2Stream3Stream4");
  182. }
  183. TEST_F(ClientTest, StringEchoStreamAbortTest)
  184. {
  185. TestServiceClient testClient;
  186. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  187. SimpleStringMessage result;
  188. SimpleStringMessage request;
  189. request.setTestFieldString("Stream");
  190. QEventLoop waiter;
  191. int i = 0;
  192. QtProtobuf::QGrpcSubscription *subscription = testClient.subscribeTestMethodServerStreamUpdates(request);
  193. QObject::connect(&testClient, &TestServiceClient::testMethodServerStreamUpdated, &m_app, [&result, &i, &waiter, subscription](const SimpleStringMessage &ret) {
  194. ++i;
  195. result.setTestFieldString(result.testFieldString() + ret.testFieldString());
  196. if (i == 3) {
  197. subscription->cancel();
  198. QTimer::singleShot(4000, &waiter, &QEventLoop::quit);
  199. }
  200. });
  201. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  202. waiter.exec();
  203. ASSERT_EQ(i, 3);
  204. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), "Stream1Stream2Stream3");
  205. }
  206. TEST_F(ClientTest, StringEchoStreamAbortByTimerTest)
  207. {
  208. TestServiceClient testClient;
  209. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  210. SimpleStringMessage result;
  211. SimpleStringMessage request;
  212. request.setTestFieldString("Stream");
  213. QEventLoop waiter;
  214. int i = 0;
  215. QtProtobuf::QGrpcSubscription *subscription = testClient.subscribeTestMethodServerStreamUpdates(request);
  216. QTimer::singleShot(3500, subscription, [subscription](){
  217. subscription->cancel();
  218. });
  219. bool isFinished = false;
  220. QObject::connect(subscription, &QtProtobuf::QGrpcSubscription::finished, [&isFinished](){
  221. isFinished = true;
  222. });
  223. bool isError = false;
  224. QObject::connect(subscription, &QtProtobuf::QGrpcSubscription::error, [&isError](){
  225. isError = true;
  226. });
  227. QObject::connect(&testClient, &TestServiceClient::testMethodServerStreamUpdated, &m_app, [&result, &i](const SimpleStringMessage &ret) {
  228. ++i;
  229. result.setTestFieldString(result.testFieldString() + ret.testFieldString());
  230. });
  231. QTimer::singleShot(5000, &waiter, &QEventLoop::quit);
  232. waiter.exec();
  233. ASSERT_EQ(i, 3);
  234. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), "Stream1Stream2Stream3");
  235. ASSERT_TRUE(isFinished);
  236. ASSERT_TRUE(!isError);
  237. }
  238. TEST_F(ClientTest, StringEchoStreamTestRetUpdates)
  239. {
  240. TestServiceClient testClient;
  241. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  242. SimpleStringMessage request;
  243. QPointer<SimpleStringMessage> result(new SimpleStringMessage);
  244. request.setTestFieldString("Stream");
  245. QEventLoop waiter;
  246. testClient.subscribeTestMethodServerStreamUpdates(request, result);
  247. int i = 0;
  248. QObject::connect(result.data(), &SimpleStringMessage::testFieldStringChanged, &m_app, [&i]() {
  249. i++;
  250. });
  251. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  252. waiter.exec();
  253. ASSERT_EQ(i, 4);
  254. ASSERT_STREQ(result->testFieldString().toStdString().c_str(), "Stream4");
  255. delete result;
  256. }
  257. TEST_F(ClientTest, HugeBlobEchoStreamTest)
  258. {
  259. TestServiceClient testClient;
  260. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  261. BlobMessage result;
  262. BlobMessage request;
  263. QFile testFile("testfile");
  264. ASSERT_TRUE(testFile.open(QFile::ReadOnly));
  265. request.setTestBytes(testFile.readAll());
  266. QByteArray dataHash = QCryptographicHash::hash(request.testBytes(), QCryptographicHash::Sha256);
  267. QEventLoop waiter;
  268. QObject::connect(&testClient, &TestServiceClient::testMethodBlobServerStreamUpdated, &m_app, [&result, &waiter](const BlobMessage &ret) {
  269. result.setTestBytes(ret.testBytes());
  270. waiter.quit();
  271. });
  272. testClient.subscribeTestMethodBlobServerStreamUpdates(request);
  273. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  274. waiter.exec();
  275. QByteArray returnDataHash = QCryptographicHash::hash(result.testBytes(), QCryptographicHash::Sha256);
  276. ASSERT_TRUE(returnDataHash == dataHash);
  277. }
  278. TEST_F(ClientTest, StatusMessageAsyncTest)
  279. {
  280. TestServiceClient testClient;
  281. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  282. SimpleStringMessage request(QString{"Some status message"});
  283. QGrpcStatus::StatusCode asyncStatus = QGrpcStatus::StatusCode::Ok;
  284. QEventLoop waiter;
  285. QString statusMessage;
  286. QGrpcAsyncReply* reply = testClient.testMethodStatusMessage(request);
  287. QObject::connect(reply, &QGrpcAsyncReply::error, reply, [&asyncStatus, &waiter, &statusMessage](const QGrpcStatus &status) {
  288. asyncStatus = status.code();
  289. statusMessage = status.message();
  290. waiter.quit();
  291. });
  292. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  293. waiter.exec();
  294. ASSERT_STREQ(statusMessage.toStdString().c_str(), request.testFieldString().toStdString().c_str());
  295. }
  296. TEST_F(ClientTest, StatusMessageClientAsyncTest)
  297. {
  298. TestServiceClient testClient;
  299. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  300. SimpleStringMessage request(QString{"Some status message"});
  301. QGrpcStatus::StatusCode asyncStatus = QGrpcStatus::StatusCode::Ok;
  302. QEventLoop waiter;
  303. QString statusMessage;
  304. QObject::connect(&testClient, &TestServiceClient::error, [&asyncStatus, &waiter, &statusMessage](const QGrpcStatus &status) {
  305. asyncStatus = status.code();
  306. statusMessage = status.message();
  307. waiter.quit();
  308. });
  309. testClient.testMethodStatusMessage(request);
  310. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  311. waiter.exec();
  312. ASSERT_STREQ(statusMessage.toStdString().c_str(), request.testFieldString().toStdString().c_str());
  313. }
  314. TEST_F(ClientTest, StatusMessageClientSyncTest)
  315. {
  316. TestServiceClient testClient;
  317. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  318. SimpleStringMessage request(QString{"Some status message"});
  319. QPointer<SimpleStringMessage> ret(new SimpleStringMessage);
  320. QGrpcStatus::StatusCode asyncStatus = QGrpcStatus::StatusCode::Ok;
  321. QEventLoop waiter;
  322. QString statusMessage;
  323. QObject::connect(&testClient, &TestServiceClient::error, [&asyncStatus, &waiter, &statusMessage](const QGrpcStatus &status) {
  324. asyncStatus = status.code();
  325. statusMessage = status.message();
  326. waiter.quit();
  327. });
  328. testClient.testMethodStatusMessage(request, ret);
  329. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  330. waiter.exec();
  331. ASSERT_STREQ(statusMessage.toStdString().c_str(), request.testFieldString().toStdString().c_str());
  332. delete ret;
  333. }
  334. TEST_F(ClientTest, StatusMessageClientSyncTestReturnedStatus)
  335. {
  336. TestServiceClient testClient;
  337. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  338. SimpleStringMessage request(QString{"Some status message"});
  339. QPointer<SimpleStringMessage> ret(new SimpleStringMessage);
  340. QEventLoop waiter;
  341. QString statusMessage;
  342. QGrpcStatus status = testClient.testMethodStatusMessage(request, ret);
  343. ASSERT_STREQ(status.message().toStdString().c_str(), request.testFieldString().toStdString().c_str());
  344. delete ret;
  345. }
  346. TEST_F(ClientTest, ClientSyncTestUnattachedChannel)
  347. {
  348. TestServiceClient testClient;
  349. SimpleStringMessage request(QString{"Some status message"});
  350. QPointer<SimpleStringMessage> ret(new SimpleStringMessage);
  351. QEventLoop waiter;
  352. QGrpcStatus status = testClient.testMethodStatusMessage(request, ret);
  353. ASSERT_EQ(status.code(), QGrpcStatus::Unknown);
  354. ASSERT_STREQ("No channel(s) attached.", status.message().toStdString().c_str());
  355. delete ret;
  356. }
  357. TEST_F(ClientTest, ClientSyncTestUnattachedChannelSignal)
  358. {
  359. TestServiceClient testClient;
  360. SimpleStringMessage request(QString{"Some status message"});
  361. QPointer<SimpleStringMessage> ret(new SimpleStringMessage);
  362. QGrpcStatus asyncStatus(QGrpcStatus::StatusCode::Ok);
  363. QEventLoop waiter;
  364. QObject::connect(&testClient, &TestServiceClient::error, [&asyncStatus, &waiter](const QGrpcStatus &status) {
  365. asyncStatus = status;
  366. waiter.quit();
  367. });
  368. testClient.testMethodStatusMessage(request, ret);
  369. QTimer::singleShot(20000, &waiter, &QEventLoop::quit);
  370. waiter.exec();
  371. ASSERT_EQ(asyncStatus, QGrpcStatus::Unknown);
  372. ASSERT_STREQ("No channel(s) attached.", asyncStatus.message().toStdString().c_str());
  373. delete ret;
  374. }
  375. TEST_F(ClientTest, AsyncReplySubscribeTest)
  376. {
  377. QTimer callTimeout;
  378. TestServiceClient testClient;
  379. testClient.attachChannel(std::make_shared<QGrpcHttp2Channel>(m_echoServerAddress, QGrpcInsecureCallCredentials() | QGrpcInsecureChannelCredentials()));
  380. SimpleStringMessage request(QString{"Some status message"});
  381. QGrpcStatus::StatusCode asyncStatus = QGrpcStatus::StatusCode::Ok;
  382. QEventLoop waiter;
  383. QString statusMessage;
  384. QObject::connect(&callTimeout, &QTimer::timeout, &waiter, &QEventLoop::quit);
  385. callTimeout.setInterval(5000);
  386. auto reply = testClient.testMethodStatusMessage(request);
  387. reply->subscribe(&m_app, []() {
  388. ASSERT_TRUE(false);
  389. },
  390. [&asyncStatus, &waiter, &statusMessage](const QGrpcStatus &status) {
  391. asyncStatus = status.code();
  392. statusMessage = status.message();
  393. waiter.quit();
  394. });
  395. callTimeout.start();
  396. waiter.exec();
  397. callTimeout.stop();
  398. ASSERT_STREQ(statusMessage.toStdString().c_str(), request.testFieldString().toStdString().c_str());
  399. SimpleStringMessage result;
  400. request.setTestFieldString("Hello beach!");
  401. reply = testClient.testMethod(request);
  402. reply->subscribe(&m_app, [reply, &result, &waiter]() {
  403. result = reply->read<SimpleStringMessage>();
  404. waiter.quit();
  405. });
  406. callTimeout.start();
  407. waiter.exec();
  408. callTimeout.stop();
  409. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), request.testFieldString().toStdString().c_str());
  410. result.setTestFieldString("");
  411. request.setTestFieldString("Hello beach1!");
  412. reply = testClient.testMethod(request);
  413. reply->subscribe(&m_app, [reply, &result, &waiter]() {
  414. result = reply->read<SimpleStringMessage>();
  415. waiter.quit();
  416. }, []() {
  417. ASSERT_TRUE(false);
  418. });
  419. callTimeout.start();
  420. waiter.exec();
  421. callTimeout.stop();
  422. ASSERT_STREQ(result.testFieldString().toStdString().c_str(), request.testFieldString().toStdString().c_str());
  423. }