From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../oscar/liboscar/tests/clientstream_test.cpp | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 kopete/protocols/oscar/liboscar/tests/clientstream_test.cpp (limited to 'kopete/protocols/oscar/liboscar/tests/clientstream_test.cpp') diff --git a/kopete/protocols/oscar/liboscar/tests/clientstream_test.cpp b/kopete/protocols/oscar/liboscar/tests/clientstream_test.cpp new file mode 100644 index 00000000..59f392de --- /dev/null +++ b/kopete/protocols/oscar/liboscar/tests/clientstream_test.cpp @@ -0,0 +1,49 @@ +//Licensed under the GNU General Public License + +#include "clientstream_test.h" + +ClientStreamTest::ClientStreamTest(int argc, char ** argv) : QApplication( argc, argv ) +{ + // set up client stream + myConnector = new KNetworkConnector( 0 ); + //myConnector->setOptHostPort( "localhost", 8300 ); + myConnector->setOptHostPort( "login.oscar.aol.com", 5190 ); + myTestObject = new ClientStream( myConnector, myConnector); + // notify when the transport layer is connected + connect( myTestObject, SIGNAL( connected() ), SLOT( slotConnected() ) ); + // notify and start sending + //connect( myTestObject, SIGNAL( warning(int) ), SLOT( slotWarning(int) ) ); + + // do test once the event loop is running + QTimer::singleShot( 0, this, SLOT( slotDoTest() ) ); + connected = false; +} + +ClientStreamTest::~ClientStreamTest() +{ + delete myTestObject; + delete myConnector; +} + +void ClientStreamTest::slotDoTest() +{ + QString server = QString::fromLatin1("login.oscar.aol.com"); + // connect to server + qDebug( "connecting to server "); + myTestObject->connectToServer( server, true ); // fine up to here... +} + +void ClientStreamTest::slotConnected() +{ + qDebug( "connection is up"); + connected = true; +} + +int main(int argc, char ** argv) +{ + ClientStreamTest a( argc, argv ); + a.exec(); + return 0; +} + +#include "clientstream_test.moc" -- cgit v1.2.1