From: Nibha Sharma Date: Wed, 7 Apr 2021 16:02:52 +0000 (+0530) Subject: [ITC][capi-ui-inputmethod][NonACR][TSDF-1076, 1 failed testcase fix] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08a4e02c5fcbb511eec226251ce2e8b33a83fc9e;p=test%2Ftct%2Fnative%2Fapi.git [ITC][capi-ui-inputmethod][NonACR][TSDF-1076, 1 failed testcase fix] Change-Id: I6caf645202712eea4bc854760a40ffbf39ad7969 Signed-off-by: Nibha Sharma --- diff --git a/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod-common.h b/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod-common.h index 7d06efd1d..2354611b3 100755 --- a/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod-common.h +++ b/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod-common.h @@ -35,7 +35,7 @@ //Add helper function declarations here char* InputGetError(int nRet); -int g_nRet; +int g_nRet,g_nRetUnset; bool g_bCallbackCalled; bool g_bSupportAPIFailed; typedef void (*void_f)(void); diff --git a/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod.c b/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod.c index 71c42f461..3ddd3cb1e 100755 --- a/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod.c +++ b/src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod.c @@ -286,21 +286,21 @@ static void IMEInputHintSetCb(Ecore_IMF_Input_Hints InputHint, void *pszUserData } /** -* @function InputMethodEventSetInputHintSetCb -* @description Callback for ime_run to Set input hint event callback function. +* @function InputMethodEventSetUnsetInputHintSetCb +* @description Callback for ime_run to Set and Unset input hint event callback function. * @parameter NA * @return NA */ -static void InputMethodEventSetInputHintSetCb() +static void InputMethodEventSetUnsetInputHintSetCb() { g_bCallbackCalled = true; - FPRINTF("[Line : %d][%s] InputMethodEventSetInputHintSetCb Callback called\\n", __LINE__, API_NAMESPACE); + FPRINTF("[Line : %d][%s] InputMethodEventSetUnsetInputHintSetCb Callback called\\n", __LINE__, API_NAMESPACE); Evas_Object *hWindow = NULL; hWindow = CreateNormalWin(); if(!hWindow) { - FPRINTF("[Line : %d][%s] CreateNormalWin() called from InputMethodEventSetInputHintSetCb callback is failed to create window\\n", __LINE__, API_NAMESPACE); + FPRINTF("[Line : %d][%s] CreateNormalWin() called from InputMethodEventSetUnsetInputHintSetCb callback is failed to create window\\n", __LINE__, API_NAMESPACE); g_bSupportAPIFailed = true; return; } @@ -318,6 +318,9 @@ static void InputMethodEventSetInputHintSetCb() g_nRet = ime_event_set_input_hint_set_cb(IMEInputHintSetCb, NULL); PRINT_RESULT_NORETURN(IME_ERROR_NONE, g_nRet, "ime_event_set_input_hint_set_cb", InputGetError(g_nRet)); + g_nRetUnset = ime_event_unset_input_hint_set_cb(); + PRINT_RESULT_NORETURN(IME_ERROR_NONE, g_nRetUnset, "ime_event_unset_input_hint_set_cb", InputGetError(g_nRetUnset)); + elm_entry_single_line_set(hEntry, EINA_TRUE); evas_object_del(hWindow); @@ -326,22 +329,6 @@ static void InputMethodEventSetInputHintSetCb() elm_exit(); } -/** -* @function InputMethodEventUnsetInputHintSetCb -* @description Callback for ime_run to Unset input hint event callback function. -* @parameter NA -* @return NA -*/ -static void InputMethodEventUnsetInputHintSetCb() -{ - g_bCallbackCalled = true; - FPRINTF("[Line : %d][%s] InputMethodEventUnsetInputHintSetCb callback called\\n", __LINE__, API_NAMESPACE); - - g_nRet = ime_event_unset_input_hint_set_cb(); - PRINT_RESULT_NORETURN(IME_ERROR_NONE, g_nRet, "ime_event_unset_input_hint_set_cb", InputGetError(g_nRet)); - elm_exit(); -} - /** * @function InputMethodUpdatePreeditCursorCb * @description Callback for ime_run to call preedit cursor function. @@ -718,23 +705,18 @@ int ITc_ime_event_set_unset_input_hint_set_cb_p(void) { START_TEST; - g_nRet = -1; + g_nRet = -1;g_nRetUnset = -1; g_bCallbackCalled = false; g_bSupportAPIFailed = false; - int nRet = ime_run(&basic_callback, (void *)InputMethodEventSetInputHintSetCb); + int nRet = ime_run(&basic_callback, (void *)InputMethodEventSetUnsetInputHintSetCb); PRINT_RESULT(IME_ERROR_NONE, nRet, "ime_run", InputGetError(nRet)); - PRINT_RESULT(true, g_bCallbackCalled, "ime_event_set_input_hint_set_cb", "Callback not invoked"); - PRINT_RESULT(false, g_bSupportAPIFailed, "ime_event_set_input_hint_set_cb", "Support APIs caled inside callback failed"); + PRINT_RESULT(true, g_bCallbackCalled, "InputMethodEventSetUnsetInputHintSetCb", "Callback not invoked"); + PRINT_RESULT(false, g_bSupportAPIFailed, "InputMethodEventSetUnsetInputHintSetCb", "Support APIs caled inside callback failed"); PRINT_RESULT(IME_ERROR_NONE, g_nRet, "ime_event_set_input_hint_set_cb", InputGetError(g_nRet)); + PRINT_RESULT(IME_ERROR_NONE, g_nRetUnset, "ime_event_unset_input_hint_set_cb", InputGetError(g_nRetUnset)); - - nRet = ime_run(&basic_callback, (void *)InputMethodEventUnsetInputHintSetCb); - - PRINT_RESULT(IME_ERROR_NONE, nRet, "ime_run", InputGetError(nRet)); - PRINT_RESULT(true, g_bCallbackCalled, "ime_event_unset_input_hint_set_cb", "Callback not invoked"); - PRINT_RESULT(IME_ERROR_NONE, g_nRet, "ime_event_unset_input_hint_set_cb", InputGetError(g_nRet)); return 0; }