fix unittest fails.
authorjungmin76.park <jungmin76.park@samsung.com>
Mon, 15 Jul 2013 12:36:53 +0000 (21:36 +0900)
committerjungmin76.park <jungmin76.park@samsung.com>
Mon, 15 Jul 2013 13:22:28 +0000 (22:22 +0900)
Change-Id: I7fc22bad53eec1fcb17ea3a34836c39bc83f9800
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
src/FShell_AppWidgetContext.cpp

index 4fd06d1..f8d58ba 100644 (file)
@@ -288,7 +288,7 @@ result
 _AppWidgetContext::RequestUpdate(const String& argument)
 {
        AppWidgetManagerService* pMgrService = AppWidgetManagerService::GetInstance();
-       SysTryReturnResult(NID_SHELL, pMgrService, E_SYSTEM, "[E_SYSTEM] Failed to get an instance of AppWidgetManagerService.");
+       SysTryReturnResult(NID_SHELL, pMgrService, E_SYSTEM, "Failed to get an instance of AppWidgetManagerService.");
 
        result r = pMgrService->RequestUpdate(this, argument);
        SysTryReturnResult(NID_SHELL, !IsFailed(r), r, "Failed to request update.");
@@ -403,22 +403,17 @@ _AppWidgetContext::SendRemoveRequest(void)
 result
 _AppWidgetContext::SendPendingEvent(void)
 {
-       TryReturnResult(__pPendingEventList->GetCount() > 0 , "There is no pending event.");
+       GetAppContext()->SetWaitingStatus(false);
+       TryReturn(__pPendingEventList->GetCount() > 0, E_DATA_NOT_FOUND, "This context has no pending event. Please find next pending event context.");
 
        PendingEvent* pEvent = null;
        __pPendingEventList->GetAt(0, pEvent);
-
-       if (pEvent == null)
-       {
-               SysLog(NID_SHELL, "SendPendingEvent by IPC [0 existed.]");
-               GetAppContext()->SetWaitingStatus(false);
-               return E_SYSTEM;
-       }
-       SysLog(NID_SHELL, "SendPendingEvent by IPC [%d existed.]", __pPendingEventList->GetCount());
+       SysTryReturnResult(NID_SHELL, pEvent != null, E_SYSTEM, "__pPendingEventList has (%d) items, but failed to GetAt(0)", __pPendingEventList->GetCount());
 
        __pPendingEventList->RemoveAt(0);
+       SysLog(NID_SHELL, "(%d) Remains in __pPendingEventList.", __pPendingEventList->GetCount());
+
        result r = _AppWidgetRequestHelper::SendIpcRequest(GetClientId(), pEvent->operation, pEvent->pArg);
-       GetAppContext()->SetWaitingStatus(false);
        delete pEvent;
        SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "SendIpcRequest failed.");