diff --git a/.github/workflows/L1-tests.yml b/.github/workflows/L1-tests.yml index 763dd138..7d794abe 100755 --- a/.github/workflows/L1-tests.yml +++ b/.github/workflows/L1-tests.yml @@ -138,7 +138,7 @@ jobs: with: repository: rdkcentral/entservices-casting path: entservices-casting - ref: develop + ref: test_malloc - name: Checkout googletest if: steps.cache.outputs.cache-hit != 'true' diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 2c7fae38..478331c4 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -46,14 +46,15 @@ MiracastController *MiracastController::getInstance(MiracastError &error_code, M void MiracastController::destroyInstance() { - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); if (nullptr != m_miracast_ctrl_obj) { m_miracast_ctrl_obj->destroy_ControllerFramework(); delete m_miracast_ctrl_obj; m_miracast_ctrl_obj = nullptr; } - MIRACASTLOG_TRACE("Exiting..."); + + MIRACASTLOG_INFO("Exiting..."); } MiracastController::MiracastController(void) @@ -71,7 +72,7 @@ MiracastController::MiracastController(void) MiracastController::~MiracastController() { - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); while (!m_deviceInfoList.empty()) { @@ -85,13 +86,17 @@ MiracastController::~MiracastController() m_groupInfo = nullptr; } - MIRACASTLOG_TRACE("Exiting..."); + + + // ControllerThreadCallback(this); + //destroy_ControllerFramework(); + MIRACASTLOG_INFO("Exiting..."); } MiracastError MiracastController::create_ControllerFramework(std::string p2p_ctrl_iface) { MiracastError ret_code = MIRACAST_OK; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering...start controller thread"); m_controller_thread = new MiracastThread(CONTROLLER_THREAD_NAME, CONTROLLER_THREAD_STACK, @@ -503,7 +508,7 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le std::string event_buffer; MIRACASTLOG_TRACE("Entering..."); - event_buffer = (char *)data; + event_buffer = static_cast(data); free(data); if ( false == m_start_discovering_enabled ) @@ -518,8 +523,8 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le controller_msgq_data.state = convertP2PtoSessionActions(eventId); strncpy(controller_msgq_data.msg_buffer, event_buffer.c_str(), sizeof(controller_msgq_data.msg_buffer)); controller_msgq_data.msg_buffer[sizeof(controller_msgq_data.msg_buffer) - 1] = '\0'; - - MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s ", controller_msgq_data.state, event_buffer.c_str()); + + MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s len %d", controller_msgq_data.state, event_buffer.c_str(),len); m_controller_thread->send_message(&controller_msgq_data, sizeof(controller_msgq_data)); MIRACASTLOG_VERBOSE("event received : %d buffer:%s ", eventId, event_buffer.c_str()); } @@ -642,7 +647,7 @@ bool MiracastController::get_connection_status() void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::string authType,std::string modelName,std::string deviceType, bool force_overwrite) { bool new_device_entry = false; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); DeviceInfo *cur_device_info_ptr = MiracastController::get_device_details(deviceMAC); // Allocate memory and update the device cache info @@ -651,7 +656,7 @@ void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::strin cur_device_info_ptr = new DeviceInfo; new_device_entry = true; force_overwrite = true; - MIRACASTLOG_VERBOSE("#### Creating Device Cache ####"); + MIRACASTLOG_INFO("#### Creating Device Cache ####"); } if (( nullptr != cur_device_info_ptr ) && (force_overwrite)) @@ -673,16 +678,17 @@ void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::strin { m_deviceInfoList.push_back(cur_device_info_ptr); } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); } DeviceInfo *MiracastController::get_device_details(std::string MAC) { DeviceInfo *deviceInfo = nullptr; std::size_t found; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); for (auto device : m_deviceInfoList) { + MIRACASTLOG_INFO("Entering device info list"); found = device->deviceMAC.find(MAC); if (found != std::string::npos) { @@ -690,7 +696,7 @@ DeviceInfo *MiracastController::get_device_details(std::string MAC) break; } } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); return deviceInfo; } @@ -784,19 +790,19 @@ void MiracastController::Controller_Thread(void *args) session_restart_required = false, p2p_group_instance_alive = false; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); while (nullptr != m_controller_thread) { std::string event_buffer; event_buffer.clear(); - MIRACASTLOG_TRACE("!!! Waiting for Event !!!\n"); + MIRACASTLOG_INFO("!!! Waiting for Event !!!\n"); m_controller_thread->receive_message(&controller_msgq_data, CONTROLLER_MSGQ_SIZE, THREAD_RECV_MSG_INDEFINITE_WAIT); event_buffer = controller_msgq_data.msg_buffer; - MIRACASTLOG_TRACE("!!! Received Action[%#08X]Data[%s] !!!\n", controller_msgq_data.state, event_buffer.c_str()); + MIRACASTLOG_INFO("!!! Received Action[%#08X]Data[%s] !!!\n", controller_msgq_data.state, event_buffer.c_str()); if (CONTROLLER_SELF_ABORT == controller_msgq_data.state) { @@ -1099,6 +1105,7 @@ void MiracastController::Controller_Thread(void *args) else { error_code = WPEFramework::Exchange::IMiracastService::REASON_CODE_GENERIC_FAILURE; + MIRACASTLOG_INFO("predebug session restart"); session_restart_required = true; MIRACASTLOG_ERROR("!!!! Unable to get the Source Device IP and Terminating Group Here !!!!"); remove_P2PGroupInstance(); @@ -1124,6 +1131,7 @@ void MiracastController::Controller_Thread(void *args) p2p_group_instance_alive = false; } m_connect_req_notified = false; + MIRACASTLOG_ERROR("####exit from failure condition"); } if ( true == session_restart_required ) @@ -1142,6 +1150,7 @@ void MiracastController::Controller_Thread(void *args) session_restart_required = false; } } + MIRACASTLOG_ERROR("####exit from CONTROLLER_GO_GROUP_FORMATION_FAILURE"); break; case CONTROLLER_GO_GROUP_REMOVED: { @@ -1247,6 +1256,7 @@ void MiracastController::Controller_Thread(void *args) } new_thunder_req_client_connection_sent = false; another_thunder_req_client_connection_sent = false; + MIRACASTLOG_INFO("predebug session_restart_required\n"); session_restart_required = true; p2p_group_instance_alive = false; m_connect_req_notified = false; @@ -1336,7 +1346,8 @@ void MiracastController::Controller_Thread(void *args) MIRACASTLOG_ERROR("!!! Invalid MsgType Received[%#08X]Data[%s] !!!", controller_msgq_data.msg_type, event_buffer.c_str()); } break; - } + } + MIRACASTLOG_ERROR("!!! exit from outer switch"); } MIRACASTLOG_TRACE("Exiting..."); } @@ -1605,10 +1616,10 @@ void ControllerThreadCallback(void *args) { MiracastController *miracast_ctrler_obj = (MiracastController *)args; MIRACASTLOG_TRACE("Entering..."); - sleep(1); + sleep(1); if ( nullptr != miracast_ctrler_obj ) { miracast_ctrler_obj->Controller_Thread(nullptr); } MIRACASTLOG_TRACE("Exiting..."); -} \ No newline at end of file +} diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index c3d401b9..5f0105c6 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -99,7 +99,7 @@ namespace WPEFramework Exchange::JMiracastService::Register(*this, mMiracastServiceImpl); mRegisterEvents = true; } - mConfigure->Release(); + //mConfigure->Release(); } else { @@ -130,7 +130,7 @@ namespace WPEFramework void MiracastService::Deinitialize(PluginHost::IShell* service) { SYSLOG(Logging::Startup, (_T("MiracastService::Deinitialize: PID=%u"), getpid())); - + LOGINFO("MiracastService::Deinitialize in"); ASSERT(mCurrentService == service); ASSERT(0 == mConnectionId); @@ -172,11 +172,20 @@ namespace WPEFramework if (nullptr != mCurrentService) { /* Make sure the Activated and Deactivated are no longer called before we start cleaning up.. */ - mCurrentService->Unregister(&mMiracastServiceNotification); - mCurrentService->Release(); - mCurrentService = nullptr; - } + mCurrentService->Unregister(&mMiracastServiceNotification); + + if (mConfigure) + { + uint32_t result = mConfigure->Configure(NULL); + if (result == Core::ERROR_NONE) { + SYSLOG(Logging::Shutdown, (string(_T("MiracastService successfully destructed")))); + } + mConfigure->Release(); + mConfigure = NULL; + } + } mConnectionId = 0; + SYSLOG(Logging::Shutdown, (string(_T("MiracastService de-initialised")))); } @@ -194,4 +203,4 @@ namespace WPEFramework } } } // namespace Plugin -} // namespace WPEFramework \ No newline at end of file +} // namespace WPEFramework diff --git a/Miracast/MiracastService/MiracastServiceImplementation.cpp b/Miracast/MiracastService/MiracastServiceImplementation.cpp index cab5df0f..c14e8861 100644 --- a/Miracast/MiracastService/MiracastServiceImplementation.cpp +++ b/Miracast/MiracastService/MiracastServiceImplementation.cpp @@ -66,54 +66,7 @@ namespace WPEFramework MiracastServiceImplementation::~MiracastServiceImplementation() { - LOGINFO("Call MiracastServiceImplementation destructor"); - if (m_FriendlyNameMonitorTimerID) - { - g_source_remove(m_FriendlyNameMonitorTimerID); - m_FriendlyNameMonitorTimerID = 0; - } - remove_wifi_connection_state_timer(); - remove_miracast_connection_timer(); - - if (_powerManagerPlugin) - { - _powerManagerPlugin->Unregister(_pwrMgrNotification.baseInterface()); - _powerManagerPlugin.Reset(); - } - _registeredEventHandlers = false; - - if (m_WiFiPluginObj) - { - m_WiFiPluginObj->Unsubscribe(1000, _T("onWIFIStateChanged")); - delete m_WiFiPluginObj; - m_WiFiPluginObj = nullptr; - } - - if (m_SystemPluginObj) - { - m_SystemPluginObj->Unsubscribe(1000, _T("onFriendlyNameChanged")); - delete m_SystemPluginObj; - m_SystemPluginObj = nullptr; - } - - MIRACASTLOG_INFO("Disconnect from the COM-RPC socket"); - - if (m_isServiceInitialized) - { - MiracastController::destroyInstance(); - m_CurrentService = nullptr; - m_miracast_ctrler_obj = nullptr; - m_isServiceInitialized = false; - m_isServiceEnabled = false; - MIRACASTLOG_INFO("Done..!!!"); - } - if(m_CurrentService) - { - m_CurrentService->Release(); - m_CurrentService = nullptr; - } - MIRACAST::logger_deinit(); - MiracastServiceImplementation::_instance = nullptr; + } /** @@ -319,13 +272,16 @@ namespace WPEFramework void MiracastServiceImplementation::dispatchEvent(Event event, const JsonObject ¶ms) { + MIRACASTLOG_TRACE("Entering ..."); Core::IWorkerPool::Instance().Submit(Job::Create(this, event, params)); + MIRACASTLOG_TRACE("Exiting ..."); } void MiracastServiceImplementation::Dispatch(Event event,const JsonObject& params) { + MIRACASTLOG_TRACE("Entering ..."); _adminLock.Lock(); - + MIRACASTLOG_TRACE("get lock ..."); std::list::const_iterator index(_miracastServiceNotification.begin()); switch (event) @@ -425,6 +381,7 @@ namespace WPEFramework break; } _adminLock.Unlock(); + MIRACASTLOG_TRACE("Exiting ..."); } /* COMRPC Methods Start */ @@ -433,10 +390,62 @@ namespace WPEFramework { MIRACASTLOG_TRACE("Entering ..."); uint32_t result = Core::ERROR_GENERAL; + + if ((m_CurrentService) && (nullptr == service)) + { + LOGINFO("Call MiracastServiceImplementation destructor"); + if (m_FriendlyNameMonitorTimerID) + { + g_source_remove(m_FriendlyNameMonitorTimerID); + m_FriendlyNameMonitorTimerID = 0; + } + remove_wifi_connection_state_timer(); + remove_miracast_connection_timer(); + + if (_powerManagerPlugin) + { + _powerManagerPlugin->Unregister(_pwrMgrNotification.baseInterface()); + _powerManagerPlugin.Reset(); + } + _registeredEventHandlers = false; - ASSERT(nullptr != service); + if (m_WiFiPluginObj) + { + m_WiFiPluginObj->Unsubscribe(1000, _T("onWIFIStateChanged")); + delete m_WiFiPluginObj; + m_WiFiPluginObj = nullptr; + } - m_CurrentService = service; + if (m_SystemPluginObj) + { + m_SystemPluginObj->Unsubscribe(1000, _T("onFriendlyNameChanged")); + delete m_SystemPluginObj; + m_SystemPluginObj = nullptr; + } + + MIRACASTLOG_INFO("Disconnect from the COM-RPC socket"); + + if (m_isServiceInitialized) + { + MiracastController::destroyInstance(); + m_CurrentService = nullptr; + m_miracast_ctrler_obj = nullptr; + m_isServiceInitialized = false; + m_isServiceEnabled = false; + MIRACASTLOG_INFO("Done..!!!"); + } + if(m_CurrentService) + { + m_CurrentService->Release(); + m_CurrentService = nullptr; + } + MIRACAST::logger_deinit(); + MiracastServiceImplementation::_instance = nullptr; + result = Core::ERROR_NONE; + } + else if ((service) && ( nullptr == m_CurrentService )) + { + m_CurrentService = service; if (nullptr != m_CurrentService) { @@ -511,6 +520,9 @@ namespace WPEFramework } } } + } else { + ASSERT(nullptr != service); + } MIRACASTLOG_TRACE("Exiting ..."); return result; } @@ -857,6 +869,7 @@ namespace WPEFramework eventDetails["source_dev_name"] = client_name; eventDetails["reason_code"] = static_cast(reason_code); dispatchEvent(MIRACASTSERVICE_EVENT_CLIENT_CONNECTION_ERROR, eventDetails); + MIRACASTLOG_TRACE("dispatched ..."); } MIRACASTLOG_TRACE("Exiting ..."); } @@ -1233,4 +1246,4 @@ namespace WPEFramework /* Internal Timer Callback and methods End */ /* ------------------------------------------------------------------------------------------------------- */ } // namespace Plugin -} // namespace WPEFramework \ No newline at end of file +} // namespace WPEFramework diff --git a/Miracast/MiracastService/P2P/MiracastP2P.cpp b/Miracast/MiracastService/P2P/MiracastP2P.cpp index 2a87a470..b087b015 100644 --- a/Miracast/MiracastService/P2P/MiracastP2P.cpp +++ b/Miracast/MiracastService/P2P/MiracastP2P.cpp @@ -361,16 +361,17 @@ int MiracastP2P::p2pExecute(char *cmd, enum INTERFACE iface, char *ret_buf, size MiracastError MiracastP2P::executeCommand(std::string command, int interface, std::string &retBuffer) { - MIRACASTLOG_TRACE("Entering.."); - - MIRACASTLOG_INFO("Executing P2P command %s", command.c_str()); + MIRACASTLOG_INFO("Entering.."); + + MIRACASTLOG_INFO("Executing P2P command %s", command.c_str()); { char ret_buffer[2048] = {0}; p2pExecute((char *)command.c_str(), static_cast(interface), ret_buffer,sizeof(ret_buffer)); retBuffer = ret_buffer; MIRACASTLOG_INFO("command return buffer is - %s", retBuffer.c_str()); } - MIRACASTLOG_TRACE("Exiting.."); + + MIRACASTLOG_INFO("Exiting.."); return MIRACAST_OK; } diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 0625fde1..56b80773 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -48,11 +48,15 @@ MiracastThread::MiracastThread(std::string thread_name, size_t stack_size, size_ MiracastThread::~MiracastThread() { - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); if ( 0 != m_pthread_id ){ // Join thread - pthread_join(m_pthread_id, nullptr); + int ret = pthread_join(m_pthread_id, nullptr); + if (ret !=0) { + MIRACASTLOG_INFO("pthread join failed"); + } + MIRACASTLOG_INFO("Exit from joining..."); m_pthread_id = 0; pthread_attr_destroy(&m_pthread_attr); } @@ -63,7 +67,7 @@ MiracastThread::~MiracastThread() sem_destroy(&m_empty_msgq_sem_obj); m_g_queue = nullptr; } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); } MiracastError MiracastThread::start(void) @@ -84,9 +88,14 @@ MiracastError MiracastThread::start(void) void MiracastThread::send_message(void *message, size_t msg_size) { MIRACASTLOG_TRACE("Entering..."); + if (nullptr != m_g_queue){ - void *buffer = malloc(msg_size); - if (nullptr == buffer) + + + MIRACASTLOG_TRACE("msg size %d", msg_size); + + void *buffer = malloc(msg_size); + if (nullptr == buffer) { MIRACASTLOG_ERROR("Memory Allocation Failed for %u\n", msg_size); MIRACASTLOG_TRACE("Exiting..."); @@ -94,10 +103,14 @@ void MiracastThread::send_message(void *message, size_t msg_size) } memset(buffer, 0x00, msg_size); // Send message to queue - + MIRACASTLOG_TRACE(""); memcpy(buffer, message, msg_size); + MIRACASTLOG_TRACE("copied"); g_async_queue_push(m_g_queue, buffer); + MIRACASTLOG_TRACE("pushed"); sem_post(&m_empty_msgq_sem_obj); + MIRACASTLOG_TRACE("sempost"); + } MIRACASTLOG_TRACE("Exiting..."); } @@ -113,7 +126,9 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w int count = 0; sem_getvalue(&m_empty_msgq_sem_obj,&count); if ((0 < count ) || (THREAD_RECV_MSG_INDEFINITE_WAIT == sem_wait_timedout)){ + MIRACASTLOG_TRACE("Waiting for sem_wait to finish..."); sem_wait(&m_empty_msgq_sem_obj); + MIRACASTLOG_TRACE("Exit from sem_wait..."); status = true; } } @@ -122,27 +137,33 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += sem_wait_timedout; - + MIRACASTLOG_TRACE("sem_wait timed..."); if (-1 != sem_timedwait(&m_empty_msgq_sem_obj, &ts)) { status = true; } + MIRACASTLOG_TRACE("Exit from sem_timedwait..."); } else { status = -1; } - + MIRACASTLOG_TRACE("check if status is true..."); if (true == status) { + MIRACASTLOG_TRACE("status true..."); + #if 1 void *data_ptr = static_cast(g_async_queue_pop(m_g_queue)); if ((nullptr != message) && (nullptr != data_ptr)) { + MIRACASTLOG_TRACE("dequeue..."); memcpy(message, data_ptr, msg_size); free(data_ptr); } + #endif } - } + } + MIRACASTLOG_TRACE("Exiting..."); return status; } @@ -398,4 +419,4 @@ void MessageQueue::detachQueue(void) m_condNotFull.notify_all(); MIRACASTLOG_TRACE("Exiting..."); -} \ No newline at end of file +} diff --git a/Miracast/common/MiracastLogger.cpp b/Miracast/common/MiracastLogger.cpp index b5f22529..bbe05608 100644 --- a/Miracast/common/MiracastLogger.cpp +++ b/Miracast/common/MiracastLogger.cpp @@ -33,7 +33,7 @@ namespace MIRACAST setvbuf(stdout, NULL, _IOLBF, 0); } - static int gDefaultLogLevel = INFO_LEVEL; + static int gDefaultLogLevel = TRACE_LEVEL; static std::string service_name = "NOT-DEFINED"; void logger_init(const char* module_name) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index 322559e3..59d42027 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -44,7 +44,7 @@ namespace #define TEST_LOG(FMT, ...) log(__func__, __FILE__, __LINE__, syscall(__NR_gettid),FMT,##__VA_ARGS__) //Commented out the functions below because some test cases that use them have also been commented out. Since those test cases are disabled, these functions are now unused. - #if 0 + #if 1 static void removeFile(const char* fileName) { if (std::remove(fileName) != 0) @@ -248,10 +248,16 @@ class MiracastServiceEventTest : public MiracastServiceTest { virtual ~MiracastServiceEventTest() override { - dispatcher->Deactivate(); + dispatcher->Deactivate(); dispatcher->Release(); PluginHost::IFactories::Assign(nullptr); + + TEST_LOG("predebug1 Before destructor sleep "); + //Wait for all the previous destructor process to complete + std::this_thread::sleep_for(std::chrono::milliseconds(3000)); + TEST_LOG("predebug1 After destructor sleep "); + } }; @@ -259,13 +265,14 @@ TEST_F(MiracastServiceTest, GetInformation) { EXPECT_EQ("This MiracastService Plugin Facilitates Peer-to-Peer Control and WFD Source Device Discovery", plugin->Information()); } -#if 0 +#if 1 TEST_F(MiracastServiceTest, P2PCtrlInterfaceNameNotFound) { removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); // WIFI_P2P_CTRL_INTERFACE not configured in device properties file EXPECT_NE(string(""), plugin->Initialize(&service)); + plugin->Deinitialize(nullptr); } @@ -701,7 +708,7 @@ TEST_F(MiracastServiceEventTest, onClientConnectionRequestRejected) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("acceptClientConnection"), _T("{\"requestStatus\": Reject}"), response)); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); - + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -798,7 +805,7 @@ TEST_F(MiracastServiceEventTest, P2P_CONNECT_FAIL_onClientConnectionError) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -912,7 +919,7 @@ TEST_F(MiracastServiceEventTest, P2P_GO_NEGOTIATION_FAIL_onClientConnectionError EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1033,7 +1040,7 @@ TEST_F(MiracastServiceEventTest, P2P_GO_FORMATION_FAIL_onClientConnectionError) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -2035,6 +2042,7 @@ TEST_F(MiracastServiceEventTest, powerStateChange) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setEnable"), _T("{\"enabled\": false}"), response)); Plugin::MiracastServiceImplementation::_instance->onPowerModeChanged(WPEFramework::Exchange::IPowerManager::POWER_STATE_STANDBY_DEEP_SLEEP, WPEFramework::Exchange::IPowerManager::POWER_STATE_ON); EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setEnable"), _T("{\"enabled\": true}"), response)); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0");