Libtransport: Fix and enable rawXML tests

This commit is contained in:
Jan Kaluza 2016-02-06 07:57:48 +01:00
parent 2b768b45ac
commit 17f3dabe14
5 changed files with 6 additions and 9 deletions

View file

@ -96,6 +96,8 @@ class Frontend {
virtual std::string getRegistrationFields() { return "Jabber ID\n3rd-party network username\n3rd-party network password"; }
virtual bool handleAdminMessage(Swift::Message::ref /*message*/) { return false; }
virtual bool isRawXMLEnabled() { return false; }
boost::signal<void (User *, const std::string &name, unsigned int id)> onVCardRequired;
boost::signal<void (User *, boost::shared_ptr<Swift::VCard> vcard)> onVCardUpdated;
boost::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyUpdated;

View file

@ -101,10 +101,6 @@ namespace Transport {
Config *getConfig() { return m_config; }
bool isRawXMLEnabled() {
return m_rawXML;
}
/// It's emitted only for presences addressed to transport itself
/// (for example to="j2j.domain.tld") and for presences comming to
/// MUC (for example to="#chat%irc.freenode.org@irc.domain.tld")
@ -142,7 +138,6 @@ namespace Transport {
Swift::JID m_jid;
Factory *m_factory;
Swift::EventLoop *m_loop;
bool m_rawXML;
Frontend *m_frontend;
friend class User;

View file

@ -22,6 +22,7 @@
#include "transport/User.h"
#include "transport/RosterManager.h"
#include "transport/Transport.h"
#include "transport/Frontend.h"
namespace Transport {
@ -101,7 +102,7 @@ void LocalBuddy::setGroups(const std::vector<std::string> &groups) {
}
bool LocalBuddy::getStatus(Swift::StatusShow &status, std::string &statusMessage) {
if (getRosterManager()->getUser()->getComponent()->isRawXMLEnabled()) {
if (getRosterManager()->getUser()->getComponent()->getFrontend()->isRawXMLEnabled()) {
return false;
}
status = m_status;

View file

@ -43,7 +43,6 @@ Component::Component(Frontend *frontend, Swift::EventLoop *loop, Swift::NetworkF
m_factory = factory;
m_loop = loop;
m_userRegistry = userRegistry;
m_rawXML = false;
m_jid = Swift::JID(CONFIG_STRING(m_config, "service.jid"));
m_factories = factories;

View file

@ -42,8 +42,8 @@ class NetworkPluginServerTest : public CPPUNIT_NS :: TestFixture, public BasicTe
CPPUNIT_TEST(handleBuddyChangedPayloadUserContactInRoster);
CPPUNIT_TEST(handleMessageHeadline);
CPPUNIT_TEST(handleConvMessageAckPayload);
// CPPUNIT_TEST(handleRawXML);
// CPPUNIT_TEST(handleRawXMLSplit);
CPPUNIT_TEST(handleRawXML);
CPPUNIT_TEST(handleRawXMLSplit);
CPPUNIT_TEST(benchmarkHandleBuddyChangedPayload);
CPPUNIT_TEST(benchmarkSendUnavailablePresence);