[ITC][capi-ui-inputmethod][NonACR][TSDF-1076, 1 failed testcase fix] 89/256589/3
authorNibha Sharma <nibha.sharma@samsung.com>
Wed, 7 Apr 2021 16:02:52 +0000 (21:32 +0530)
committershobhit verma <shobhit.v@samsung.com>
Wed, 7 Apr 2021 16:22:17 +0000 (16:22 +0000)
Change-Id: I6caf645202712eea4bc854760a40ffbf39ad7969
Signed-off-by: Nibha Sharma <nibha.sharma@samsung.com>
src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod-common.h
src/itc/capi-ui-inputmethod/ITs-capi-ui-inputmethod.c

index 7d06efd1da9fcf4d07ff3ff11dc92339f62f37ee..2354611b3e00aaec538056a683f2467e027fd7c2 100755 (executable)
@@ -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);
index 71c42f4618920841a1128d61d71514e4be79813e..3ddd3cb1ec2c2c4b3691c9bdc072bf467a04a6a1 100755 (executable)
@@ -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;
 }