aboutsummaryrefslogtreecommitdiff
path: root/tests/qxmpprtppacket
diff options
context:
space:
mode:
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>2019-05-17 14:30:02 -0700
committerLNJ <lnj@kaidan.im>2020-03-16 22:22:59 +0100
commit90036fc2cf5918c028f043edff7f5d38d1efb4cc (patch)
tree4818d8c4e6ec3778e2dd8a2e356faf1b9e062902 /tests/qxmpprtppacket
parentc67ccc6d939b8f1efd118f92baea997fe1b7f1a6 (diff)
downloadqxmpp-90036fc2cf5918c028f043edff7f5d38d1efb4cc.tar.gz
Port QXmppCallManager to use GStreamer
Diffstat (limited to 'tests/qxmpprtppacket')
-rw-r--r--tests/qxmpprtppacket/tst_qxmpprtppacket.cpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/tests/qxmpprtppacket/tst_qxmpprtppacket.cpp b/tests/qxmpprtppacket/tst_qxmpprtppacket.cpp
deleted file mode 100644
index 28d82204..00000000
--- a/tests/qxmpprtppacket/tst_qxmpprtppacket.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2008-2020 The QXmpp developers
- *
- * Author:
- * Jeremy Lainé
- *
- * Source:
- * https://github.com/qxmpp-project/qxmpp
- *
- * This file is a part of QXmpp library.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- */
-
-#include "QXmppRtpPacket.h"
-
-#include <QObject>
-#include <QtTest>
-
-class tst_QXmppRtpPacket : public QObject
-{
- Q_OBJECT
-
-private slots:
- void testBad();
- void testSimple();
- void testWithCsrc();
-};
-
-void tst_QXmppRtpPacket::testBad()
-{
- QXmppRtpPacket packet;
-
- // too short
- QCOMPARE(packet.decode(QByteArray()), false);
- QCOMPARE(packet.decode(QByteArray("\x80\x00\x3e", 3)), false);
- QCOMPARE(packet.decode(QByteArray("\x84\x00\x3e\xd2\x00\x00\x00\x90\x5f\xbd\x16\x9e", 12)), false);
-
- // wrong RTP version
- QCOMPARE(packet.decode(QByteArray("\x40\x00\x3e\xd2\x00\x00\x00\x90\x5f\xbd\x16\x9e", 12)), false);
-}
-
-void tst_QXmppRtpPacket::testSimple()
-{
- QByteArray data("\x80\x00\x3e\xd2\x00\x00\x00\x90\x5f\xbd\x16\x9e\x12\x34\x56", 15);
- QXmppRtpPacket packet;
- QCOMPARE(packet.decode(data), true);
- QCOMPARE(packet.marker(), false);
- QCOMPARE(packet.type(), quint8(0));
- QCOMPARE(packet.sequence(), quint16(16082));
- QCOMPARE(packet.stamp(), quint32(144));
- QCOMPARE(packet.ssrc(), quint32(1606227614));
- QCOMPARE(packet.csrc(), QList<quint32>());
- QCOMPARE(packet.payload(), QByteArray("\x12\x34\x56", 3));
- QCOMPARE(packet.encode(), data);
-}
-
-void tst_QXmppRtpPacket::testWithCsrc()
-{
- QByteArray data("\x82\x00\x3e\xd2\x00\x00\x00\x90\x5f\xbd\x16\x9e\xab\xcd\xef\x01\xde\xad\xbe\xef\x12\x34\x56", 23);
- QXmppRtpPacket packet;
- QCOMPARE(packet.decode(data), true);
- QCOMPARE(packet.marker(), false);
- QCOMPARE(packet.type(), quint8(0));
- QCOMPARE(packet.sequence(), quint16(16082));
- QCOMPARE(packet.stamp(), quint32(144));
- QCOMPARE(packet.ssrc(), quint32(1606227614));
- QCOMPARE(packet.csrc(), QList<quint32>() << quint32(0xabcdef01) << quint32(0xdeadbeef));
- QCOMPARE(packet.payload(), QByteArray("\x12\x34\x56", 3));
- QCOMPARE(packet.encode(), data);
-}
-
-QTEST_MAIN(tst_QXmppRtpPacket)
-#include "tst_qxmpprtppacket.moc"