+++ /dev/null
-//
-// Copyright (c) 2019 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "ITs-notification-common.h"
-
-#define TEST_APPID "org.tizen.noti_ex_manager"
-
-/**
-* @function EventinfoReporterEventsErrorCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-void EventinfoReporterEventsErrorCB(noti_ex_reporter_h handle, noti_ex_error_e error, int req_id, void *data)
-{
- g_CallBackHit = true;
-#if DEBUG
- FPRINTF("[Line : %d][%s] EventinfoReporterEventsErrorCB Callback Invoked\\n", __LINE__, API_NAMESPACE);
-#endif
-}
-
-/**
-* @function EventinfoCloneAddCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-void EventinfoCloneAddCB(noti_ex_reporter_h hNotiManager, noti_ex_event_info_h hNotiInfo, noti_ex_item_h *hNotiItem, int nCount, void *pszData)
-{
- int nRet;
- int nReqId;
-
- g_CallBackHit = true;
- g_bAPIFailed = false;
- noti_ex_event_info_h hEventInfo = NULL;
-
- FPRINTF("[Line : %d][%s] EventinfoCloneAddCB callback hit \\n", __LINE__, API_NAMESPACE);
-
- nRet = noti_ex_event_info_clone(hNotiInfo, &hEventInfo);
- PRINT_RESULT_CALLBACK_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_event_info_clone", NotificationExGetError(nRet));
-
- nRet = noti_ex_event_info_destroy(hEventInfo);
- PRINT_RESULT_CALLBACK_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_event_info_destroy", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_delete_all(g_hEventinfoReporter, &nReqId);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_delete_all", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_destroy(g_hEventinfoReporter);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_destroy", NotificationExGetError(nRet));
-
- g_CallBackHit = true;
- if(g_pNotificationMainLoop)
- {
- g_main_loop_quit(g_pNotificationMainLoop);
- g_pNotificationMainLoop = NULL;
- }
- return;
-}
-/**
-* @function EventInfoEventTypeCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-void EventInfoEventTypeCB(noti_ex_reporter_h handle, noti_ex_event_info_h info,noti_ex_item_h *added_item, int cnt, void *pszData)
-{
- g_CallBackHit = false;
- g_bAPIFailed = false;
- int nRet = -1;
- int nReqId;
- noti_ex_event_info_type_e event_type;
-
- FPRINTF("[Line : %d][%s] EventInfoEventTypeCB callback hit \\n", __LINE__, API_NAMESPACE);
-
- nRet = noti_ex_event_info_get_event_type(info, &event_type);
- PRINT_RESULT_CALLBACK_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_event_info_get_event_type", NotificationExGetError(nRet));
- PRINT_RESULT_CALLBACK_NORETURN(event_type, NOTI_EX_EVENT_UPDATE, "noti_ex_event_info_get_event_type", "values are not correct");
-
- nRet = noti_ex_reporter_delete_all(g_hEventinfoReporter, &nReqId);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_delete_all", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_destroy(g_hEventinfoReporter);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_destroy", NotificationExGetError(nRet));
-
- g_CallBackHit = true;
- if(g_pNotificationMainLoop)
- {
- g_main_loop_quit(g_pNotificationMainLoop);
- g_pNotificationMainLoop = NULL;
- }
- return;
-}
-/**
-* @function EventinfoGetOwnerCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-void EventinfoGetOwnerCB(noti_ex_reporter_h handle, noti_ex_event_info_h info, noti_ex_item_h *added_item, int cnt, void *data)
-{
- int nRet;
- int nReqId;
- char *pszOwner = NULL;
- g_CallBackHit = false;
- g_bAPIFailed = false;
-
- FPRINTF("[Line : %d][%s] EventinfoGetOwnerCB callback hit \\n", __LINE__, API_NAMESPACE);
-
- nRet = noti_ex_event_info_get_owner(info, &pszOwner);
- PRINT_RESULT_CALLBACK_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_event_info_get_owner", NotificationExGetError(nRet));
-
- if (pszOwner != NULL)
- FREE_MEMORY(pszOwner);
-
- nRet = noti_ex_reporter_delete_all(g_hEventinfoReporter, &nReqId);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_delete_all", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_destroy(g_hEventinfoReporter);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_destroy", NotificationExGetError(nRet));
-
- g_CallBackHit = true;
- if(g_pNotificationMainLoop)
- {
- g_main_loop_quit(g_pNotificationMainLoop);
- g_pNotificationMainLoop = NULL;
- }
- return;
-}
-/**
-* @function EventinfoGetChannelCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-void EventinfoGetChannelCB(noti_ex_reporter_h handle, noti_ex_event_info_h info, noti_ex_item_h *added_item, int cnt, void *data)
-{
- int nRet;
- int nReqId;
- char *pszChannel = NULL;
- g_CallBackHit = false;
- g_bAPIFailed = false;
-
- FPRINTF("[Line : %d][%s] EventinfoGetChannelCB callback hit \\n", __LINE__, API_NAMESPACE);
-
- nRet = noti_ex_event_info_get_channel(info, &pszChannel);
- PRINT_RESULT_CALLBACK_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_event_info_get_channel", NotificationExGetError(nRet));
-
- if (pszChannel)
- FREE_MEMORY(pszChannel);
-
- nRet = noti_ex_reporter_delete_all(g_hEventinfoReporter, &nReqId);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_delete_all", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_destroy(g_hEventinfoReporter);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_destroy", NotificationExGetError(nRet));
-
- g_CallBackHit = true;
- if(g_pNotificationMainLoop)
- {
- g_main_loop_quit(g_pNotificationMainLoop);
- g_pNotificationMainLoop = NULL;
- }
- return;
-}
-/**
-* @function EventinfoGetItemCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-void EventinfoGetItemCB(noti_ex_reporter_h handle, noti_ex_event_info_h info, noti_ex_item_h *added_item, int cnt, void *data)
-{
- int nRet;
- int nReqId;
- char *pszId = NULL;
- g_CallBackHit = false;
- g_bAPIFailed = false;
- FPRINTF("[Line : %d][%s] EventinfoGetItemCB callback hit \\n", __LINE__, API_NAMESPACE);
- nRet = noti_ex_event_info_get_item_id(info, &pszId);
- PRINT_RESULT_CALLBACK_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_event_info_get_item_id", NotificationExGetError(nRet));
-
- if (pszId)
- FREE_MEMORY(pszId);
-
- nRet = noti_ex_reporter_delete_all(g_hEventinfoReporter, &nReqId);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_delete_all", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_destroy(g_hEventinfoReporter);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_destroy", NotificationExGetError(nRet));
-
- g_CallBackHit = true;
- if(g_pNotificationMainLoop)
- {
- g_main_loop_quit(g_pNotificationMainLoop);
- g_pNotificationMainLoop = NULL;
- }
- return;
-}
-/**
-* @function EventinfoGetRequestIdCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-void EventinfoGetRequestIdCB(noti_ex_reporter_h handle, noti_ex_event_info_h info, noti_ex_item_h *added_item, int cnt, void *data)
-{
- int nRet;
- int req_id;
- int nReqId;
- g_CallBackHit = false;
- g_bAPIFailed = false;
-
- FPRINTF("[Line : %d][%s] EventinfoGetRequestIdCB callback hit \\n", __LINE__, API_NAMESPACE);
-
- nRet = noti_ex_event_info_get_request_id(info, &req_id);
- PRINT_RESULT_CALLBACK_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_event_info_get_request_id", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_delete_all(g_hEventinfoReporter, &nReqId);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_delete_all", NotificationExGetError(nRet));
-
- nRet = noti_ex_reporter_destroy(g_hEventinfoReporter);
- PRINT_RESULT_NORETURN(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_destroy", NotificationExGetError(nRet));
-
- g_CallBackHit = true;
- if(g_pNotificationMainLoop)
- {
- g_main_loop_quit(g_pNotificationMainLoop);
- g_pNotificationMainLoop = NULL;
- }
- return;
-}
-/**
-* @function ReplyCB
-* @description CallBack function
-* @parameter NA
-* @return NA
-*/
-
-static void ReplyCB(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
-{
- FPRINTF("[Line : %d][%s] ReplyCB Callback hit\\n", __LINE__, API_NAMESPACE);
-}
-/**
-* @function ITs_notification_ex_info_startup
-* @description Called before each test
-* @parameter NA
-* @return NA
-*/
-void ITs_notification_ex_event_info_startup(void)
-{
- struct stat stBuff;
- if ( stat(ERR_LOG, &stBuff) == 0 )
- {
- remove(ERR_LOG);
- }
-#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_notification_ex_info_startup \\n", __LINE__, API_NAMESPACE);
-#endif
- app_control_h request;
- int ret;
- bool running = false;
- int nTimeoutId = 0;
- app_manager_is_running(TEST_APPID, &running);
- if(!running)
- {
- app_control_create(&request);
- if (!request)
- {
- FPRINTF("[Line : %d][%s] app_control_create failed \\n", __LINE__, API_NAMESPACE);
- return;
- }
- ret = app_control_set_app_id(request, TEST_APPID);
- if (ret != APP_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] app_control_set_app_id failed \\n", __LINE__, API_NAMESPACE);
- return;
- }
- ret = app_control_send_launch_request(request, ReplyCB, NULL);
- if (ret != APP_ERROR_NONE)
- {
- FPRINTF("[Line : %d][%s] app_control_send_launch_request failed \\n", __LINE__, API_NAMESPACE);
- return;
- }
- g_pNotificationMainLoop = g_main_loop_new(NULL, false);
- nTimeoutId = g_timeout_add(5000, Timeout, g_pNotificationMainLoop);
- g_main_loop_run(g_pNotificationMainLoop);
- g_source_remove(nTimeoutId);
- g_pNotificationMainLoop = NULL;
- }
- return;
-}
-
-/**
-* @function ITs_notification_ex_event_info_cleanup
-* @description Called after each test
-* @parameter NA
-* @return NA
-*/
-void ITs_notification_ex_event_info_cleanup(void)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_notification_ex_event_info_cleanup \\n", __LINE__, API_NAMESPACE);
-#endif
- return;
-}
-//& type : auto
-//& purpose: Clones and Releases the notification event info handle.
-/**
-* @testcase ITc_noti_ex_event_info_clone_destroy_p
-* @since_tizen 5.5
-* @author SRID(j.abhishek)
-* @reviewer SRID(shobhit.v)
-* @type auto
-* @description Clones and Releases the notification event info handle.
-* @scenario Creates notification_ex manager and event handler \n
-* register callbacks, set flag to invole specific API in callback \n
-* call SendNotification helper function to invoke callback and Check for callback hit.
-* @apicovered noti_ex_event_info_clone, noti_ex_event_info_destroy
-* @passcase noti_ex_event_info_clone and noti_ex_event_info_destroy are successful and return correct value
-* @failcase noti_ex_event_info_clone and/or noti_ex_event_info_destroy failed
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_noti_ex_event_info_clone_destroy_p(void)
-{
- START_TEST;
-
- int nTimeoutId = 0;
- int nRet = NOTI_EX_ERROR_NONE;
- g_CallBackHit = false;
- g_hEventinfoReporter = NULL;
- noti_ex_reporter_events_s hReportEvent = {0};
-
- hReportEvent.error = EventinfoReporterEventsErrorCB;
- hReportEvent.event = EventinfoCloneAddCB;
-
- g_eEventInfoAPI = EX_EVENT_INFO_CLONE;
-
- nRet = noti_ex_reporter_create(&g_hEventinfoReporter, hReportEvent, NULL);
- PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_create", NotificationExGetError(nRet));
- CHECK_HANDLE(g_hEventinfoReporter, "noti_ex_reporter_create");
- nRet = SendNotification();
- if(nRet)
- {
- FPRINTF("[Line : %d][%s] One of the API called inside SendNotification() is failed and returned \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- RUN_POLLING_LOOP;
- if(!g_CallBackHit)
- {
- FPRINTF("[Line : %d][%s] EventinfoReporterEventsErrorCB or EventinfoCloneAddCB Callback not hit for noti_ex_event_info_clone()\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- if (g_bAPIFailed)
- {
- FPRINTF("[Line : %d][%s] noti_ex_event_info_clone() target API failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- return 0;
-}
-
-//& type : auto
-//& purpose: Gets the type of an event.
-/**
-* @testcase ITc_noti_ex_event_info_get_event_type_p
-* @since_tizen 5.5
-* @author SRID(j.abhishek)
-* @reviewer SRID(shobhit.v)
-* @type auto
-* @description Gets the type of an event.
-* @scenario Creates notification_ex manager and event handler \n
-* register callbacks, set flag to invole specific API in callback \n
-* call SendNotification helper function to invoke callback and Check for callback hit.
-* @apicovered noti_ex_event_info_get_event_type
-* @passcase noti_ex_event_info_get_event_type is successful and return correct value
-* @failcase noti_ex_event_info_get_event_type failed
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_noti_ex_event_info_get_event_type_p(void)
-{
- START_TEST;
-
- int nTimeoutId = 0;
- g_CallBackHit = false;
- int nRet = NOTI_EX_ERROR_NONE;
- g_hEventinfoReporter = NULL;
- noti_ex_reporter_events_s hReportEvent = {0};
-
- hReportEvent.error = EventinfoReporterEventsErrorCB;
- hReportEvent.event = EventInfoEventTypeCB;
-
- nRet = noti_ex_reporter_create(&g_hEventinfoReporter, hReportEvent, NULL);
- PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_create", NotificationExGetError(nRet));
- CHECK_HANDLE(g_hEventinfoReporter, "noti_ex_reporter_create");
-
- nRet = SendNotification();
- if(nRet)
- {
- FPRINTF("[Line : %d][%s] One of the API called inside SendNotification() is failed and returned \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- RUN_POLLING_LOOP;
- if(!g_CallBackHit)
- {
- FPRINTF("[Line : %d][%s] EventinfoReporterEventsErrorCB or EventinfoEventTypeCB Callback not hit\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- if (g_bAPIFailed)
- {
- FPRINTF("[Line : %d][%s] noti_ex_event_info_get_event_type() target API failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- return 0;
-}
-
-//& type : auto
-//& purpose: Gets the app id of event owner.
-/**
-* @testcase ITc_noti_ex_event_info_get_owner_p
-* @since_tizen 5.5
-* @author SRID(j.abhishek)
-* @reviewer SRID(shobhit.v)
-* @type auto
-* @description Gets the app id of event owner.
-* @scenario Creates notification_ex manager and event handler \n
-* register callbacks, set flag to invole specific API in callback \n
-* call SendNotification helper function to invoke callback and Check for callback hit.
-* @apicovered noti_ex_event_info_get_owner
-* @passcase noti_ex_event_info_get_owner is successful and return correct value
-* @failcase noti_ex_event_info_get_owner failed
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_noti_ex_event_info_get_owner_p(void)
-{
- START_TEST;
-
- int nTimeoutId = 0;
- int nRet = NOTI_EX_ERROR_NONE;
- g_hEventinfoReporter = NULL;
- noti_ex_reporter_events_s hReportEvent = {0};
- g_CallBackHit = false;
-
- hReportEvent.error = EventinfoReporterEventsErrorCB;
- hReportEvent.event = EventinfoGetOwnerCB;
-
- nRet = noti_ex_reporter_create(&g_hEventinfoReporter, hReportEvent, NULL);
- PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_create", NotificationExGetError(nRet));
- CHECK_HANDLE(g_hEventinfoReporter, "noti_ex_reporter_create");
-
- nRet = SendNotification();
- if(nRet)
- {
- FPRINTF("[Line : %d][%s] One of the API called inside SendNotification() is failed and returned \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- RUN_POLLING_LOOP;
- if(!g_CallBackHit)
- {
- FPRINTF("[Line : %d][%s] EventinfoReporterEventsErrorCB or EventinfoGetOwnerCB Callback not hit\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- if (g_bAPIFailed)
- {
- FPRINTF("[Line : %d][%s] noti_ex_event_info_get_owner() target API failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
-
- return 0;
-}
-
-//& type : auto
-//& purpose: Gets the channel of an event.
-/**
-* @testcase ITc_noti_ex_event_info_get_channel_p
-* @since_tizen 5.5
-* @author SRID(j.abhishek)
-* @reviewer SRID(shobhit.v)
-* @type auto
-* @description Gets the channel of an event.
-* @scenario Creates notification_ex manager and event handler \n
-* register callbacks, set flag to invole specific API in callback \n
-* call SendNotification helper function to invoke callback and Check for callback hit.
-* @apicovered noti_ex_event_info_get_channel
-* @passcase noti_ex_event_info_get_channel is successful and return correct value
-* @failcase noti_ex_event_info_get_channel failed
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_noti_ex_event_info_get_channel_p(void)
-{
- START_TEST;
-
- int nTimeoutId = 0;
- int nRet = NOTI_EX_ERROR_NONE;
- g_hEventinfoReporter = NULL;
- noti_ex_reporter_events_s hReportEvent = {0};
- g_CallBackHit = false;
-
- hReportEvent.error = EventinfoReporterEventsErrorCB;
- hReportEvent.event = EventinfoGetChannelCB;
- g_eEventInfoAPI = EX_EVENT_INFO_GET_CHANNEL;
-
- nRet = noti_ex_reporter_create(&g_hEventinfoReporter, hReportEvent, NULL);
- PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_create", NotificationExGetError(nRet));
- CHECK_HANDLE(g_hEventinfoReporter, "noti_ex_reporter_create");
-
- nRet = SendNotification();
- if(nRet)
- {
- FPRINTF("[Line : %d][%s] One of the API called inside SendNotification() is failed and returned \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- RUN_POLLING_LOOP;
- if(!g_CallBackHit)
- {
- FPRINTF("[Line : %d][%s] EventinfoReporterEventsErrorCB or EventinfoGetChannelCB Callback not hit\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- if (g_bAPIFailed)
- {
- FPRINTF("[Line : %d][%s] noti_ex_event_info_get_channel() target API failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- return 0;
-}
-
-//& type : auto
-//& purpose: Gets the id of a notification_ex item.
-/**
-* @testcase ITc_noti_ex_event_info_get_item_id_p
-* @since_tizen 5.5
-* @author SRID(j.abhishek)
-* @reviewer SRID(shobhit.v)
-* @type auto
-* @description Gets the id of a notification_ex item.
-* @scenario Creates notification_ex manager and event handler \n
-* register callbacks, set flag to invole specific API in callback \n
-* call SendNotification helper function to invoke callback and Check for callback hit.
-* @apicovered noti_ex_event_info_get_item_id
-* @passcase noti_ex_event_info_get_item_id is successful and return correct value
-* @failcase noti_ex_event_info_get_item_id failed
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_noti_ex_event_info_get_item_id_p(void)
-{
- START_TEST;
-
- int nTimeoutId = 0;
- int nRet = NOTI_EX_ERROR_NONE;
- g_hEventinfoReporter = NULL;
- noti_ex_reporter_events_s hReportEvent = {0};
- g_CallBackHit = false;
-
- hReportEvent.event = EventinfoGetItemCB;
- hReportEvent.error = EventinfoReporterEventsErrorCB;
-
- g_eEventInfoAPI = EX_EVENT_INFO_GET_ITEM_ID;
-
- nRet = noti_ex_reporter_create(&g_hEventinfoReporter, hReportEvent, NULL);
- PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_create", NotificationExGetError(nRet));
- CHECK_HANDLE(g_hEventinfoReporter, "noti_ex_reporter_create");
-
- nRet = SendNotification();
- if(nRet)
- {
- FPRINTF("[Line : %d][%s] One of the API called inside SendNotification() is failed and returned \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- RUN_POLLING_LOOP;
- if(!g_CallBackHit)
- {
- FPRINTF("[Line : %d][%s] EventinfoReporterEventsErrorCB or EventinfoGetItemCB Callback not hit\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- if (g_bAPIFailed)
- {
- FPRINTF("[Line : %d][%s] noti_ex_event_info_get_item_id() target API failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- return 0;
-}
-
-//& type : auto
-//& purpose: Gets the id of request for an event.
-/**
-* @testcase ITc_noti_ex_event_info_get_request_id_p
-* @since_tizen 5.5
-* @author SRID(j.abhishek)
-* @reviewer SRID(shobhit.v)
-* @type auto
-* @description Gets the id of request for an event.
-* @scenario Creates notification_ex manager and event handler \n
-* register callbacks, set flag to invole specific API in callback \n
-* call SendNotification helper function to invoke callback and Check for callback hit.
-* @apicovered noti_ex_event_info_get_request_id
-* @passcase noti_ex_event_info_get_request_id is successful and return correct value
-* @failcase noti_ex_event_info_get_request_id failed
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_noti_ex_event_info_get_request_id_p(void)
-{
- START_TEST;
-
- int nTimeoutId = 0;
- int nRet = NOTI_EX_ERROR_NONE;
- g_hEventinfoReporter = NULL;
- noti_ex_reporter_events_s hReportEvent = {0};
- g_CallBackHit = false;
-
- hReportEvent.event = EventinfoGetRequestIdCB;
- hReportEvent.error = EventinfoReporterEventsErrorCB;
-
- g_eEventInfoAPI = EX_EVENT_INFO_GET_REQUEST_ID;
-
- nRet = noti_ex_reporter_create(&g_hEventinfoReporter, hReportEvent, NULL);
- PRINT_RESULT(NOTI_EX_ERROR_NONE, nRet, "noti_ex_reporter_create", NotificationExGetError(nRet));
- CHECK_HANDLE(g_hEventinfoReporter, "noti_ex_reporter_create");
-
- nRet = SendNotification();
- if(nRet)
- {
- FPRINTF("[Line : %d][%s] One of the API called inside SendNotification() is failed and returned \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- RUN_POLLING_LOOP;
- if(!g_CallBackHit)
- {
- FPRINTF("[Line : %d][%s] EventinfoReporterEventsErrorCB or EventinfoGetRequestIdCB Callback not hit\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- if (g_bAPIFailed)
- {
- FPRINTF("[Line : %d][%s] noti_ex_event_info_get_request_id() target API failed\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
-
- return 0;
-}
-