diff --git a/hudson-sflphone-script.sh b/hudson-sflphone-script.sh index 3cd75ab50037d7aeb13c501948e496f28c7f4cf1..a0b1ab68d1b99426cbeb8205cf90c1430f27b126 100755 --- a/hudson-sflphone-script.sh +++ b/hudson-sflphone-script.sh @@ -29,7 +29,7 @@ pushd sflphone-common/test rm -rf $XML_RESULTS make check # if at least one test failed, exit -./test --xml || exit 1 +CODECS_PATH="../src/audio/codecs" FAKE_PLUGIN_DIR="../src/plug-in/test/" FAKE_PLUGIN_NAME="../src/plug-in/test/libplugintest.so" ./test --xml || exit 1 popd # Compile the client diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 46e8ce2f93da78bc7c2efee7b7ae596d4f7ce070..4be631e4cd3c7bfccef393bcda5f3cb90e5245ec 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -547,8 +547,9 @@ sflphone_pick_up() calltree_update_call (history, selectedCall, NULL); // if instant messaging window is visible, create new tab (deleted automatically if not used) - if (im_window_is_visible()) + if (selectedCall->_im_widget && im_window_is_visible()) { im_widget_display ( (IMWidget **) (&selectedCall->_im_widget), NULL, selectedCall->_callID, NULL); + } dbus_accept (selectedCall); stop_notification(); @@ -1368,10 +1369,10 @@ void sflphone_fill_conference_list (void) void sflphone_fill_history (void) { - const gchar **entries; + const gchar **entries, **history_entries; gchar *current_entry; - callable_obj_t *history_entry; - callable_obj_t *call; + callable_obj_t *history_call, *call; + conference_obj_t *history_conf, *conf; QueueElement *element; guint i = 0, n = 0; @@ -1385,36 +1386,52 @@ void sflphone_fill_history (void) DEBUG("============================================ entry: %s", current_entry); - // do something with key and value - create_history_entry_from_serialized_form (current_entry, &history_entry); + if(g_str_has_prefix(current_entry, "9999")) { + // create a conference entry + create_conference_history_entry_from_serialized(current_entry, &history_conf); + + conf = conferencelist_get(history, history_conf->_confID); + if(conf == NULL) { + conferencelist_add(history, history_conf); + } + else { + conf->_recordfile = g_strdup(history_conf->_recordfile); + } + } + else { + + // do something with key and value + create_history_entry_from_serialized_form (current_entry, &history_call); - // Add it and update the GUI - calllist_add_call (history, history_entry); + // Add it and update the GUI + calllist_add_call (history, history_call); - if(history_entry->_confID && g_strcmp0(history_entry->_confID, "") != 0) { - conference_obj_t *conf; + if(history_call->_confID && g_strcmp0(history_call->_confID, "") != 0) { - DEBUG("----------------- conf id: %s", history_entry->_confID); + DEBUG("----------------- conf id: %s", history_call->_confID); - // process conference - conf = conferencelist_get(history, history_entry->_confID); - if(conf == NULL) { - // conference does not exist yet, create it - create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, history_entry->_confID, &conf); - conferencelist_add(history, conf); - } + // process conference + conf = conferencelist_get(history, history_call->_confID); + if(conf == NULL) { + // conference does not exist yet, create it + create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, history_call->_confID, &conf); + conferencelist_add(history, conf); + } - conference_add_participant(history_entry->_callID, conf); + conference_add_participant(history_call->_callID, conf); - // conference start timestamp corespond to - if(conf->_time_start > history_entry->_time_added) { - conf->_time_start = history_entry->_time_added; - } + // conference start timestamp corespond to + if(conf->_time_start > history_call->_time_added) { + conf->_time_start = history_call->_time_added; + } + } } entries++; } + entries = history_entries; + // fill n = calllist_get_size(history); DEBUG("CALL SIZE: %d", n); @@ -1445,6 +1462,7 @@ void sflphone_save_history (void) gint size; gint i; QueueElement *current; + conference_obj_t *conf; GHashTable *result = NULL; gchar **ordered_result; gchar *key, *value; @@ -1455,7 +1473,6 @@ void sflphone_save_history (void) g_hash_table_ref (result); size = calllist_get_size (history); - for (i = 0; i < size; i++) { current = calllist_get_nth (history, i); @@ -1482,6 +1499,20 @@ void sflphone_save_history (void) } } + size = conferencelist_get_size(history); + for(i = 0; i < size; i++) { + conf = conferencelist_get_nth(history, i); + if(conf == NULL) { + DEBUG("SFLphone: Error: Could not get %dth conference", i); + break; + } + value = serialize_history_conference_entry(conf); + key = convert_timestamp_to_gchar(conf->_time_start); + + g_hash_table_replace(result, (gpointer) key, + g_slist_append(g_hash_table_lookup(result, key), (gpointer) value)); + } + sflphone_order_history_hash_table(result, &ordered_result); gchar **testprnt = ordered_result; diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c index 107fb10b8ef771cd3728350462739cb36d20251f..015365fc4dd3def6c4b55c40906393415ea0f232 100644 --- a/sflphone-client-gnome/src/conference_obj.c +++ b/sflphone-client-gnome/src/conference_obj.c @@ -260,7 +260,7 @@ gchar *serialize_history_conference_entry(conference_obj_t *entry) DEBUG("Conference: Participant number: %s, concatenation: %s", tmp, participantstr); } - result = g_strconcat("2188", separator, + result = g_strconcat("9999", separator, participantstr, separator, // peer number peer_name, separator, time_start, separator, @@ -274,7 +274,7 @@ gchar *serialize_history_conference_entry(conference_obj_t *entry) return result; } -void create_conference_history_entry_from_serialized(gchar **ptr, conference_obj_t **conf) +void create_conference_history_entry_from_serialized(gchar *entry, conference_obj_t **conf) { history_state_t history_state = MISSED; gint token = 0; @@ -286,9 +286,12 @@ void create_conference_history_entry_from_serialized(gchar **ptr, conference_obj gchar *accountID = ""; gchar *recordfile = ""; const gchar *confID = ""; + gchar **ptr; + gchar *delim = "|"; DEBUG("Conference: Create a conference from serialized form"); + ptr = g_strsplit(entry, delim, 8); while(ptr != NULL && token < 8) { switch(token) { case 0: @@ -326,7 +329,7 @@ void create_conference_history_entry_from_serialized(gchar **ptr, conference_obj // create a new empty conference create_new_conference(state, confID, conf); - process_conference_participant_from_serialized(participant, *conf); + // process_conference_participant_from_serialized(participant, *conf); g_free(participant); } diff --git a/sflphone-client-gnome/src/conference_obj.h b/sflphone-client-gnome/src/conference_obj.h index 02208140ed81d35491aa6275ab1f91e55379cce4..927db5a42d53a548ad3a3a681ca07f10b4c80e92 100644 --- a/sflphone-client-gnome/src/conference_obj.h +++ b/sflphone-client-gnome/src/conference_obj.h @@ -56,7 +56,6 @@ typedef enum { * This struct holds information about a conference. */ typedef struct { - conference_state_t _state; // The state of the call gchar *_confID; // The call ID gboolean _conference_secured; // the security state of the conference @@ -87,6 +86,6 @@ void conference_participant_list_update (gchar**, conference_obj_t*); gchar *serialize_history_conference_entry(conference_obj_t *entry); -void create_conference_history_entry_from_serialized(gchar **, conference_obj_t **); +void create_conference_history_entry_from_serialized(gchar *, conference_obj_t **); #endif diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index d4483a019c708f9948a0f66f16a5679dd4231047..d7174bfb522652f6f21a572af97fea8d4606d915 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -298,7 +298,7 @@ row_activated (GtkTreeView *tree_view UNUSED, static void calltree_create_conf_from_participant_list(GSList *list) { - gchar **participant_list, participant_number; + gchar **participant_list; gint list_length = g_slist_length(list); gint i = 0; gint c = 0; @@ -329,7 +329,7 @@ calltree_create_conf_from_participant_list(GSList *list) { participant_list = (void *) realloc(participant_list, (c+1) *sizeof(void*)); *(participant_list+c) = NULL; - dbus_create_conf_from_participant_list(participant_list); + dbus_create_conf_from_participant_list((const gchar **)participant_list); } /* Catch cursor-activated signal. That is, when the entry is single clicked */ @@ -1444,7 +1444,7 @@ void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, G void calltree_add_history_conference(conference_obj_t *conf) { GdkPixbuf *pixbuf = NULL; - gchar *description = "Conference: ", *date = "", *duration = ""; + gchar *description = "Conference: ", *date = ""; GtkTreeIter iter; gchar *call_id; callable_obj_t *call; @@ -1454,7 +1454,7 @@ void calltree_add_history_conference(conference_obj_t *conf) ERROR("CallTree: Error conference is NULL"); } - DEBUG("---------------------------------------------------------- CallTree: Add conference %s to history", conf->_confID); + DEBUG("CallTree: Add conference %s to history", conf->_confID); gtk_tree_store_prepend(history->store, &iter, NULL); @@ -1501,23 +1501,17 @@ void calltree_display (calltab_t *tab) /* case 1: we want to display the main calltree */ if (tab==current_calls) { - DEBUG ("CallTree: Display main tab"); - if (active_calltree==contacts) { gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, FALSE); } else { gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton, FALSE); } - - // gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)currentCallsButton, TRUE); - } /* case 2: we want to display the history */ else if (tab == history) { - DEBUG ("ConferenceList: Display history tab"); if (active_calltree==contacts) { @@ -1528,7 +1522,6 @@ void calltree_display (calltab_t *tab) } else if (tab==contacts) { - DEBUG ("CallTree: Display contact tab"); if (active_calltree==history) { diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 1d3a5be2705827ea20d472eb500f754ab4635abb..1ef277a1cadf87035fec33e510a8fbe6abec52e8 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -101,8 +101,7 @@ update_actions() { DEBUG ("UIManager: Update action"); - - + gtk_action_set_sensitive (GTK_ACTION (newCallAction), TRUE); gtk_action_set_sensitive (GTK_ACTION (pickUpAction), FALSE); gtk_action_set_sensitive (GTK_ACTION (hangUpAction), FALSE); @@ -180,15 +179,14 @@ update_actions() gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (newCallWidget), 0); + if(is_inserted(GTK_WIDGET (playRecordWidget), GTK_WIDGET(toolbar))) + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(playRecordWidget)); + if(is_inserted(GTK_WIDGET (stopRecordWidget), GTK_WIDGET(toolbar))) + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(stopRecordWidget)); if (eel_gconf_get_integer (HISTORY_ENABLED)) { gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (historyButton), -1); gtk_widget_set_sensitive (GTK_WIDGET (historyButton), TRUE); - - if(is_inserted(GTK_WIDGET (playRecordWidget), GTK_WIDGET(toolbar))) - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(playRecordWidget)); - if(is_inserted(GTK_WIDGET (stopRecordWidget), GTK_WIDGET(toolbar))) - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(stopRecordWidget)); } // If addressbook support has been enabled and all addressbooks are loaded, display the icon @@ -271,10 +269,11 @@ update_actions() if (active_calltree == current_calls) gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - if (active_calltree == current_calls) + if (active_calltree == history) { gtk_action_set_sensitive (GTK_ACTION(playRecordAction), TRUE); + gtk_action_set_sensitive (GTK_ACTION(stopRecordAction), TRUE); + } - //gtk_action_set_sensitive( GTK_ACTION(newCallMenu),TRUE); g_object_ref (newCallWidget); gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), 0); @@ -385,6 +384,15 @@ update_actions() gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (imToolbar), 4); } } + else if(active_calltree == history) { + if(selectedConf->_recordfile && (g_strcmp0(selectedConf->_recordfile, "") != 0)) { + if(selectedConf->_record_is_playing) + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(stopRecordWidget), 3); + else + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(playRecordWidget), 3); + } + + } break; case CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD: case CONFERENCE_STATE_ACTIVE_DETACHED_RECORD: diff --git a/sflphone-common/src/audio/codecs/audiocodecfactory.cpp b/sflphone-common/src/audio/codecs/audiocodecfactory.cpp index e751d1cab51c1576cd592a900e74ee021d8cbe15..2dc459c41f762db96482334321b302de0886d608 100644 --- a/sflphone-common/src/audio/codecs/audiocodecfactory.cpp +++ b/sflphone-common/src/audio/codecs/audiocodecfactory.cpp @@ -192,9 +192,13 @@ std::vector<sfl::Codec*> AudioCodecFactory::scanCodecDirectory (void) std::string libDir = std::string (CODECS_DIR).append ("/"); std::string homeDir = std::string (HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR + "/"; + // look for a CODECS_PATH environment variable...used in tests + const char *envDir = getenv("CODECS_PATH"); std::vector<std::string> dirToScan; dirToScan.push_back (homeDir); dirToScan.push_back (libDir); + if (envDir) + dirToScan.push_back(std::string(envDir) + DIR_SEPARATOR_STR); for (i = 0 ; (unsigned int) i < dirToScan.size() ; i++) { std::string dirStr = dirToScan[i]; diff --git a/sflphone-common/src/history/historyitem.cpp b/sflphone-common/src/history/historyitem.cpp index 39c369577a6bb2c245ef2189c6b732edee093431..9a6d2647193c67bfe6c4bca0a69b7a7cbc210084 100644 --- a/sflphone-common/src/history/historyitem.cpp +++ b/sflphone-common/src/history/historyitem.cpp @@ -150,6 +150,7 @@ bool HistoryItem::save (Conf::ConfigTree **history) sectionstr = section.str(); _error("-- Unserialized type: %s", call_type.str().c_str()); + /* _error("-- Unserialized time start: %s", _timestamp_start.c_str()); _error("-- Unserialized time stop: %s", _timestamp_stop.c_str()); _error("-- Unserialized number: %s", _number.c_str()); @@ -159,7 +160,7 @@ bool HistoryItem::save (Conf::ConfigTree **history) _error("-- Unserialized record file: %s", _recording_file.c_str()); _error("-- Unserialized conference id:%s", _confID.c_str()); _error("-- Unserialized time added: %s", _timeAdded.c_str()); - + */ res = ( (*history)->setConfigTreeItem (sectionstr, "type", call_type.str()) && (*history)->setConfigTreeItem (sectionstr, "timestamp_start", _timestamp_start) @@ -171,7 +172,6 @@ bool HistoryItem::save (Conf::ConfigTree **history) && (*history)->setConfigTreeItem (sectionstr, "recordfile", _recording_file) && (*history)->setConfigTreeItem (sectionstr, "confid", _confID) && (*history)->setConfigTreeItem (sectionstr, "timeadded", _timeAdded)); - return res; } diff --git a/sflphone-common/src/plug-in/pluginmanager.cpp b/sflphone-common/src/plug-in/pluginmanager.cpp index 92027908a9a49eb16bc48ab1d24e73422ae87630..4789973859aeae904c9a0a3f3ba036d18dd92c83 100644 --- a/sflphone-common/src/plug-in/pluginmanager.cpp +++ b/sflphone-common/src/plug-in/pluginmanager.cpp @@ -56,6 +56,15 @@ PluginManager::~PluginManager() _instance = 0; } +namespace { +bool hasSharedExtension(const std::string &fn) +{ + size_t dot_position = fn.rfind("."); + return (dot_position != std::string::npos and + fn.substr(dot_position) == ".so"); +} +} + int PluginManager::loadPlugins (const std::string &path) { @@ -69,7 +78,10 @@ PluginManager::loadPlugins (const std::string &path) const std::string cDir = "."; /* The directory in which plugins are dropped. Default: /usr/lib/sflphone/plugins/ */ - (path == "") ? pluginDir = std::string (PLUGINS_DIR).append ("/") :pluginDir = path; + if (path.empty()) + pluginDir = std::string (PLUGINS_DIR).append("/"); + else + pluginDir = path; _debug ("Loading plugins from %s...", pluginDir.c_str()); dir = opendir (pluginDir.c_str()); @@ -80,9 +92,9 @@ PluginManager::loadPlugins (const std::string &path) while ( (dirStruct=readdir (dir))) { /* Get the name of the current item in the directory */ current = dirStruct->d_name; - /* Test if the current item is not the parent or the current directory */ + /* Test if the current item is not the parent or the current directory and that it ends with .so*/ - if (current != pDir && current != cDir) { + if (current != pDir && current != cDir and hasSharedExtension(current)) { /* Load the dynamic library */ library = loadDynamicLibrary (pluginDir + current); diff --git a/sflphone-common/test/Makefile.am b/sflphone-common/test/Makefile.am index 42741e2b361b03c89d7c8bed0c15e9935a852112..e62c988530a4f827fe03e1de6d1140924fcb1b50 100644 --- a/sflphone-common/test/Makefile.am +++ b/sflphone-common/test/Makefile.am @@ -1,5 +1,8 @@ include ../globals.mak +TESTS_ENVIRONMENT = CODECS_PATH="$(top_builddir)/src/audio/codecs" \ + FAKE_PLUGIN_DIR="$(top_builddir)/src/plug-in/test/" \ + FAKE_PLUGIN_NAME="$(top_builddir)/src/plug-in/test/libplugintest.so" check_PROGRAMS = test test_CXXFLAGS = $(CPPUNIT_CFLAGS) diff --git a/sflphone-common/test/pluginmanagertest.cpp b/sflphone-common/test/pluginmanagertest.cpp index 9182dab99a2afa91a27338fff6df4c930d4b288e..cffbf4c3bbaa7bcfe5285242b9a5fd5229f407e0 100644 --- a/sflphone-common/test/pluginmanagertest.cpp +++ b/sflphone-common/test/pluginmanagertest.cpp @@ -37,13 +37,13 @@ using std::cout; using std::endl; -#define PLUGIN_TEST_DIR "/usr/lib/sflphone/plugins/" -#define PLUGIN_TEST_DESC "mytest" -#define PLUGIN_TEST_NAME "/usr/lib/sflphone/plugins/libplugintest.so" +#define FAKE_PLUGIN_DESC "mytest" void PluginManagerTest::setUp() { + FAKE_PLUGIN_DIR = std::string(getenv("FAKE_PLUGIN_DIR")); + FAKE_PLUGIN_NAME = std::string(getenv("FAKE_PLUGIN_NAME")); // Instanciate the plugin manager singleton _pm = PluginManager::instance(); library = 0; @@ -54,14 +54,14 @@ void PluginManagerTest::testLoadDynamicLibrary() { _debug ("-------------------- PluginManagerTest::testLoadDynamicLibrary --------------------\n"); - CPPUNIT_ASSERT (_pm->loadDynamicLibrary (PLUGIN_TEST_NAME) != NULL); + CPPUNIT_ASSERT (_pm->loadDynamicLibrary (FAKE_PLUGIN_NAME) != NULL); } void PluginManagerTest::testUnloadDynamicLibrary() { _debug ("-------------------- PluginManagerTest::testUnloadDynamicLibrary --------------------\n"); - library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); + library = _pm->loadDynamicLibrary (FAKE_PLUGIN_NAME); CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->unloadDynamicLibrary (library) == 0); } @@ -70,7 +70,7 @@ void PluginManagerTest::testInstanciatePlugin() { _debug ("-------------------- PluginManagerTest::testInstanciatePlugin --------------------\n"); - library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); + library = _pm->loadDynamicLibrary (FAKE_PLUGIN_NAME); CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); CPPUNIT_ASSERT (plugin!=NULL); @@ -80,32 +80,31 @@ void PluginManagerTest::testInitPlugin() { _debug ("-------------------- PluginManagerTest::testInitPlugin --------------------\n"); - library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); + library = _pm->loadDynamicLibrary (FAKE_PLUGIN_NAME); CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); CPPUNIT_ASSERT (plugin!=NULL); - CPPUNIT_ASSERT (plugin->getPluginName() == PLUGIN_TEST_DESC); + CPPUNIT_ASSERT (plugin->getPluginName() == FAKE_PLUGIN_DESC); } void PluginManagerTest::testRegisterPlugin() { _debug ("-------------------- PluginManagerTest::testRegisterPlugin --------------------\n"); - library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); + library = _pm->loadDynamicLibrary (FAKE_PLUGIN_NAME); CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); - CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == false); + CPPUNIT_ASSERT (_pm->isPluginLoaded (FAKE_PLUGIN_DESC) == false); CPPUNIT_ASSERT (_pm->registerPlugin (plugin, library) == 0); - CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); + CPPUNIT_ASSERT (_pm->isPluginLoaded (FAKE_PLUGIN_DESC) == true); } void PluginManagerTest::testLoadPlugins () { _debug ("-------------------- PluginManagerTest::testLoadPlugins --------------------\n"); try { - - CPPUNIT_ASSERT (_pm->loadPlugins (PLUGIN_TEST_DIR) == 0); - CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); + CPPUNIT_ASSERT (_pm->loadPlugins (FAKE_PLUGIN_DIR) == 0); + CPPUNIT_ASSERT (_pm->isPluginLoaded (FAKE_PLUGIN_DESC) == true); } catch (LibraryManagerException &e){ @@ -118,10 +117,10 @@ void PluginManagerTest::testUnloadPlugins () try { - CPPUNIT_ASSERT (_pm->loadPlugins (PLUGIN_TEST_DIR) == 0); - CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); + CPPUNIT_ASSERT (_pm->loadPlugins (FAKE_PLUGIN_DIR) == 0); + CPPUNIT_ASSERT (_pm->isPluginLoaded (FAKE_PLUGIN_DESC) == true); CPPUNIT_ASSERT (_pm->unloadPlugins () == 0); - CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == false); + CPPUNIT_ASSERT (_pm->isPluginLoaded (FAKE_PLUGIN_DESC) == false); } catch (LibraryManagerException &e) { diff --git a/sflphone-common/test/pluginmanagertest.h b/sflphone-common/test/pluginmanagertest.h index 35da2468f7a989857d2609c6240168cda4c1d171..2a2e78bf7815452763a334dad1bed040a2ec360d 100644 --- a/sflphone-common/test/pluginmanagertest.h +++ b/sflphone-common/test/pluginmanagertest.h @@ -94,6 +94,8 @@ class PluginManagerTest : public CppUnit::TestCase { void testUnloadPlugins (); private: + std::string FAKE_PLUGIN_DIR; + std::string FAKE_PLUGIN_NAME; PluginManager *_pm; LibraryManager *library; Plugin *plugin; diff --git a/sflphone-common/test/run_tests.sh b/sflphone-common/test/run_tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..a2ce661b7cb87c3b5dd5578e10c88ce90faf1f96 --- /dev/null +++ b/sflphone-common/test/run_tests.sh @@ -0,0 +1,2 @@ +#!/bin/bash +CODECS_PATH="../src/audio/codecs" FAKE_PLUGIN_DIR="../src/plug-in/test/" FAKE_PLUGIN_NAME="../src/plug-in/test/libplugintest.so" ./test --xml || exit 1