[ITC][Non-ACR][notification][Changes related to dexter warning] 61/227461/5
authorMOHIT MIGLANI <mohit.m@samsung.com>
Thu, 12 Mar 2020 05:53:35 +0000 (11:23 +0530)
committershobhit verma <shobhit.v@samsung.com>
Mon, 16 Mar 2020 05:54:30 +0000 (05:54 +0000)
Change-Id: Icc6b8e1f9fdb31586e1dfbcdb0256c8bfe9ea806
Signed-off-by: MOHIT MIGLANI <mohit.m@samsung.com>
src/itc/notification/ITs-notification-ex.c

index ef8f3bd3f5ac2b80da529bc41e54bcf5060138bd..338bfd3c89590b7603cde75b75057c0490a8a54e 100755 (executable)
@@ -379,7 +379,7 @@ static int NotiExItemGroupForeachChildCb(noti_ex_item_h hItem, void *pszData)
                return 1;
        }
 
-       if ( strncmp(pszGetID, g_pszButtonID, sizeof(g_pszButtonID)-1) )
+       if ( strncmp(pszGetID, g_pszButtonID, strlen(g_pszButtonID) + 1) )
        {
                FPRINTF("[Line : %d][%s] Chiled id [%s] but recieved id is [%s] \\n", __LINE__, API_NAMESPACE, g_pszButtonID, pszGetID);
                return 1;
@@ -1040,10 +1040,11 @@ int ITc_noti_ex_action_get_extra_p(void)
 {
        START_TEST;
 
-       int nRet = NOTI_EX_ERROR_NONE;
-       noti_ex_action_h hAction = NULL;
-       const char* pszSetExtra = "test";
-       char* pszGetExtra = NULL;
+        int nRet = NOTI_EX_ERROR_NONE;
+
+        noti_ex_action_h hAction = NULL;
+        const char* pszSetExtra = "test";
+        char* pszGetExtra = NULL;
 
        nRet = noti_ex_action_visibility_create(&hAction, pszSetExtra);
        PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_action_visibility_create", NotificationExGetError(nRet));
@@ -1054,7 +1055,7 @@ int ITc_noti_ex_action_get_extra_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_action_get_extra", NotificationExGetError(nRet), noti_ex_action_destroy(hAction));
        CHECK_HANDLE_CLEANUP(pszGetExtra, "noti_ex_action_get_extra", noti_ex_action_destroy(hAction));
 
-       if (strncmp(pszSetExtra, pszGetExtra, sizeof(pszGetExtra)-1))
+       if (strncmp(pszSetExtra, pszGetExtra, strlen(pszGetExtra) + 1))
        {
                FPRINTF("[Line : %d][%s] noti_ex_action_get_extra: return extra string is different from set extra [%s]\\n", __LINE__, API_NAMESPACE, pszGetExtra);
 
@@ -1137,7 +1138,7 @@ int ITc_noti_ex_item_button_get_title_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_button_get_title", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton));
        CHECK_HANDLE_CLEANUP(pszGetTitle, "noti_ex_item_button_get_title", noti_ex_item_destroy(g_hItemButton));
 
-       if (strncmp(g_pszButtonTitle, pszGetTitle, sizeof(pszGetTitle)-1))
+       if (strncmp(g_pszButtonTitle, pszGetTitle, strlen(pszGetTitle) + 1))
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_button_get_title: return title is different from set title [%s]\\n", __LINE__, API_NAMESPACE, pszGetTitle);
                FREE_MEMORY(pszGetTitle);
@@ -1268,7 +1269,7 @@ int ITc_noti_ex_item_chat_message_get_name_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_get_contents", NotificationExGetError(nRet), DestroyChatMsgAttributes());
        CHECK_HANDLE_CLEANUP(pszGetChatName, "noti_ex_item_text_get_contents", DestroyChatMsgAttributes());
 
-       if( strncmp(g_pszNameText, pszGetChatName, sizeof(pszGetChatName)-1) )
+       if( strncmp(g_pszNameText, pszGetChatName, strlen(pszGetChatName) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_chat_message_get_name: return name is different from set name [%s]\\n", __LINE__, API_NAMESPACE, pszGetChatName);
                FREE_MEMORY(pszGetChatName);
@@ -1328,7 +1329,7 @@ int ITc_noti_ex_item_chat_message_get_text_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_get_contents", NotificationExGetError(nRet), DestroyChatMsgAttributes());
        CHECK_HANDLE_CLEANUP(pszGetChatText, "noti_ex_item_text_get_contents", DestroyChatMsgAttributes());
 
-       if( strncmp(g_pszTextText, pszGetChatText, sizeof(pszGetChatText)-1) )
+       if( strncmp(g_pszTextText, pszGetChatText, strlen(pszGetChatText) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_chat_message_get_text: return chat message text is different from set chat message text [%s]\\n", __LINE__, API_NAMESPACE, pszGetChatText);
                FREE_MEMORY(pszGetChatText);
@@ -1389,7 +1390,7 @@ int ITc_noti_ex_item_chat_message_get_image_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_image_get_image_path", NotificationExGetError(nRet), DestroyChatMsgAttributes());
        CHECK_HANDLE_CLEANUP(pszGetImagePath, "noti_ex_item_image_get_image_path", DestroyChatMsgAttributes());
 
-       if( strncmp(g_pszImagePath, pszGetImagePath, sizeof(pszGetImagePath)-1) )
+       if( strncmp(g_pszImagePath, pszGetImagePath, strlen(pszGetImagePath) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_chat_message_get_image: return image path is different from set image path [%s]\\n", __LINE__, API_NAMESPACE, pszGetImagePath);
                FREE_MEMORY(pszGetImagePath);
@@ -1584,7 +1585,7 @@ int ITc_noti_ex_item_checkbox_get_title_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_get_title", NotificationExGetError(nRet), noti_ex_item_destroy(hItemCheckBox));
        CHECK_HANDLE_CLEANUP(pszGetCheckBoxTitle, "noti_ex_item_checkbox_get_title", noti_ex_item_destroy(hItemCheckBox));
 
-       if( strncmp(pszGetCheckBoxTitle, pszCheckBoxTitle, sizeof(pszCheckBoxTitle)-1) )
+       if( strncmp(pszGetCheckBoxTitle, pszCheckBoxTitle, strlen(pszCheckBoxTitle) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_checkbox_get_title: return checkbox title is different from set checkbox title [%s]\\n", __LINE__, API_NAMESPACE, pszGetCheckBoxTitle);
                FREE_MEMORY(pszGetCheckBoxTitle);
@@ -1678,7 +1679,7 @@ int ITc_noti_ex_item_entry_set_get_text_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_entry_get_text", NotificationExGetError(nRet), noti_ex_item_destroy(hItemEntry));
        CHECK_HANDLE_CLEANUP(pszEntryGetText, "noti_ex_item_entry_get_text", noti_ex_item_destroy(hItemEntry));
 
-       if( strncmp(pszEntryText, pszEntryGetText, sizeof(pszEntryGetText)-1) )
+       if( strncmp(pszEntryText, pszEntryGetText, strlen(pszEntryGetText) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_entry_get_text: return entry text is different from set entry text [%s]\\n", __LINE__, API_NAMESPACE, pszEntryGetText);
                FREE_MEMORY(pszEntryGetText);
@@ -2006,7 +2007,7 @@ int ITc_noti_ex_item_image_get_image_path_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_image_get_image_path", NotificationExGetError(nRet), noti_ex_item_destroy(hItemImage));
        CHECK_HANDLE_CLEANUP(pszGetImagePath, "noti_ex_item_image_get_image_path", noti_ex_item_destroy(hItemImage));
 
-       if( strncmp(pszImagePath, pszGetImagePath, sizeof(pszGetImagePath)-1) )
+       if( strncmp(pszImagePath, pszGetImagePath, strlen(pszGetImagePath) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_image_get_image_path: return image path is different from set image path [%s]\\n", __LINE__, API_NAMESPACE, pszGetImagePath);
                FREE_MEMORY(pszGetImagePath);
@@ -2170,7 +2171,7 @@ int ITc_noti_ex_item_find_by_id_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_id", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton); FREE_MEMORY(pszGetFindItemID););
        CHECK_HANDLE_CLEANUP(pszGetButtonItemID, "noti_ex_item_get_id", noti_ex_item_destroy(hItemGroup); noti_ex_item_destroy(g_hItemButton));
 
-       if( strncmp(pszGetButtonItemID, pszGetFindItemID, sizeof(pszGetFindItemID)-1) )
+       if( strncmp(pszGetButtonItemID, pszGetFindItemID, strlen(pszGetFindItemID) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_find_by_id: return item ID is different from set item ID [%s]\\n", __LINE__, API_NAMESPACE, pszGetFindItemID);
                FREE_MEMORY(pszGetFindItemID);
@@ -2275,7 +2276,7 @@ int ITc_noti_ex_item_set_get_id_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_id", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton));
        CHECK_HANDLE_CLEANUP(pszGetItemID, "noti_ex_item_get_id", noti_ex_item_destroy(g_hItemButton));
 
-       if( strncmp(pszSetItemID, pszGetItemID, sizeof(pszGetItemID)-1) )
+       if( strncmp(pszSetItemID, pszGetItemID, strlen(pszGetItemID) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_get_id: return item ID is different from set item ID [%s]\\n", __LINE__, API_NAMESPACE, pszGetItemID);
                FREE_MEMORY(pszGetItemID);
@@ -2707,7 +2708,7 @@ int ITc_noti_ex_item_set_get_channel_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_channel", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton));
        CHECK_HANDLE_CLEANUP(pszGetChannel, "noti_ex_item_get_channel", noti_ex_item_destroy(g_hItemButton));
 
-       if( strncmp(pszSetChannel, pszGetChannel, sizeof(pszGetChannel)-1) )
+       if( strncmp(pszSetChannel, pszGetChannel, strlen(pszGetChannel) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_get_channel: return Channel is different from set Channel [%s]\\n", __LINE__, API_NAMESPACE, pszGetChannel);
                FREE_MEMORY(pszGetChannel);
@@ -2832,7 +2833,7 @@ int ITc_noti_ex_item_set_get_sound_path_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_sound_path", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton));
        CHECK_HANDLE_CLEANUP(pszGetSoundPath, "noti_ex_item_get_sound_path", noti_ex_item_destroy(g_hItemButton));
 
-       if( strncmp(pszSetSoundPath, pszGetSoundPath, sizeof(pszGetSoundPath)-1) )
+       if( strncmp(pszSetSoundPath, pszGetSoundPath, strlen(pszGetSoundPath) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_get_sound_path: return Sound Path is different from set Sound Path [%s]\\n", __LINE__, API_NAMESPACE, pszGetSoundPath);
                FREE_MEMORY(pszGetSoundPath);
@@ -2889,7 +2890,7 @@ int ITc_noti_ex_item_set_get_vibration_path_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_vibration_path", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton));
        CHECK_HANDLE_CLEANUP(pszGetVibPath, "noti_ex_item_get_vibration_path", noti_ex_item_destroy(g_hItemButton));
 
-       if( strncmp(pszSetVibPath, pszGetVibPath, sizeof(pszGetVibPath)-1) )
+       if( strncmp(pszSetVibPath, pszGetVibPath, strlen(pszGetVibPath) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_get_vibration_path: return vibration Path is different from set vibration Path [%s]\\n", __LINE__, API_NAMESPACE, pszGetVibPath);
                FREE_MEMORY(pszGetVibPath);
@@ -3025,7 +3026,7 @@ int ITc_noti_ex_item_set_get_tag_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_tag", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton));
        CHECK_HANDLE_CLEANUP(pszGetTag, "noti_ex_item_get_tag", noti_ex_item_destroy(g_hItemButton));
 
-       if( strncmp(pszSetTag, pszGetTag, sizeof(pszGetTag)-1) )
+       if( strncmp(pszSetTag, pszGetTag, strlen(pszGetTag) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_get_tag: return Tag is different from set Tag [%s]\\n", __LINE__, API_NAMESPACE, pszGetTag);
                FREE_MEMORY(pszGetTag);
@@ -3283,7 +3284,7 @@ int ITc_noti_ex_item_text_set_get_contents_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_get_contents", NotificationExGetError(nRet), noti_ex_item_destroy(hItemText));
        CHECK_HANDLE_CLEANUP(pszGetContents, "noti_ex_item_text_get_contents", noti_ex_item_destroy(hItemText));
 
-       if( strncmp(pszSetContents, pszGetContents, sizeof(pszGetContents)-1) )
+       if( strncmp(pszSetContents, pszGetContents, strlen(pszGetContents) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_text_get_contents: return content is different from set content [%s]\\n", __LINE__, API_NAMESPACE, pszGetContents);
                FREE_MEMORY(pszGetContents);
@@ -3341,7 +3342,7 @@ int ITc_noti_ex_item_text_get_hyperlink_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_get_hyperlink", NotificationExGetError(nRet), noti_ex_item_destroy(hItemText));
        CHECK_HANDLE_CLEANUP(pszGetHyperLink, "noti_ex_item_text_get_hyperlink", noti_ex_item_destroy(hItemText));
 
-       if( strncmp(pszTextHyperLink, pszGetHyperLink, sizeof(pszGetHyperLink)-1) )
+       if( strncmp(pszTextHyperLink, pszGetHyperLink, strlen(pszGetHyperLink) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_item_text_get_hyperlink: return hyperlink is different from set hyperlink [%s]\\n", __LINE__, API_NAMESPACE, pszGetHyperLink);
                FREE_MEMORY(pszGetHyperLink);
@@ -6061,7 +6062,7 @@ int ITc_noti_ex_style_set_get_background_image_p(void)
        PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_style_get_background_image", NotificationExGetError(nRet), DestroyStyleAttributes(); FREE_MEMORY(pszResPath));
        CHECK_HANDLE_CLEANUP(pszGetImagePath, "noti_ex_style_get_background_image", DestroyStyleAttributes(); FREE_MEMORY(pszResPath));
 
-       if( strncmp(pszSetImagePath, pszGetImagePath, sizeof(pszGetImagePath)-1) )
+       if( strncmp(pszSetImagePath, pszGetImagePath, strlen(pszGetImagePath) + 1) )
        {
                FPRINTF("[Line : %d][%s] noti_ex_style_get_background_image: return image Path [%s] is different from set image Path [%s]\\n", __LINE__, API_NAMESPACE, pszGetImagePath, pszSetImagePath);
                DestroyStyleAttributes();