Skip to content
Snippets Groups Projects
Commit f8f07467 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

add load/unload sip account tests

parent 81956b96
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <sstream>
#include "configurationTest.h" #include "configurationTest.h"
...@@ -26,7 +27,7 @@ using std::endl; ...@@ -26,7 +27,7 @@ using std::endl;
void ConfigurationTest::setUp(){ void ConfigurationTest::setUp(){
// Load the default configuration // Load the default configuration
Manager::instance().initConfigFile(false); Manager::instance().initConfigFile();
} }
void ConfigurationTest::testDefaultValueAudio(){ void ConfigurationTest::testDefaultValueAudio(){
...@@ -63,7 +64,40 @@ void ConfigurationTest::testDefaultValueSignalisation(){ ...@@ -63,7 +64,40 @@ void ConfigurationTest::testDefaultValueSignalisation(){
CPPUNIT_ASSERT( Manager::instance().getConfigString( SIGNALISATION , SEND_DTMF_AS ) == SIP_INFO_STR ); CPPUNIT_ASSERT( Manager::instance().getConfigString( SIGNALISATION , SEND_DTMF_AS ) == SIP_INFO_STR );
} }
void ConfigurationTest::testLoadAccountMap(){ void ConfigurationTest::testLoadSIPAccount(){
AccountMap accounts;
Account *current;
std::ostringstream ss;
// Load the accounts from the user file
Manager::instance().loadAccountMap();
// Save the account information
accounts = Manager::instance()._accountMap;
AccountMap::iterator iter = accounts.begin();
while( iter != accounts.end() ){
current = iter->second;
CPPUNIT_ASSERT( iter->first == current->getAccountID() );
CPPUNIT_ASSERT( 0 == current->getVoIPLink() );
iter++;
}
}
void ConfigurationTest::testUnloadSIPAccount(){
AccountMap accounts;
// Load the accounts from the user file
Manager::instance().loadAccountMap(); Manager::instance().loadAccountMap();
// Unload the accounts
Manager::instance().unloadAccountMap();
// Save the account information
accounts = Manager::instance()._accountMap;
AccountMap::iterator iter = accounts.begin();
if( iter != accounts.end() ){
CPPUNIT_FAIL("Unload account map failed\n");
}
} }
...@@ -48,7 +48,8 @@ class ConfigurationTest : public CppUnit::TestCase { ...@@ -48,7 +48,8 @@ class ConfigurationTest : public CppUnit::TestCase {
CPPUNIT_TEST( testDefaultValueAudio ); CPPUNIT_TEST( testDefaultValueAudio );
CPPUNIT_TEST( testDefaultValuePreferences ); CPPUNIT_TEST( testDefaultValuePreferences );
CPPUNIT_TEST( testDefaultValueSignalisation ); CPPUNIT_TEST( testDefaultValueSignalisation );
CPPUNIT_TEST( testLoadAccountMap ); CPPUNIT_TEST( testLoadSIPAccount );
CPPUNIT_TEST( testUnloadSIPAccount );
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
public: public:
...@@ -80,7 +81,8 @@ class ConfigurationTest : public CppUnit::TestCase { ...@@ -80,7 +81,8 @@ class ConfigurationTest : public CppUnit::TestCase {
void testDefaultValueSignalisation(); void testDefaultValueSignalisation();
void testLoadAccountMap(); void testLoadSIPAccount();
void testUnloadSIPAccount();
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment