From: manu.tiwari Date: Fri, 4 Oct 2019 07:40:18 +0000 (+0530) Subject: [ITC][Notification_ex][ACR-1433][Add/Remove APIs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff694dfef759171fa02e1cc4e7c6e3fe52769de7;p=test%2Ftct%2Fnative%2Fapi.git [ITC][Notification_ex][ACR-1433][Add/Remove APIs] Change-Id: I382a9ab98f86efea3c385526e878d2c676be1b3f Signed-off-by: manu.tiwari --- diff --git a/src/itc/notification/ITs-notification-common.c b/src/itc/notification/ITs-notification-common.c index 30e8c0e62..e9d82d4e4 100755 --- a/src/itc/notification/ITs-notification-common.c +++ b/src/itc/notification/ITs-notification-common.c @@ -478,4 +478,27 @@ int CreateButton() return nRet; } +/** +* @function CreateMultiLangHandle +* @description Helper function, to create multilang handle. +* @parameter None +* @return nRet, API return value. +*/ +int CreateMultiLangHandle() +{ + int nRet = 0; + g_hMultiLang = NULL; + g_pszMsgID = "TEST_ID"; + g_pszText = "test string(%s) integer(%d) float(%f)"; + g_pszArg1 = "test"; + g_nArg2 = 777; + g_fArg3 = 0.77; + + nRet = noti_ex_multi_lang_create(&g_hMultiLang, g_pszMsgID, g_pszText, g_pszArg1, g_nArg2, g_fArg3); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_create", NotificationExGetError(nRet)); + CHECK_HANDLE(g_hMultiLang, "noti_ex_multi_lang_create"); + + return nRet; +} + /** @} */ //end of itc-notification diff --git a/src/itc/notification/ITs-notification-common.h b/src/itc/notification/ITs-notification-common.h index 1cbc4412c..e41e47529 100755 --- a/src/itc/notification/ITs-notification-common.h +++ b/src/itc/notification/ITs-notification-common.h @@ -113,6 +113,8 @@ noti_ex_style_h g_hStyle; noti_ex_color_h g_hColor; noti_ex_padding_h g_hPadding; noti_ex_geometry_h g_hGeometry; +noti_ex_multi_lang_h g_hMultiLang; + time_t g_tCurrTime; const char *g_pszNameID; @@ -125,10 +127,14 @@ const char *g_pszTimeID; const char *g_pszChatID; const char *g_pszButtonID; const char *g_pszButtonTitle; +const char *g_pszMsgID; +const char *g_pszText; +const char *g_pszArg1; unsigned char g_cAlpha, g_cRed, g_cGreen, g_cBlue; -int g_nLeft, g_nTop, g_nRight, g_nBottom, g_nX, g_nY, g_nW, g_nH; +int g_nLeft, g_nTop, g_nRight, g_nBottom, g_nX, g_nY, g_nW, g_nH, g_nArg2; noti_ex_item_chat_message_type_e g_eChatMsgType; +float g_fArg3; char* NotificationExGetError(int nRet); int SendNotification(void); @@ -144,6 +150,7 @@ int DestroyChatMsgAttributes(); int CreateStyleAttributes(); int DestroyStyleAttributes(); int CreateButton(); +int CreateMultiLangHandle(); //This function outputs the application data path bool NotificationGetDataPath(char* pPath); diff --git a/src/itc/notification/ITs-notification-ex.c b/src/itc/notification/ITs-notification-ex.c old mode 100644 new mode 100755 index 8d8dc38c6..4024ad252 --- a/src/itc/notification/ITs-notification-ex.c +++ b/src/itc/notification/ITs-notification-ex.c @@ -1281,50 +1281,6 @@ int ITc_noti_ex_item_checkbox_get_title_p(void) return 0; } -//& type : auto -//& purpose: Gets the check state of a checkbox. -/** -* @testcase ITc_noti_ex_item_checkbox_is_checked_p -* @since_tizen 5.5 -* @author SRID(j.abhishek) -* @reviewer SRID(shobhit.v) -* @type auto -* @description Gets the check state of a checkbox. -* @scenario Creates the notification_ex item handle for the checkbox \n -* Gets the check state of a checkbox and compare with set title \n -* and check for Pass/Fail. -* @apicovered noti_ex_item_checkbox_is_checked -* @passcase noti_ex_item_checkbox_is_checked is successful and return correct value -* @failcase noti_ex_item_checkbox_is_checked failed or return null value -* @precondition NA -* @postcondition Destroy handle. -*/ -int ITc_noti_ex_item_checkbox_is_checked_p(void) -{ - START_TEST; - - int nRet = NOTI_EX_ERROR_NONE; - noti_ex_item_h hItemCheckBox = NULL; - const char *pszCheckBoxID = "checkbox_id"; - const char *pszCheckBoxTitle = "checkbox_title"; - bool bChecked = true; - bool bIsChecked = false; - - nRet = noti_ex_item_checkbox_create(&hItemCheckBox, pszCheckBoxID, pszCheckBoxTitle, bChecked); - PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_create", NotificationExGetError(nRet)); - CHECK_HANDLE(hItemCheckBox, "noti_ex_item_checkbox_create"); - - //Target API - nRet = noti_ex_item_checkbox_is_checked(hItemCheckBox, &bIsChecked); - PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_is_checked", NotificationExGetError(nRet), noti_ex_item_destroy(hItemCheckBox)); - PRINT_RESULT_CLEANUP(bChecked, bIsChecked, "noti_ex_item_checkbox_is_checked", "Checkbox checked API returned wrong value", noti_ex_item_destroy(hItemCheckBox)); - - nRet = noti_ex_item_destroy(hItemCheckBox); - PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); - - return 0; -} - //& type : auto //& purpose: Creates the notification_ex item handle for an entry item. /** @@ -5631,7 +5587,7 @@ int ITc_noti_ex_reporter_delete_p(void) noti_ex_manager_events_s hEventManger = {0}; hEventManger.added = DeleteEventsAddCB; - nRet = noti_ex_manager_create(&g_hExManager, NULL, hEventManger, NULL); + nRet = noti_ex_manager_create(&g_hExManager, NULL, hEventManger, NULL); PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_manager_create", NotificationExGetError(nRet)); CHECK_HANDLE(g_hExManager, "noti_ex_reporter_create"); @@ -5691,7 +5647,7 @@ int ITc_noti_ex_reporter_delete_all_p(void) noti_ex_manager_events_s hEventManger = {0}; hEventManger.added = DeleteallEventsAddCB; - nRet = noti_ex_manager_create(&g_hExManager, NULL, hEventManger, NULL); + nRet = noti_ex_manager_create(&g_hExManager, NULL, hEventManger, NULL); PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_manager_create", NotificationExGetError(nRet)); CHECK_HANDLE(g_hExManager, "noti_ex_reporter_create"); @@ -5780,6 +5736,842 @@ int ITc_noti_ex_reporter_find_by_root_id_p(void) return 0; } -/** @} */ //end of itc-notification-ex -/** @} */ //end of itc-notification-testcases +//& type : auto +//& purpose: Set and Get the background image path of a style. +/** +* @testcase ITc_noti_ex_style_set_get_background_image_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Set and Get the background image path from style +* @scenario Creates the noti_ex_style_h handle \n +* Get the background image and compare with set image \n +* and check for Pass/Fail. +* @apicovered noti_ex_style_set_background_image, noti_ex_style_get_background_image +* @passcase noti_ex_style_set_background_image, noti_ex_style_get_background_image are successful and return correct value +* @failcase noti_ex_style_set_background_image, noti_ex_style_get_background_image failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_style_set_get_background_image_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + char pszSetImagePath[PATH_LEN]; + char *pszGetImagePath = NULL; + char *pszResPath = NULL; + + nRet = CreateStyleAttributes(); + if(nRet) + { + FPRINTF("[Line : %d][%s] One of the prerequisite API inside CreateStyleAttributes() is failed \\n", __LINE__, API_NAMESPACE); + return 1; + } + + pszResPath = app_get_shared_resource_path(); + if ( pszResPath == NULL ) + { + FPRINTF("[Line : %d][%s] app_get_shared_resource_path failed, error = NULL resource path\\n", __LINE__, API_NAMESPACE); + return 1; + } + snprintf(pszSetImagePath, sizeof(pszResPath), "%s", pszResPath); + + //Target API + nRet = noti_ex_style_set_background_image(g_hStyle, pszSetImagePath); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_style_set_background_image", NotificationExGetError(nRet), DestroyStyleAttributes(); FREE_MEMORY(pszResPath)); + + //Target API + nRet = noti_ex_style_get_background_image(g_hStyle, &pszGetImagePath); + 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) ) + { + 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(); + FREE_MEMORY(pszResPath); + FREE_MEMORY(pszGetImagePath); + + return 1; + } + + DestroyStyleAttributes(); + FREE_MEMORY(pszResPath); + FREE_MEMORY(pszGetImagePath); + + return 0; +} + +//& type : auto +//& purpose: Set and Get the background color of a style. +/** +* @testcase ITc_noti_ex_style_set_get_background_color_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Set and Get the background color of a style +* @scenario Creates the notification_ex item handle for the checkbox \n +* Get checkbox title and compare with set title \n +* and check for Pass/Fail. +* @apicovered noti_ex_style_set_background_color, noti_ex_style_get_background_image +* @passcase noti_ex_style_set_background_color, noti_ex_style_get_background_image are successful and return correct value +* @failcase noti_ex_style_set_background_color, noti_ex_style_get_background_image failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_style_set_get_background_color_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_color_h hSetColor = NULL; + noti_ex_color_h hGetColor = NULL; + unsigned char cAlpha = 10; + unsigned char cRed = 20; + unsigned char cGreen = 30; + unsigned char cBlue = 40; + + nRet = CreateStyleAttributes(); + if(nRet) + { + FPRINTF("[Line : %d][%s] One of the prerequisite API inside CreateStyleAttributes() is failed \\n", __LINE__, API_NAMESPACE); + return 1; + } + + nRet = noti_ex_color_create(&hSetColor, cAlpha, cRed, cGreen, cBlue); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_color_create", NotificationExGetError(nRet), DestroyStyleAttributes()); + CHECK_HANDLE_CLEANUP(hSetColor, "noti_ex_color_create", DestroyStyleAttributes()); + + //Target API + nRet = noti_ex_style_set_background_color(g_hStyle, hSetColor); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_style_set_background_color", NotificationExGetError(nRet), DestroyStyleAttributes(); noti_ex_color_destroy(hSetColor)); + + //Target API + nRet = noti_ex_style_get_background_color(g_hStyle, &hGetColor); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_style_get_background_color", NotificationExGetError(nRet), DestroyStyleAttributes(); noti_ex_color_destroy(hSetColor)); + CHECK_HANDLE_CLEANUP(hGetColor, "noti_ex_style_get_background_color", DestroyStyleAttributes(); noti_ex_color_destroy(hSetColor)); + + DestroyStyleAttributes(); + + nRet = noti_ex_color_destroy(hSetColor); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_color_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_color_destroy(hGetColor); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_color_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Checks if an item of a specified type is included in a notification_ex item. +/** +* @testcase ITc_noti_ex_item_check_type_exist_p +* @since_tizen 5.5 +* @author SRID(j.abhishek) +* @reviewer SRID(shobhit.v) +* @type auto +* @description Checks if an item of a specified type is included in a notification_ex item. +* @scenario Creates the notification_ex entry item, get the item type.\n +* Compare type with created item and check for Pass/Fail. +* @apicovered noti_ex_item_check_type_exist +* @passcase noti_ex_item_check_type_exist is successful and return correct value +* @failcase noti_ex_item_check_type_exist failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_check_type_exist_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemEntry = NULL; + noti_ex_item_type_e eItemType = NOTI_EX_ITEM_TYPE_ENTRY; + const char *pszEntryID = "entry_id"; + bool bEntryType = true; + bool bIsExist = false; + + nRet = noti_ex_item_entry_create(&hItemEntry, pszEntryID); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_entry_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemEntry, "noti_ex_item_entry_create"); + + //Target API + nRet = noti_ex_item_check_type_exist(hItemEntry, eItemType, &bIsExist); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_check_type_exist", NotificationExGetError(nRet), noti_ex_item_destroy(hItemEntry)); + PRINT_RESULT_CLEANUP(bEntryType, bIsExist, "noti_ex_item_check_type_exist", NotificationExGetError(nRet), noti_ex_item_destroy(hItemEntry)); + + nRet = noti_ex_item_destroy(hItemEntry); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Set and Get the value indicating whether a notification is currently ongoing. +/** +* @testcase ITc_noti_ex_item_set_get_ongoing_state_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Set and Get the value indicating whether a notification is currently ongoing. +* @scenario Creates the notification_ex item handle for entry \n +* Set Ongoing state to true and get state and compare with set state \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_set_ongoing_state, noti_ex_item_get_ongoing_state +* @passcase noti_ex_item_set_ongoing_state, noti_ex_item_get_ongoing_state are successful and return correct value +* @failcase noti_ex_item_set_ongoing_state, noti_ex_item_get_ongoing_state failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_set_get_ongoing_state_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemEntry = NULL; + const char *pszEntryID = "entry_id"; + + bool bSetOngoing = true; + bool bIsOngoing = false; + + nRet = noti_ex_item_entry_create(&hItemEntry, pszEntryID); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_entry_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemEntry, "noti_ex_item_entry_create"); + + //Target API + nRet = noti_ex_item_set_ongoing_state(hItemEntry, bSetOngoing); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_set_ongoing_state", NotificationExGetError(nRet), noti_ex_item_destroy(hItemEntry)); + + //Target API + nRet = noti_ex_item_get_ongoing_state(hItemEntry, &bIsOngoing); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_ongoing_state", NotificationExGetError(nRet), noti_ex_item_destroy(hItemEntry)); + PRINT_RESULT_CLEANUP(bSetOngoing, bIsOngoing, "noti_ex_item_get_ongoing_state", "get ongoing return state is not same as set state", noti_ex_item_destroy(hItemEntry)); + + nRet = noti_ex_item_destroy(hItemEntry); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Set and Get the type of progress. +/** +* @testcase ITc_noti_ex_item_progress_set_get_type_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Set and Get the type of progress. +* @scenario Creates the notification_ex item handle for the progress \n +* Set the progress type and get and compare with set type \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_progress_set_type, noti_ex_item_progress_get_type +* @passcase noti_ex_item_progress_set_type, noti_ex_item_progress_get_type is successful and return correct value +* @failcase noti_ex_item_progress_set_type, noti_ex_item_progress_get_type failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_progress_set_get_type_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemProgress = NULL; + const char *pszProgressID = "progressID"; + float fMin = 0.0; + float fCurrent = 50.0; + float fMax = 100.0; + + nRet = noti_ex_item_progress_create(&hItemProgress, pszProgressID, fMin, fCurrent, fMax); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_progress_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemProgress, "noti_ex_item_progress_create"); + + noti_ex_item_progress_type_e eProgressType[] = { + NOTI_EX_ITEM_PROGRESS_TYPE_DEFAULT, + NOTI_EX_ITEM_PROGRESS_TYPE_TIME, + NOTI_EX_ITEM_PROGRESS_TYPE_PERCENT, + NOTI_EX_ITEM_PROGRESS_TYPE_PENDING + }; + + int nEnumSize = sizeof(eProgressType) / sizeof(eProgressType[0]); + int nEnumCounter; + int nProgressType = NOTI_EX_ITEM_PROGRESS_TYPE_DEFAULT; + + for ( nEnumCounter = 0; nEnumCounter < nEnumSize; nEnumCounter++) + { + //Taregt API + nRet = noti_ex_item_progress_set_type(hItemProgress, eProgressType[nEnumCounter]); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_progress_set_type", NotificationExGetError(nRet), noti_ex_item_destroy(hItemProgress)); + + //Taregt API + nRet = noti_ex_item_progress_get_type(hItemProgress, &nProgressType); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_progress_get_type", NotificationExGetError(nRet), noti_ex_item_destroy(hItemProgress)); + PRINT_RESULT_CLEANUP(eProgressType[nEnumCounter], nProgressType, "noti_ex_item_progress_get_type", "get progress type is not same as set type", noti_ex_item_destroy(hItemProgress)); + } + nRet = noti_ex_item_destroy(hItemProgress); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Set and Get the main type of a notification item. +/** +* @testcase ITc_noti_ex_item_set_get_main_type_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Set and Get the main type of a notification item +* @scenario Creates the notification_ex item handle \n +* Set Main type for handle of different type \n +* compare set and get type and check for Pass/Fail. +* @apicovered noti_ex_item_set_main_type, noti_ex_item_get_main_type +* @passcase noti_ex_item_set_main_type, noti_ex_item_get_main_type are successful and return correct value +* @failcase noti_ex_item_set_main_type, noti_ex_item_get_main_type failed or return null value +* @precondition Create specific item of that type +* @postcondition Destroy specific handle created to set and get main type. +*/ +int ITc_noti_ex_item_set_get_main_type_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemText = NULL; + const char *pszTextID = "text_id"; + const char *pszTextTitle = "textTitle"; + const char *pszTextHyperLink = "testHyperLink"; + int nMainType = -1; + + noti_ex_item_h hItemImage = NULL; + const char *pszImageID = "image_id"; + const char *pszImagePath = "image_path"; + + noti_ex_item_main_type_e eMainType[] = { + NOTI_EX_ITEM_MAIN_TYPE_TITLE, + NOTI_EX_ITEM_MAIN_TYPE_CONTENTS + }; + + nRet = noti_ex_item_text_create(&hItemText, pszTextID, pszTextTitle, pszTextHyperLink); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemText, "noti_ex_item_text_create"); + + int nEnumSize = sizeof(eMainType) / sizeof(eMainType[0]); + int nEnumCounter; + + for ( nEnumCounter=0; nEnumCounter < nEnumSize; nEnumCounter++) + { + nRet = noti_ex_item_set_main_type(hItemText, pszTextID, eMainType[nEnumCounter]); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_set_main_type", NotificationExGetError(nRet), noti_ex_item_destroy(hItemText)); + + nRet = noti_ex_item_get_main_type(hItemText, &nMainType); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_main_type", NotificationExGetError(nRet), noti_ex_item_destroy(hItemText)); + PRINT_RESULT_CLEANUP(eMainType[nEnumCounter], nMainType, "noti_ex_item_get_main_type", "get main type is not same as set type", noti_ex_item_destroy(hItemText)); + } + + nRet = noti_ex_item_destroy(hItemText); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_item_image_create(&hItemImage, pszImageID, pszImagePath); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_image_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemImage, "noti_ex_item_image_create"); + + nRet = noti_ex_item_set_main_type(hItemImage, pszImageID, NOTI_EX_ITEM_MAIN_TYPE_ICON); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_set_main_type", NotificationExGetError(nRet), noti_ex_item_destroy(hItemImage)); + nRet = noti_ex_item_get_main_type(hItemImage, &nMainType); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_main_type", NotificationExGetError(nRet), noti_ex_item_destroy(hItemImage)); + PRINT_RESULT_CLEANUP(NOTI_EX_ITEM_MAIN_TYPE_ICON, nMainType, "noti_ex_item_get_main_type", "get main type is not same as set type", noti_ex_item_destroy(hItemImage)); + + nRet = noti_ex_item_destroy(hItemImage); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + nRet = CreateButton(); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_button_create", NotificationExGetError(nRet)); + CHECK_HANDLE(g_hItemButton, "noti_ex_item_button_create"); + + nRet = noti_ex_item_set_main_type(g_hItemButton, g_pszButtonID, NOTI_EX_ITEM_MAIN_TYPE_BUTTON); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_set_main_type", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton)); + + nRet = noti_ex_item_get_main_type(g_hItemButton, &nMainType); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_get_main_type", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton)); + PRINT_RESULT_CLEANUP(NOTI_EX_ITEM_MAIN_TYPE_BUTTON, nMainType, "noti_ex_item_get_main_type", "get main type is not same as set type", noti_ex_item_destroy(g_hItemButton)); + + nRet = noti_ex_item_destroy(g_hItemButton); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Set and Get the main type of a notification item. +/** +* @testcase ITc_noti_ex_item_find_by_main_type_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Set and Get the main type of a notification item +* @scenario Creates the notification_ex item handle for the checkbox \n +* Get checkbox title and compare with set title \n +* and check for Pass/Fail. +* @apicovered noti_ex_style_get_background_image +* @passcase noti_ex_style_get_background_image is successful and return correct value +* @failcase noti_ex_style_get_background_image failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_find_by_main_type_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemGroup = NULL; + noti_ex_item_h hItemText = NULL; + noti_ex_item_h hGetItemText = NULL; + const char *pszGroupID = "group_id"; + const char *pszTextID = "text_id"; + const char *pszTextTitle = "textTitle"; + const char *pszTextHyperLink = "testHyperLink"; + int nMainType = NOTI_EX_ITEM_MAIN_TYPE_TITLE; + + nRet = noti_ex_item_group_create(&hItemGroup, pszGroupID); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_group_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemGroup, "noti_ex_item_group_create"); + + nRet = noti_ex_item_text_create(&hItemText, pszTextID, pszTextTitle, pszTextHyperLink); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_create", NotificationExGetError(nRet), noti_ex_item_destroy(hItemGroup)); + CHECK_HANDLE_CLEANUP(hItemText, "noti_ex_item_text_create", noti_ex_item_destroy(hItemGroup)); + + nRet = noti_ex_item_group_add_child(hItemGroup, hItemText); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_group_add_child", NotificationExGetError(nRet), noti_ex_item_destroy(hItemGroup); noti_ex_item_destroy(hItemText)); + + //Taregt API + nRet = noti_ex_item_find_by_main_type(hItemGroup, nMainType, &hGetItemText); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_find_by_main_type", NotificationExGetError(nRet), noti_ex_item_destroy(hItemGroup); noti_ex_item_destroy(hItemText)); + CHECK_HANDLE_CLEANUP(hGetItemText, "noti_ex_item_find_by_main_type", noti_ex_item_destroy(hItemGroup); noti_ex_item_destroy(hItemText)); + + nRet = noti_ex_item_group_remove_child(hItemGroup, pszTextID); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_group_remove_child", NotificationExGetError(nRet)); + + nRet = noti_ex_item_destroy(hItemText); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_item_destroy(hGetItemText); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_item_destroy(hItemGroup); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Gets notifications with channel for the notification_ex manager. +/** +* @testcase ITc_noti_ex_manager_get_by_channel_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Gets notifications with channel for the notification_ex manager. +* @scenario Creates notification_ex manager and event handler \n +* register error callback, get the channel count and Check for pass/fail. +* @apicovered noti_ex_manager_get_by_channel +* @passcase noti_ex_manager_get_by_channel is successful and return correct value +* @failcase noti_ex_manager_get_by_channel failed +* @precondition NA +* @postcondition NA +*/ +int ITc_noti_ex_manager_get_by_channel_p(void) +{ + START_TEST; + + noti_ex_manager_events_s hEventManger = {0}; + noti_ex_manager_h hExManager = NULL; + noti_ex_item_h *hFindItems = NULL; + + hEventManger.error = ManagerEventsErrorCB; + + int nRet = NOTI_EX_ERROR_NONE; + char *pszChannel = "channel"; + int nChCount = -1; + + nRet = noti_ex_manager_create(&hExManager, NOTI_EX_RECEIVER_GROUP_INDICATOR, hEventManger, NULL); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_manager_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hExManager, "noti_ex_manager_create"); + + //Target API + nRet = noti_ex_manager_get_by_channel(hExManager, pszChannel, &hFindItems, &nChCount); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_manager_get_by_channel", NotificationExGetError(nRet), noti_ex_manager_destroy(hExManager)); + FPRINTF("[Line : %d][%s] Get channel count value is [%d]\\n", __LINE__, API_NAMESPACE, nChCount); + + nRet = noti_ex_manager_destroy(hExManager); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_manager_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Creates and Destroys the multi-language item handle +/** +* @testcase ITc_noti_ex_multi_lang_create_destroy_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Creates and Destroys the multi-language item handle +* @scenario Creates the notification_ex multi langauge handle and destroy \n +* and check for Pass/Fail. +* @apicovered noti_ex_style_get_background_image +* @passcase noti_ex_style_get_background_image is successful and return correct value +* @failcase noti_ex_style_get_background_image failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_multi_lang_create_destroy_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + //Target API + nRet = CreateMultiLangHandle(); + PRINT_RESULT(0, nRet, "noti_ex_multi_lang_create", "API failed or handle not created successfully"); + + //Target API + nRet = noti_ex_multi_lang_destroy(g_hMultiLang); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Sets the multi-language handle for button. +/** +* @testcase ITc_noti_ex_item_button_set_multi_language_title_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Sets the multi-language handle for button. +* @scenario Creates the notification_ex button and multi langauge handle \n +* Sets the multi-language handle for button \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_button_set_multi_language_title +* @passcase noti_ex_item_button_set_multi_language_title is successful and return correct value +* @failcase noti_ex_item_button_set_multi_language_title failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_button_set_multi_language_title_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + nRet = CreateButton(); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_button_create", NotificationExGetError(nRet)); + CHECK_HANDLE(g_hItemButton, "noti_ex_item_button_create"); + + nRet = CreateMultiLangHandle(); + PRINT_RESULT_CLEANUP(0, nRet, "noti_ex_multi_lang_create", "API failed or handle not created successfully", noti_ex_item_destroy(g_hItemButton)); + + //Target API + nRet = noti_ex_item_button_set_multi_language_title(g_hItemButton, g_hMultiLang); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_button_set_multi_language_title", NotificationExGetError(nRet), noti_ex_item_destroy(g_hItemButton); noti_ex_multi_lang_destroy(g_hMultiLang)); + + nRet = noti_ex_multi_lang_destroy(g_hMultiLang); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_item_destroy(g_hItemButton); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Sets the multi-language handle for checkbox. +/** +* @testcase ITc_noti_ex_item_checkbox_set_multi_language_title_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Sets the multi-language handle for checkbox. +* @scenario Creates the notification_ex checkbox and multi langauge handle \n +* Sets the multi-language handle for checkbox \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_checkbox_set_multi_language_title +* @passcase noti_ex_item_checkbox_set_multi_language_title is successful and return correct value +* @failcase noti_ex_item_checkbox_set_multi_language_title failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_checkbox_set_multi_language_title_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemCheckBox = NULL; + const char *pszCheckBoxID = "checkbox_id"; + const char *pszCheckBoxTitle = "checkbox_title"; + + nRet = noti_ex_item_checkbox_create(&hItemCheckBox, pszCheckBoxID, pszCheckBoxTitle, false); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemCheckBox, "noti_ex_item_checkbox_create"); + + nRet = CreateMultiLangHandle(); + PRINT_RESULT_CLEANUP(0, nRet, "noti_ex_multi_lang_create", "API failed or handle not created successfully", noti_ex_item_destroy(hItemCheckBox)); + + //Target API + nRet = noti_ex_item_checkbox_set_multi_language_title(hItemCheckBox, g_hMultiLang); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_set_multi_language_title", NotificationExGetError(nRet), noti_ex_item_destroy(hItemCheckBox); noti_ex_multi_lang_destroy(g_hMultiLang)); + + nRet = noti_ex_multi_lang_destroy(g_hMultiLang); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_item_destroy(hItemCheckBox); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Sets the multi-language handle for text. +/** +* @testcase ITc_noti_ex_item_text_set_multi_language_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Sets the multi-language handle for text. +* @scenario Creates the notification_ex text and multi langauge handle \n +* Sets the multi-language handle for text \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_text_set_multi_language +* @passcase noti_ex_item_text_set_multi_language is successful and return correct value +* @failcase noti_ex_item_text_set_multi_language failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_text_set_multi_language_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemText = NULL; + const char *pszTextID = "text_id"; + const char *pszTextTitle = "textTitle"; + const char *pszTextHyperLink = "testHyperLink"; + + nRet = noti_ex_item_text_create(&hItemText, pszTextID, pszTextTitle, pszTextHyperLink); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemText, "noti_ex_item_text_create"); + + nRet = CreateMultiLangHandle(); + PRINT_RESULT_CLEANUP(0, nRet, "noti_ex_multi_lang_create", "API failed or handle not created successfully", noti_ex_item_destroy(hItemText)); + + //Target API + nRet = noti_ex_item_text_set_multi_language(hItemText, g_hMultiLang); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_text_set_multi_language", NotificationExGetError(nRet), noti_ex_item_destroy(hItemText); noti_ex_multi_lang_destroy(g_hMultiLang)); + + nRet = noti_ex_multi_lang_destroy(g_hMultiLang); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_item_destroy(hItemText); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Sets the multi-language handle for entry. +/** +* @testcase ITc_noti_ex_item_entry_set_multi_language_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Sets the multi-language handle for entry. +* @scenario Creates the notification_ex entry and multi langauge handle \n +* Sets the multi-language handle for entry \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_entry_set_multi_language +* @passcase noti_ex_item_entry_set_multi_language is successful and return correct value +* @failcase noti_ex_item_entry_set_multi_language failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_entry_set_multi_language_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + + noti_ex_item_h hItemEntry = NULL; + const char *pszEntryID = "entry_id"; + + nRet = noti_ex_item_entry_create(&hItemEntry, pszEntryID); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_entry_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemEntry, "noti_ex_item_entry_create"); + + nRet = CreateMultiLangHandle(); + PRINT_RESULT_CLEANUP(0, nRet, "noti_ex_multi_lang_create", "API failed or handle not created successfully", noti_ex_item_destroy(hItemEntry)); + + //Target API + nRet = noti_ex_item_entry_set_multi_language(hItemEntry, g_hMultiLang); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_entry_set_multi_language", NotificationExGetError(nRet), noti_ex_item_destroy(hItemEntry); noti_ex_multi_lang_destroy(g_hMultiLang)); + + nRet = noti_ex_multi_lang_destroy(g_hMultiLang); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_destroy", NotificationExGetError(nRet)); + + nRet = noti_ex_item_destroy(hItemEntry); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Sets the multi-language contents for input selector item. +/** +* @testcase ITc_noti_ex_item_input_selector_set_multi_language_contents_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Sets the multi-language contents for input selector item. +* @scenario Creates the notification_ex item handle for the checkbox \n +* Get checkbox title and compare with set title \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_input_selector_set_multi_language_contents +* @passcase noti_ex_item_input_selector_set_multi_language_contents is successful and return correct value +* @failcase noti_ex_item_input_selector_set_multi_language_contents failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + noti_ex_multi_lang_h *hMultiLangARR = NULL; + noti_ex_item_h hItemInputSel = NULL; + + const char *pszInputSelID = "input_selector_id"; + char **hOutMultiLangARR = NULL; + char ARRBuf[256]; + int nCnt; + int nLoopSize = 3; + int nLoopCounter; + + hMultiLangARR = (noti_ex_multi_lang_h *)calloc(3, sizeof(noti_ex_multi_lang_h)); + if(!hMultiLangARR) + { + FPRINTF("[Line : %d][%s] calloc failed\\n", __LINE__, API_NAMESPACE); + return 1; + } + + nRet = noti_ex_item_input_selector_create(&hItemInputSel, pszInputSelID); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_input_selector_create", NotificationExGetError(nRet), FREE_MEMORY(hMultiLangARR)); + CHECK_HANDLE_CLEANUP(hItemInputSel, "noti_ex_item_input_selector_create", FREE_MEMORY(hMultiLangARR)); + + for (nLoopCounter = 0; nLoopCounter < nLoopSize; nLoopCounter++) + { + nRet = noti_ex_multi_lang_create(&hMultiLangARR[nLoopCounter], "TEST_ID", "test string(test) integer(%d) float(0.77)", nLoopCounter); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_create", NotificationExGetError(nRet), noti_ex_item_destroy(hItemInputSel); FREE_MEMORY(hMultiLangARR)); + CHECK_HANDLE_CLEANUP(hMultiLangARR[nLoopCounter], "noti_ex_multi_lang_create", noti_ex_item_destroy(hItemInputSel); FREE_MEMORY(hMultiLangARR)); + } + + //Target API + nRet = noti_ex_item_input_selector_set_multi_language_contents(hItemInputSel, hMultiLangARR, nLoopSize); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_input_selector_set_multi_language_contents", NotificationExGetError(nRet), noti_ex_item_destroy(hItemInputSel); FREE_MEMORY(hMultiLangARR)); + + for (nLoopCounter = 0; nLoopCounter < nCnt; nLoopCounter++) + { + nRet = noti_ex_multi_lang_destroy(hMultiLangARR[nLoopCounter]); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_multi_lang_destroy", NotificationExGetError(nRet)); + FREE_MEMORY(hMultiLangARR[nLoopCounter]); + } + FREE_MEMORY(hMultiLangARR); + + nRet = noti_ex_item_input_selector_get_contents(hItemInputSel, &hOutMultiLangARR, &nCnt); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_input_selector_get_contents", NotificationExGetError(nRet), noti_ex_item_destroy(hItemInputSel)); + PRINT_RESULT_CLEANUP(3, nCnt, "noti_ex_item_input_selector_get_contents", "Return count is not same as set count", noti_ex_item_destroy(hItemInputSel); FREE_MEMORY(hOutMultiLangARR)); + + for (int nLoopCounter = 0; nLoopCounter < nCnt; nLoopCounter++) + { + snprintf(ARRBuf, sizeof(ARRBuf), "test string(test) integer(%d) float(0.77)", nLoopCounter); + PRINT_RESULT_CLEANUP(0, strcmp(hOutMultiLangARR[nLoopCounter], ARRBuf), "noti_ex_multi_lang_create", NotificationExGetError(nRet), noti_ex_item_destroy(hItemInputSel); FREE_MEMORY(hOutMultiLangARR)); + } + + FREE_MEMORY(hOutMultiLangARR); + + nRet = noti_ex_item_destroy(hItemInputSel); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +//& type : auto +//& purpose: Set and Get the check state of a checkbox. +/** +* @testcase ITc_noti_ex_item_checkbox_set_get_check_state_p +* @since_tizen 5.5 +* @author SRID(manu.tiwari) +* @reviewer SRID(j.abhishek) +* @type auto +* @description Set and Get the check state of a checkbox. +* @scenario Creates the notification_ex item handle for the checkbox \n +* Gets the check state of a checkbox and compare with set title \n +* and check for Pass/Fail. +* @apicovered noti_ex_item_checkbox_set_check_state, noti_ex_item_checkbox_get_check_state +* @passcase noti_ex_item_checkbox_set_check_state, noti_ex_item_checkbox_get_check_state are successful and return correct value +* @failcase noti_ex_item_checkbox_set_check_state, noti_ex_item_checkbox_get_check_state failed or return null value +* @precondition NA +* @postcondition Destroy handle. +*/ +int ITc_noti_ex_item_checkbox_set_get_check_state_p(void) +{ + START_TEST; + + int nRet = NOTI_EX_ERROR_NONE; + noti_ex_item_h hItemCheckBox = NULL; + const char *pszCheckBoxID = "checkbox_id"; + const char *pszCheckBoxTitle = "checkbox_title"; + bool bChecked = true; + bool bIsChecked = false; + + nRet = noti_ex_item_checkbox_create(&hItemCheckBox, pszCheckBoxID, pszCheckBoxTitle, false); + PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_create", NotificationExGetError(nRet)); + CHECK_HANDLE(hItemCheckBox, "noti_ex_item_checkbox_create"); + + //Target API + nRet = noti_ex_item_checkbox_set_check_state(hItemCheckBox, bChecked); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_set_check_state", NotificationExGetError(nRet), noti_ex_item_destroy(hItemCheckBox)); + + //Target API + nRet = noti_ex_item_checkbox_get_check_state(hItemCheckBox, &bIsChecked); + PRINT_RESULT_CLEANUP(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_checkbox_get_check_state", NotificationExGetError(nRet), noti_ex_item_destroy(hItemCheckBox)); + PRINT_RESULT_CLEANUP(bChecked, bIsChecked, "noti_ex_item_checkbox_get_check_state", "Checkbox checked API returned wrong value", noti_ex_item_destroy(hItemCheckBox)); + + nRet = noti_ex_item_destroy(hItemCheckBox); + PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_item_destroy", NotificationExGetError(nRet)); + + return 0; +} + +/** @} */ //end of itc-notification-ex +/** @} */ //end of itc-notification-testcases diff --git a/src/itc/notification/res/tizen_logo.png b/src/itc/notification/res/tizen_logo.png new file mode 100755 index 000000000..e2325b425 Binary files /dev/null and b/src/itc/notification/res/tizen_logo.png differ diff --git a/src/itc/notification/tct-notification-native_mobile.h b/src/itc/notification/tct-notification-native_mobile.h index eee3dae19..1b8716c73 100755 --- a/src/itc/notification/tct-notification-native_mobile.h +++ b/src/itc/notification/tct-notification-native_mobile.h @@ -77,7 +77,6 @@ extern int ITc_noti_ex_item_chat_message_get_time_p(void); extern int ITc_noti_ex_item_chat_message_get_message_type_p(void); extern int ITc_noti_ex_item_checkbox_create_p(void); extern int ITc_noti_ex_item_checkbox_get_title_p(void); -extern int ITc_noti_ex_item_checkbox_is_checked_p(void); extern int ITc_noti_ex_item_entry_create_p(void); extern int ITc_noti_ex_item_entry_set_get_text_p(void); extern int ITc_noti_ex_item_group_create_destroy_p(void); @@ -164,6 +163,21 @@ extern int ITc_noti_ex_reporter_update_p(void); extern int ITc_noti_ex_reporter_delete_p(void); extern int ITc_noti_ex_reporter_delete_all_p(void); extern int ITc_noti_ex_reporter_find_by_root_id_p(void); +extern int ITc_noti_ex_style_set_get_background_image_p(void); +extern int ITc_noti_ex_style_set_get_background_color_p(void); +extern int ITc_noti_ex_item_check_type_exist_p(void); +extern int ITc_noti_ex_item_set_get_ongoing_state_p(void); +extern int ITc_noti_ex_item_progress_set_get_type_p(void); +extern int ITc_noti_ex_item_set_get_main_type_p(void); +extern int ITc_noti_ex_item_find_by_main_type_p(void); +extern int ITc_noti_ex_manager_get_by_channel_p(void); +extern int ITc_noti_ex_multi_lang_create_destroy_p(void); +extern int ITc_noti_ex_item_button_set_multi_language_title_p(void); +extern int ITc_noti_ex_item_checkbox_set_multi_language_title_p(void); +extern int ITc_noti_ex_item_text_set_multi_language_p(void); +extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void); +extern int ITc_noti_ex_item_entry_set_multi_language_p(void); +extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void); testcase tc_array[] = { {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup}, @@ -218,7 +232,6 @@ testcase tc_array[] = { {"ITc_noti_ex_item_chat_message_get_message_type_p", ITc_noti_ex_item_chat_message_get_message_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_checkbox_create_p", ITc_noti_ex_item_checkbox_create_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_checkbox_get_title_p", ITc_noti_ex_item_checkbox_get_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, - {"ITc_noti_ex_item_checkbox_is_checked_p", ITc_noti_ex_item_checkbox_is_checked_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_entry_create_p", ITc_noti_ex_item_entry_create_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_entry_set_get_text_p", ITc_noti_ex_item_entry_set_get_text_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_group_create_destroy_p", ITc_noti_ex_item_group_create_destroy_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, @@ -305,6 +318,21 @@ testcase tc_array[] = { {"ITc_noti_ex_reporter_delete_p", ITc_noti_ex_reporter_delete_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_reporter_delete_all_p", ITc_noti_ex_reporter_delete_all_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_reporter_find_by_root_id_p", ITc_noti_ex_reporter_find_by_root_id_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_style_set_get_background_image_p", ITc_noti_ex_style_set_get_background_image_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_style_set_get_background_color_p", ITc_noti_ex_style_set_get_background_color_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_check_type_exist_p", ITc_noti_ex_item_check_type_exist_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_ongoing_state_p", ITc_noti_ex_item_set_get_ongoing_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_progress_set_get_type_p", ITc_noti_ex_item_progress_set_get_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_main_type_p", ITc_noti_ex_item_set_get_main_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_find_by_main_type_p", ITc_noti_ex_item_find_by_main_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_manager_get_by_channel_p", ITc_noti_ex_manager_get_by_channel_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_multi_lang_create_destroy_p", ITc_noti_ex_multi_lang_create_destroy_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_button_set_multi_language_title_p", ITc_noti_ex_item_button_set_multi_language_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_checkbox_set_multi_language_title_p", ITc_noti_ex_item_checkbox_set_multi_language_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_text_set_multi_language_p", ITc_noti_ex_item_text_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {NULL, NULL} }; diff --git a/src/itc/notification/tct-notification-native_tizeniot.h b/src/itc/notification/tct-notification-native_tizeniot.h index eee3dae19..eaa01d57f 100755 --- a/src/itc/notification/tct-notification-native_tizeniot.h +++ b/src/itc/notification/tct-notification-native_tizeniot.h @@ -164,6 +164,21 @@ extern int ITc_noti_ex_reporter_update_p(void); extern int ITc_noti_ex_reporter_delete_p(void); extern int ITc_noti_ex_reporter_delete_all_p(void); extern int ITc_noti_ex_reporter_find_by_root_id_p(void); +extern int ITc_noti_ex_style_set_get_background_image_p(void); +extern int ITc_noti_ex_style_set_get_background_color_p(void); +extern int ITc_noti_ex_item_check_type_exist_p(void); +extern int ITc_noti_ex_item_set_get_ongoing_state_p(void); +extern int ITc_noti_ex_item_progress_set_get_type_p(void); +extern int ITc_noti_ex_item_set_get_main_type_p(void); +extern int ITc_noti_ex_item_find_by_main_type_p(void); +extern int ITc_noti_ex_manager_get_by_channel_p(void); +extern int ITc_noti_ex_multi_lang_create_destroy_p(void); +extern int ITc_noti_ex_item_button_set_multi_language_title_p(void); +extern int ITc_noti_ex_item_checkbox_set_multi_language_title_p(void); +extern int ITc_noti_ex_item_text_set_multi_language_p(void); +extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void); +extern int ITc_noti_ex_item_entry_set_multi_language_p(void); +extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void); testcase tc_array[] = { {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup}, @@ -305,6 +320,21 @@ testcase tc_array[] = { {"ITc_noti_ex_reporter_delete_p", ITc_noti_ex_reporter_delete_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_reporter_delete_all_p", ITc_noti_ex_reporter_delete_all_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_reporter_find_by_root_id_p", ITc_noti_ex_reporter_find_by_root_id_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_style_set_get_background_image_p", ITc_noti_ex_style_set_get_background_image_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_style_set_get_background_color_p", ITc_noti_ex_style_set_get_background_color_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_check_type_exist_p", ITc_noti_ex_item_check_type_exist_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_ongoing_state_p", ITc_noti_ex_item_set_get_ongoing_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_progress_set_get_type_p", ITc_noti_ex_item_progress_set_get_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_main_type_p", ITc_noti_ex_item_set_get_main_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_find_by_main_type_p", ITc_noti_ex_item_find_by_main_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_manager_get_by_channel_p", ITc_noti_ex_manager_get_by_channel_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_multi_lang_create_destroy_p", ITc_noti_ex_multi_lang_create_destroy_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_button_set_multi_language_title_p", ITc_noti_ex_item_button_set_multi_language_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_checkbox_set_multi_language_title_p", ITc_noti_ex_item_checkbox_set_multi_language_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_text_set_multi_language_p", ITc_noti_ex_item_text_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {NULL, NULL} }; diff --git a/src/itc/notification/tct-notification-native_wearable.h b/src/itc/notification/tct-notification-native_wearable.h index eee3dae19..e98f6830a 100755 --- a/src/itc/notification/tct-notification-native_wearable.h +++ b/src/itc/notification/tct-notification-native_wearable.h @@ -77,7 +77,6 @@ extern int ITc_noti_ex_item_chat_message_get_time_p(void); extern int ITc_noti_ex_item_chat_message_get_message_type_p(void); extern int ITc_noti_ex_item_checkbox_create_p(void); extern int ITc_noti_ex_item_checkbox_get_title_p(void); -extern int ITc_noti_ex_item_checkbox_is_checked_p(void); extern int ITc_noti_ex_item_entry_create_p(void); extern int ITc_noti_ex_item_entry_set_get_text_p(void); extern int ITc_noti_ex_item_group_create_destroy_p(void); @@ -164,6 +163,21 @@ extern int ITc_noti_ex_reporter_update_p(void); extern int ITc_noti_ex_reporter_delete_p(void); extern int ITc_noti_ex_reporter_delete_all_p(void); extern int ITc_noti_ex_reporter_find_by_root_id_p(void); +extern int ITc_noti_ex_style_set_get_background_image_p(void); +extern int ITc_noti_ex_style_set_get_background_color_p(void); +extern int ITc_noti_ex_item_check_type_exist_p(void); +extern int ITc_noti_ex_item_set_get_ongoing_state_p(void); +extern int ITc_noti_ex_item_progress_set_get_type_p(void); +extern int ITc_noti_ex_item_set_get_main_type_p(void); +extern int ITc_noti_ex_item_find_by_main_type_p(void); +extern int ITc_noti_ex_manager_get_by_channel_p(void); +extern int ITc_noti_ex_multi_lang_create_destroy_p(void); +extern int ITc_noti_ex_item_button_set_multi_language_title_p(void); +extern int ITc_noti_ex_item_checkbox_set_multi_language_title_p(void); +extern int ITc_noti_ex_item_text_set_multi_language_p(void); +extern int ITc_noti_ex_item_entry_set_multi_language_p(void); +extern int ITc_noti_ex_item_input_selector_set_multi_language_contents_p(void); +extern int ITc_noti_ex_item_checkbox_set_get_check_state_p(void); testcase tc_array[] = { {"ITc_notification_clone_p",ITc_notification_clone_p,ITs_notification_startup,ITs_notification_cleanup}, @@ -218,7 +232,6 @@ testcase tc_array[] = { {"ITc_noti_ex_item_chat_message_get_message_type_p", ITc_noti_ex_item_chat_message_get_message_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_checkbox_create_p", ITc_noti_ex_item_checkbox_create_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_checkbox_get_title_p", ITc_noti_ex_item_checkbox_get_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, - {"ITc_noti_ex_item_checkbox_is_checked_p", ITc_noti_ex_item_checkbox_is_checked_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_entry_create_p", ITc_noti_ex_item_entry_create_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_entry_set_get_text_p", ITc_noti_ex_item_entry_set_get_text_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_item_group_create_destroy_p", ITc_noti_ex_item_group_create_destroy_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, @@ -305,6 +318,21 @@ testcase tc_array[] = { {"ITc_noti_ex_reporter_delete_p", ITc_noti_ex_reporter_delete_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_reporter_delete_all_p", ITc_noti_ex_reporter_delete_all_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {"ITc_noti_ex_reporter_find_by_root_id_p", ITc_noti_ex_reporter_find_by_root_id_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_style_set_get_background_image_p", ITc_noti_ex_style_set_get_background_image_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_style_set_get_background_color_p", ITc_noti_ex_style_set_get_background_color_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_check_type_exist_p", ITc_noti_ex_item_check_type_exist_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_ongoing_state_p", ITc_noti_ex_item_set_get_ongoing_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_progress_set_get_type_p", ITc_noti_ex_item_progress_set_get_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_set_get_main_type_p", ITc_noti_ex_item_set_get_main_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_find_by_main_type_p", ITc_noti_ex_item_find_by_main_type_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_manager_get_by_channel_p", ITc_noti_ex_manager_get_by_channel_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_multi_lang_create_destroy_p", ITc_noti_ex_multi_lang_create_destroy_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_button_set_multi_language_title_p", ITc_noti_ex_item_button_set_multi_language_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_checkbox_set_multi_language_title_p", ITc_noti_ex_item_checkbox_set_multi_language_title_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_text_set_multi_language_p", ITc_noti_ex_item_text_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_entry_set_multi_language_p", ITc_noti_ex_item_entry_set_multi_language_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_input_selector_set_multi_language_contents_p", ITc_noti_ex_item_input_selector_set_multi_language_contents_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, + {"ITc_noti_ex_item_checkbox_set_get_check_state_p", ITc_noti_ex_item_checkbox_set_get_check_state_p, ITs_notification_ex_startup, ITs_notification_ex_cleanup}, {NULL, NULL} };