aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2015-09-03 11:03:18 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2015-09-03 11:10:11 +0200
commit1d828207bbab3b53ec251ac311d761a99e8977e5 (patch)
treecf5db603955197bab97255cba7766b410e69626f /tests
parenteea8f8509e4262d084e072e1bee2268ad384ec06 (diff)
downloadqxmpp-1d828207bbab3b53ec251ac311d761a99e8977e5.tar.gz
Add QXmppIceConnection::gatheringState property
Diffstat (limited to 'tests')
-rw-r--r--tests/qxmppiceconnection/tst_qxmppiceconnection.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/qxmppiceconnection/tst_qxmppiceconnection.cpp b/tests/qxmppiceconnection/tst_qxmppiceconnection.cpp
index 39a2359f..dd449726 100644
--- a/tests/qxmppiceconnection/tst_qxmppiceconnection.cpp
+++ b/tests/qxmppiceconnection/tst_qxmppiceconnection.cpp
@@ -51,7 +51,9 @@ void tst_QXmppIceConnection::testBind()
QXmppIceComponent *component = client.component(componentId);
QVERIFY(component);
+ QCOMPARE(client.gatheringState(), QXmppIceConnection::NewGatheringState);
client.bind(QXmppIceComponent::discoverAddresses());
+ QCOMPARE(client.gatheringState(), QXmppIceConnection::CompleteGatheringState);
QCOMPARE(client.localCandidates().size(), component->localCandidates().size());
QVERIFY(!client.localCandidates().isEmpty());
foreach (const QXmppJingleCandidate &c, client.localCandidates()) {
@@ -80,13 +82,17 @@ void tst_QXmppIceConnection::testBindStun()
QXmppIceComponent *component = client.component(componentId);
QVERIFY(component);
+ QCOMPARE(client.gatheringState(), QXmppIceConnection::NewGatheringState);
+ client.bind(QXmppIceComponent::discoverAddresses());
+ QCOMPARE(client.gatheringState(), QXmppIceConnection::BusyGatheringState);
+
QEventLoop loop;
- connect(&client, SIGNAL(localCandidatesChanged()),
+ connect(&client, SIGNAL(gatheringStateChanged()),
&loop, SLOT(quit()));
- client.bind(QXmppIceComponent::discoverAddresses());
loop.exec();
bool foundReflexive = false;
+ QCOMPARE(client.gatheringState(), QXmppIceConnection::CompleteGatheringState);
QCOMPARE(client.localCandidates().size(), component->localCandidates().size());
QVERIFY(!client.localCandidates().isEmpty());
foreach (const QXmppJingleCandidate &c, client.localCandidates()) {