summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-09-27 22:24:51 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-09-27 22:31:52 +0200
commit4e6907b5d526241c93767fd25d8c2866c034a8d8 (patch)
tree1d6ced1d975af971f2a8d3773e18fc2a3a20d676 /tubes
parent4917f0ceb2a7b1bb3ba878373f71f38d156278af (diff)
tubes: let's use ctor, dtor and less methods in the test
They are not independent anyway. This way it may fail only once in constructor and avoid segmentation faults. Change-Id: I304f688b187f9870bf664517112550ad9a2a87c7
Diffstat (limited to 'tubes')
-rw-r--r--tubes/qa/test_manager.cxx28
1 files changed, 7 insertions, 21 deletions
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx
index 2ccbe329ef34..6296eb39eca1 100644
--- a/tubes/qa/test_manager.cxx
+++ b/tubes/qa/test_manager.cxx
@@ -49,25 +49,17 @@ class TestTeleTubes: public CppUnit::TestFixture
{
public:
- TestTeleTubes() {}
- ~TestTeleTubes() {}
+ TestTeleTubes();
+ ~TestTeleTubes();
// This could happen in costructor wasn't there TestTeleTubes instance for each test:
- void testInitialize();
- void testInitTeleManager();
void testContactList();
- void testStartBuddySession();
- void testSendPacket();
- void testDestroyTeleTubes();
+ void testSession();
void testFailAlways();
// Order is significant.
CPPUNIT_TEST_SUITE( TestTeleTubes );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testInitTeleManager );
CPPUNIT_TEST( testContactList );
- CPPUNIT_TEST( testStartBuddySession );
- CPPUNIT_TEST( testSendPacket );
- CPPUNIT_TEST( testDestroyTeleTubes );
+ CPPUNIT_TEST( testSession );
#if 0
CPPUNIT_TEST( testFailAlways ); // test failure displays SAL_LOG, uncomment for debugging
#endif
@@ -105,7 +97,7 @@ static gboolean timed_out( void * )
return FALSE;
}
-void TestTeleTubes::testInitialize()
+TestTeleTubes::TestTeleTubes()
{
g_timeout_add_seconds (10, timed_out, NULL);
try
@@ -135,10 +127,7 @@ void TestTeleTubes::testInitialize()
mpCollaboration1 = new TestCollaboration();
mpCollaboration2 = new TestCollaboration();
-}
-void TestTeleTubes::testInitTeleManager()
-{
CPPUNIT_ASSERT( TeleManager::init( true));
}
@@ -189,7 +178,7 @@ static void lcl_FileSent( bool success, void * )
}
*/
-void TestTeleTubes::testStartBuddySession()
+void TestTeleTubes::testSession()
{
TeleConference* pConference = NULL;
CPPUNIT_ASSERT( mpOffererAccount != 0);
@@ -209,17 +198,14 @@ void TestTeleTubes::testStartBuddySession()
pConference = TeleManager::getConference();
CPPUNIT_ASSERT( pConference != NULL);
mpCollaboration2->SetConference( pConference );
-}
-void TestTeleTubes::testSendPacket()
-{
mpCollaboration1->SendPacket( "from 1 to 2");
while (!mbPacketReceived)
g_main_context_iteration( NULL, TRUE);
}
-void TestTeleTubes::testDestroyTeleTubes()
+TestTeleTubes::~TestTeleTubes()
{
if (mpOffererAccount) {
g_object_unref(mpOffererAccount);