aboutsummaryrefslogtreecommitdiff
path: root/tests/qxmppjingleiq
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qxmppjingleiq')
-rw-r--r--tests/qxmppjingleiq/tst_qxmppjingleiq.cpp28
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(