From db2f84e966682c1072cd579baa9511906a276ab0 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Thu, 27 Sep 2012 15:06:55 +0200 Subject: start splitting tests --- tests/jingle.cpp | 137 ------------------------------------------------------- 1 file changed, 137 deletions(-) delete mode 100644 tests/jingle.cpp (limited to 'tests/jingle.cpp') diff --git a/tests/jingle.cpp b/tests/jingle.cpp deleted file mode 100644 index 842f0dd9..00000000 --- a/tests/jingle.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2008-2012 The QXmpp developers - * - * Author: - * Jeremy Lainé - * - * Source: - * http://code.google.com/p/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 "QXmppJingleIq.h" - -#include "jingle.h" -#include "tests.h" - -void TestJingle::testSession() -{ - const QByteArray xml( - "" - "" - "" - "" - "" - "" - "" - ""); - - QXmppJingleIq session; - parsePacket(session, xml); - QCOMPARE(session.action(), QXmppJingleIq::SessionInitiate); - QCOMPARE(session.initiator(), QLatin1String("romeo@montague.lit/orchard")); - QCOMPARE(session.sid(), QLatin1String("a73sjjvkla37jfea")); - QCOMPARE(session.content().creator(), QLatin1String("initiator")); - QCOMPARE(session.content().name(), QLatin1String("this-is-a-stub")); - QCOMPARE(session.reason().text(), QString()); - QCOMPARE(session.reason().type(), QXmppJingleIq::Reason::None); - serializePacket(session, xml); -} - -void TestJingle::testTerminate() -{ - const QByteArray xml( - "" - "" - "" - "" - "" - "" - ""); - - QXmppJingleIq session; - parsePacket(session, xml); - QCOMPARE(session.action(), QXmppJingleIq::SessionTerminate); - QCOMPARE(session.initiator(), QString()); - QCOMPARE(session.sid(), QLatin1String("a73sjjvkla37jfea")); - QCOMPARE(session.reason().text(), QString()); - QCOMPARE(session.reason().type(), QXmppJingleIq::Reason::Success); - serializePacket(session, xml); -} - -void TestJingle::testAudioPayloadType() -{ - const QByteArray xml(""); - QXmppJinglePayloadType payload; - parsePacket(payload, xml); - QCOMPARE(payload.id(), static_cast(103)); - QCOMPARE(payload.name(), QLatin1String("L16")); - QCOMPARE(payload.channels(), static_cast(2)); - QCOMPARE(payload.clockrate(), 16000u); - serializePacket(payload, xml); -} - -void TestJingle::testVideoPayloadType() -{ - const QByteArray xml( - "" - "" - "" - ""); - QXmppJinglePayloadType payload; - parsePacket(payload, xml); - QCOMPARE(payload.id(), static_cast(98)); - QCOMPARE(payload.name(), QLatin1String("theora")); - QCOMPARE(payload.clockrate(), 90000u); - QCOMPARE(payload.parameters().size(), 2); - QCOMPARE(payload.parameters().value("height"), QLatin1String("768")); - QCOMPARE(payload.parameters().value("width"), QLatin1String("1024")); - serializePacket(payload, xml); -} - -void TestJingle::testRinging() -{ - const QByteArray xml( - "" - "" - "" - "" - ""); - - QXmppJingleIq iq; - parsePacket(iq, xml); - QCOMPARE(iq.ringing(), true); - serializePacket(iq, xml); -} -- cgit v1.2.3