[CTC][platform-permission][Non-ACR][Fix error test code]
authorMyungki Lee <mk5004.lee@samsung.com>
Thu, 30 Jun 2016 06:04:49 +0000 (15:04 +0900)
committerMyungki Lee <mk5004.lee@samsung.com>
Thu, 30 Jun 2016 06:05:45 +0000 (15:05 +0900)
Change-Id: I10329e4689903d42dab66ce50b3394a3bad18ed8
Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
src/ctc/platform-permission/CTs-platform-permission-notification.c

index befd83f..ad32efc 100755 (executable)
@@ -73,21 +73,21 @@ void CTs_platform_permission_notification_cleanup(void)
 * @description         Creates internal structure data and returns a notification handle.
 * @parameter       NotificationType
 * @return                      NA
-*/ 
+*/
 bool CreateNotification(notification_type_e eNotificationType)
 {
        FreeAndDeleteNotificationResourceHandle();
-       
+
        g_NotificationHandle = notification_create(eNotificationType);
        CHECK_HANDLE(g_NotificationHandle, "notification_create");
-       
+
        return true;
 }
 
 /**
 * @function            FreeAndDeleteNotificationResourceHandle
 * @description         Free internal data structure and notification handle.
-* @parameter       
+* @parameter
 * @return                      NA
 */
 void FreeAndDeleteNotificationResourceHandle()
@@ -115,16 +115,20 @@ void FreeAndDeleteNotificationResourceHandle()
 */
 int CTc_Notification_PrivilegeNotification_delete(void)
 {
+       int nRet;
+
        START_TEST;
+
        if ( false == CreateNotification(NOTIFICATION_TYPE_NOTI) )
        {
                return 1;
        }
-       int nRet = notification_delete(g_NotificationHandle);
-       PRINT_RESULT_ERROR_NONE(TIZEN_ERROR_PERMISSION_DENIED, nRet, "notification_delete", NotificationPrintAPIErrorMSG(nRet), notification_free(g_NotificationHandle), NOTIFICATION_ERROR_NONE);
 
-       nRet = notification_free(g_NotificationHandle);
-       
+       nRet = notification_delete(g_NotificationHandle);
+       PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, nRet, "notification_delete", NotificationGetError(nRet), FreeAndDeleteNotificationResourceHandle(););
+
+       FreeAndDeleteNotificationResourceHandle();
+
        return 0;
 }
 
@@ -147,17 +151,19 @@ int CTc_Notification_PrivilegeNotification_delete(void)
 */
 int CTc_Notification_PrivilegeNotification_delete_all(void)
 {
+       int nRet;
+
        START_TEST;
 
        if ( false == CreateNotification(NOTIFICATION_TYPE_NOTI) )
        {
                return 1;
        }
-       int nRet = notification_delete_all(NOTIFICATION_TYPE_NOTI);
-       PRINT_RESULT_ERROR_NONE(TIZEN_ERROR_PERMISSION_DENIED, nRet, "notification_delete_all", NotificationPrintAPIErrorMSG(nRet), notification_delete(g_NotificationHandle);notification_free(g_NotificationHandle), NOTIFICATION_ERROR_NONE);
 
-       nRet = notification_free(g_NotificationHandle);
-       
+       nRet = notification_delete_all(NOTIFICATION_TYPE_NOTI);
+       PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, nRet, "notification_delete_all", NotificationGetError(nRet), FreeAndDeleteNotificationResourceHandle(););
+
+       FreeAndDeleteNotificationResourceHandle();
        return 0;
 }
 //& purpose: check tizen.org/privilege/notification privilege.
@@ -180,16 +186,18 @@ int CTc_Notification_PrivilegeNotification_delete_all(void)
 */
 int CTc_Notification_PrivilegeNotification_post(void)
 {
+       int nRet;
+
        START_TEST;
-       int eRetNotiErr;
+
        if ( false == CreateNotification(NOTIFICATION_TYPE_NOTI) )
        {
                return 1;
        }
-       
-       eRetNotiErr = notification_post(g_NotificationHandle);
-       PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, eRetNotiErr, "notification_post", NotificationGetError(eRetNotiErr), FreeAndDeleteNotificationResourceHandle(););
-       
+
+       nRet = notification_post(g_NotificationHandle);
+       PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, nRet, "notification_post", NotificationGetError(nRet), FreeAndDeleteNotificationResourceHandle(););
+
        FreeAndDeleteNotificationResourceHandle();
        return 0;
 }
@@ -213,17 +221,20 @@ int CTc_Notification_PrivilegeNotification_post(void)
 */
 int CTc_Notification_PrivilegeNotification_load_by_tag(void)
 {
-       START_TEST;
-       int nRet = -1;
+       int nRet;
        char* pSetTag = NOTIFICATION_TAG;
+
+       START_TEST;
+
        if ( false == CreateNotification(NOTIFICATION_TYPE_NOTI) )
        {
                return 1;
        }
+
        notification_load_by_tag(pSetTag);
        nRet = get_last_result();
        PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, nRet, "notification_load_by_tag", NotificationGetError(nRet), FreeAndDeleteNotificationResourceHandle(););
-       
+
        FreeAndDeleteNotificationResourceHandle();
        return 0;
 }
@@ -248,14 +259,18 @@ int CTc_Notification_PrivilegeNotification_load_by_tag(void)
 */
 int CTc_Notification_PrivilegeNotification_update(void)
 {
+       int nRet;
+
        START_TEST;
+
        if ( false == CreateNotification(NOTIFICATION_TYPE_NOTI) )
        {
                return 1;
        }
-       int eRetNotiErr = notification_update(g_NotificationHandle);
-       PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, eRetNotiErr, "notification_update", NotificationGetError(eRetNotiErr), FreeAndDeleteNotificationResourceHandle(););
+
+       nRet = notification_update(g_NotificationHandle);
+       PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, nRet, "notification_update", NotificationGetError(nRet), FreeAndDeleteNotificationResourceHandle(););
 
        FreeAndDeleteNotificationResourceHandle();
        return 0;
-}
\ No newline at end of file
+}