diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2015-08-17 10:44:36 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2015-08-17 10:44:36 +0200 |
| commit | 496d7e9c1a763124ec99039c150a96ceac595b6b (patch) | |
| tree | 235efe683125a70591feb7306a46410413c94b24 | |
| parent | 445fce6c3c4b72e960bc66da743ebdcab3db786c (diff) | |
| download | qxmpp-496d7e9c1a763124ec99039c150a96ceac595b6b.tar.gz | |
test QXmppJingleCandidate
| -rw-r--r-- | tests/qxmppjingleiq/tst_qxmppjingleiq.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp b/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp index e41194b8..c6f6ec6c 100644 --- a/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp +++ b/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp @@ -30,6 +30,7 @@ class tst_QXmppJingleIq : public QObject Q_OBJECT private slots: + void testCandidate(); void testSession(); void testTerminate(); void testAudioPayloadType(); @@ -37,6 +38,33 @@ private slots: void testRinging(); }; +void tst_QXmppJingleIq::testCandidate() +{ + const QByteArray xml( + "<candidate component=\"1\"" + " foundation=\"1\"" + " generation=\"0\"" + " id=\"el0747fg11\"" + " ip=\"10.0.1.1\"" + " network=\"1\"" + " port=\"8998\"" + " priority=\"2130706431\"" + " protocol=\"udp\"" + " type=\"host\"/>"); + + QXmppJingleCandidate candidate; + parsePacket(candidate, xml); + QCOMPARE(candidate.foundation(), QLatin1String("1")); + QCOMPARE(candidate.id(), QLatin1String("el0747fg11")); + QCOMPARE(candidate.host(), QHostAddress("10.0.1.1")); + QCOMPARE(candidate.network(), 1); + QCOMPARE(candidate.port(), quint16(8998)); + QCOMPARE(candidate.priority(), 2130706431); + QCOMPARE(candidate.protocol(), QLatin1String("udp")); + QCOMPARE(candidate.type(), QXmppJingleCandidate::HostType); + serializePacket(candidate, xml); +}; + void tst_QXmppJingleIq::testSession() { const QByteArray xml( |
