From a7963958d9a649dd77c22e65edcf35210a1f66c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sat, 11 Jul 2009 16:35:20 +0200 Subject: Use ClientXMLTracer in ClientTest. diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp index d3e8c67..163eacd 100644 --- a/Swiften/QA/ClientTest/ClientTest.cpp +++ b/Swiften/QA/ClientTest/ClientTest.cpp @@ -6,6 +6,7 @@ #include "Swiften/EventLoop/MainEventLoop.h" #include "Swiften/EventLoop/SimpleEventLoop.h" #include "Swiften/Queries/Requests/GetRosterRequest.h" +#include "Swiften/Client/ClientXMLTracer.h" using namespace Swift; @@ -14,14 +15,6 @@ SimpleEventLoop eventLoop; Client* client = 0; bool rosterReceived = false; -void printIncomingData(const String& data) { - std::cout << "<- " << data << std::endl; -} - -void printOutgoingData(const String& data) { - std::cout << "-> " << data << std::endl; -} - void handleRosterReceived(boost::shared_ptr) { rosterReceived = true; eventLoop.stop(); @@ -46,9 +39,8 @@ int main(int, char**) { } client = new Swift::Client(JID(jid), String(pass)); + ClientXMLTracer* tracer = new ClientXMLTracer(client); client->onConnected.connect(&handleConnected); - client->onDataRead.connect(&printIncomingData); - client->onDataWritten.connect(&printOutgoingData); client->connect(); { @@ -58,6 +50,7 @@ int main(int, char**) { eventLoop.run(); } + delete tracer; delete client; return !rosterReceived; } -- cgit v0.10.2-6-g49f6