diff options
author | Lee Helpingstine <khelping@ford.com> | 2018-10-29 15:57:24 -0400 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-11-06 05:01:46 +0000 |
commit | 040b2aa6c117ec05320ebb07ce4f014dc66655d5 (patch) | |
tree | da1520e359d0d7b8e9f838b802e0a053046217c3 /tests | |
parent | 88673b336fd52c026134d1e348d12c310c48b1ac (diff) |
Break socket listen out of QRemoteObjectSourceIo constructorv5.12.0-beta4
The QRemoteObjectSourceIo constructor that accepted a host address
attempted to start listening on that address. This could result in an
invalid state with no way to propagate the error.
Change-Id: I80c103122794b164788702ba5c37fd10080e9ecd
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/integration/tst_integration.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/auto/integration/tst_integration.cpp b/tests/auto/integration/tst_integration.cpp index 8643002..5c42319 100644 --- a/tests/auto/integration/tst_integration.cpp +++ b/tests/auto/integration/tst_integration.cpp @@ -210,14 +210,14 @@ private slots: QTest::addColumn<QUrl>("hostUrl"); QTest::addColumn<QUrl>("registryUrl"); -#ifndef SKIP_LOCAL - QTest::newRow("local") << QUrl(QLatin1String("local:replica_local_integration")) << QUrl(QLatin1String("local:registry_local_integration")); -#endif QTest::newRow("tcp") << QUrl(QLatin1String("tcp://127.0.0.1:65511")) << QUrl(QLatin1String("tcp://127.0.0.1:65512")); - QTest::newRow("external") << QUrl() << QUrl(); #ifdef __QNXNTO__ QTest::newRow("qnx") << QUrl(QLatin1String("qnx:replica")) << QUrl(QLatin1String("qnx:registry")); #endif +#ifndef SKIP_LOCAL + QTest::newRow("local") << QUrl(QLatin1String("local:replica_local_integration")) << QUrl(QLatin1String("local:registry_local_integration")); +#endif + QTest::newRow("external") << QUrl() << QUrl(); } void initTestCase() @@ -1368,6 +1368,22 @@ private slots: QVERIFY(testServer.waitForFinished()); } #endif + + void tcpListenFailedTest() + { + QFETCH_GLOBAL(QUrl, registryUrl); + + if (registryUrl.scheme() != QRemoteObjectStringLiterals::tcp()) + QSKIP("Skipping test for local and external backends."); + + // Need the Host or Registry running so that the port is in use. + setupRegistry(); + QRemoteObjectHost badHost; + badHost.setHostUrl(registryUrl); + QCOMPARE(badHost.lastError(), QRemoteObjectNode::ListenFailed); + + } + }; QTEST_MAIN(tst_Integration) |