summaryrefslogtreecommitdiffstats
path: root/tests/auto/integration/tst_integration.cpp
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk.ford@kdab.com>2016-12-12 21:50:15 +0100
committerKevin Funk <kevin.funk@kdab.com>2016-12-19 14:19:00 +0000
commit68a7acc9a7a31085c989be4711c88f4979c9d7f4 (patch)
treed8f09dae40840511823d28ae317e4ac51afac306 /tests/auto/integration/tst_integration.cpp
parent9e402c6fb5cfa24d33ce008776e15ae24d094b38 (diff)
QRemoteObjectNode: Fix crash on bogus input
Make sure QtRemoteObjects does not crash if we pass invalid urls to the QRemoteObjectNode/QRemoteObjectHost constructor Change-Id: I6db749ac7901f989cfaa73084d88fbd763ad9178 Reviewed-by: Continuous Integration (KDAB) <build@kdab.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'tests/auto/integration/tst_integration.cpp')
-rw-r--r--tests/auto/integration/tst_integration.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/integration/tst_integration.cpp b/tests/auto/integration/tst_integration.cpp
index 45acee4..7e8dc77 100644
--- a/tests/auto/integration/tst_integration.cpp
+++ b/tests/auto/integration/tst_integration.cpp
@@ -448,6 +448,31 @@ private slots:
QCOMPARE(localCentre->data4(), QVector<int>() << 1 << 2 << 3 << 4 << 5);
}
+ void invalidUrlsTest()
+ {
+ const QUrl invalidUrl;
+ {
+ QRemoteObjectHost host(invalidUrl, registryUrl);
+ SET_NODE_NAME(host);
+ const bool res = host.waitForRegistry(3000);
+ QVERIFY(!res);
+ }
+
+ {
+ QRemoteObjectHost host(hostUrl, invalidUrl);
+ SET_NODE_NAME(host);
+ const bool res = host.waitForRegistry(3000);
+ QVERIFY(!res);
+ }
+
+ {
+ QRemoteObjectHost host(invalidUrl, invalidUrl);
+ SET_NODE_NAME(host);
+ const bool res = host.waitForRegistry(3000);
+ QVERIFY(!res);
+ }
+ }
+
void noRegistryTest()
{
QRemoteObjectHost host(hostUrl, registryUrl);