summaryrefslogtreecommitdiff
path: root/tubes/qa
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-03-20 20:24:33 +0100
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:39:20 +0200
commit6b16cc2ca82027bac2306a062c6a61b5800e6853 (patch)
tree6978079549fc005b6952c83b6e19594002cac687 /tubes/qa
parent894151477330cea23f92247132c5c64065a2eb14 (diff)
restructure things to one account manager and one connection
tubes are offered and accepted now, sending/receiving works YAY! Thanks to Will Thompson from Collabora.
Diffstat (limited to 'tubes/qa')
-rw-r--r--tubes/qa/test_manager.cxx38
1 files changed, 32 insertions, 6 deletions
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx
index acf3da64bd78..07dd264d3b23 100644
--- a/tubes/qa/test_manager.cxx
+++ b/tubes/qa/test_manager.cxx
@@ -54,6 +54,7 @@ public:
void testStartBuddySession1();
void testStartBuddySession2();
void testSendPacket();
+ void testReceivePacket();
void testFlushLoops();
void testDestroyManager1();
void testDestroyManager2();
@@ -70,6 +71,7 @@ public:
CPPUNIT_TEST( testStartBuddySession1 );
CPPUNIT_TEST( testStartBuddySession2 );
CPPUNIT_TEST( testSendPacket );
+ CPPUNIT_TEST( testReceivePacket );
CPPUNIT_TEST( testFlushLoops );
CPPUNIT_TEST( testDestroyManager1 );
CPPUNIT_TEST( testDestroyManager2 );
@@ -91,6 +93,7 @@ static TeleManager* mpManager2 = NULL;
static rtl::OUString sAcc1( RTL_CONSTASCII_USTRINGPARAM( "libo1@localhost.localdomain"));
static rtl::OUString sAcc2( RTL_CONSTASCII_USTRINGPARAM( "libo2@localhost.localdomain"));
static rtl::OUString sService( RTL_CONSTASCII_USTRINGPARAM( "TeleTest"));
+static sal_uInt32 nSentPackets = 0;
TestTeleTubes::TestTeleTubes()
{
@@ -132,8 +135,8 @@ void TestTeleTubes::testStartBuddySession1()
void TestTeleTubes::testStartBuddySession2()
{
- bool bStarted = mpManager2->startBuddySession( sAcc1);
- CPPUNIT_ASSERT( bStarted == true);
+ //bool bStarted = mpManager2->startBuddySession( sAcc1);
+ //CPPUNIT_ASSERT( bStarted == true);
}
void TestTeleTubes::testConnect1()
@@ -144,15 +147,38 @@ void TestTeleTubes::testConnect1()
void TestTeleTubes::testConnect2()
{
- bool bConnected = mpManager2->connect();
- CPPUNIT_ASSERT( bConnected == true);
+ //bool bConnected = mpManager2->connect();
+ //CPPUNIT_ASSERT( bConnected == true);
}
void TestTeleTubes::testSendPacket()
{
TelePacket aPacket( "", RTL_CONSTASCII_STRINGPARAM( "from 1 to 2"));
- bool bPacketSent = mpManager1->sendPacket( aPacket);
- CPPUNIT_ASSERT( bPacketSent == true);
+ nSentPackets = mpManager1->sendPacket( aPacket);
+ CPPUNIT_ASSERT( nSentPackets == 2); // expect out+in conference, as own instance accepted self
+}
+
+void TestTeleTubes::testReceivePacket()
+{
+ TelePacket aPacket( "", RTL_CONSTASCII_STRINGPARAM( "from 1 to 2"));
+ TelePacket aReceived;
+ sal_uInt32 nReceivedPackets = 0;
+ bool bOk;
+ do
+ {
+ do
+ {
+ bOk = mpManager1->popPacket( aReceived);
+ if (bOk)
+ {
+ ++nReceivedPackets;
+ CPPUNIT_ASSERT( aPacket == aReceived);
+ }
+ } while (bOk);
+ if (nReceivedPackets < nSentPackets)
+ mpManager1->iterateLoop();
+ } while (nReceivedPackets < nSentPackets);
+ CPPUNIT_ASSERT( nReceivedPackets == nSentPackets);
}
void TestTeleTubes::testFlushLoops()