[ITC][stt][DPTTIZEN-2171][Fix TC logic according to developer comments]
authorShashank Shekhar Shukla <shekhar1.s@samsung.com>
Tue, 12 Jul 2016 02:05:08 +0000 (11:05 +0900)
committerShashank Shekhar Shukla <shekhar1.s@samsung.com>
Tue, 12 Jul 2016 02:07:15 +0000 (19:07 -0700)
Change-Id: Ife87264d397f34b52ed565ba1570a89946ef5cd5
Signed-off-by: Shashank Shekhar Shukla <shekhar1.s@samsung.com>
src/itc/stt/ITs-stt.c
src/itc/stt/tct-stt-native_mobile.h
src/itc/stt/tct-stt-native_tv.h
src/itc/stt/tct-stt-native_wearable.h

index 5e5b341..4f35391 100755 (executable)
@@ -718,20 +718,11 @@ bool sttEngineChangedcb(stt_h stt, const char* engine_id, const char* language,
 #if DEBUG
        FPRINTF("[Line : %d][%s] Reached sttEngineChangedcb\\n", __LINE__, API_NAMESPACE);
 #endif
-
-       g_CallBackHit = true;
        
        if(stt == NULL)
        {
                FPRINTF("[Line : %d][%s] Handle is NULL in callback function\\n", __LINE__, API_NAMESPACE);
        }
-       
-       if ( g_pMainLoop )
-       {
-               g_main_loop_quit(g_pMainLoop);
-               g_main_loop_unref(g_pMainLoop);
-               g_pMainLoop = NULL;
-       }       
        return true;
 }
 
@@ -2819,13 +2810,7 @@ int ITc_stt_set_get_private_data_p(void)
        nRet = stt_get_private_data(g_hStt,"test",&Getdata);
        PRINT_RESULT_CLEANUP(STT_ERROR_NONE, nRet, "stt_get_private_data", SttGetError(nRet), stt_unprepare(g_hStt);FREE_MEMORY(Getdata));
        
-       if( 0 != strcmp("data",Getdata) )
-       {
-               FPRINTF("[Line : %d][%s] get data is not matched \\n", __LINE__, API_NAMESPACE);
-               FREE_MEMORY(Getdata);
-               stt_unprepare(g_hStt);
-               return 1;
-       }
+       /*According to the developer, it is unnecessary to compare the key and result as stt_set_private_data() is for setting the key and not saving.*/
        
        FREE_MEMORY(Getdata);
        nRet = stt_unprepare(g_hStt);   
@@ -2836,68 +2821,6 @@ int ITc_stt_set_get_private_data_p(void)
 //& type: auto
 //& purpose: To get the list of supported voices.
 /**
-* @testcase                            ITc_stt_get_error_message_p
-* @since_tizen                                 3.0
-* @author                                      SRID(asit.s)
-* @reviewer                    SRID(a.pandia1)
-* @type                                        auto
-* @scenario                                    create a stt handler\n
-*                                                      call stt_set_error_cb to register callback function\n
-*                                                      call stt_set_credential with NULL parameters to generate error\n
-*                                                      call stt_get_error_message to get error.
-* @apicovered                          stt_set_credential,stt_set_error_cb,stt_get_error_message.
-* @passcase                                    if API is successful
-* @failcase                                    if API is not successful
-* @precondition                                NA
-* @postcondition                       NA
-*/
-int ITc_stt_get_error_message_p(void)
-{
-       START_TEST;
-       
-       char* err_msg = NULL;
-       stt_state_e state;
-       int nIotconTimeoutId = 0;
-       
-       int nRet =  stt_get_state(g_hStt, &state);
-       PRINT_RESULT(STT_ERROR_NONE, nRet, "stt_get_state", SttGetError(nRet));
-       
-       if(state != STT_STATE_CREATED)
-       {
-               FPRINTF("[Line : %d][%s] get state is not matched \\n", __LINE__, API_NAMESPACE);
-               return 1;
-       }
-       
-       nRet = stt_set_error_cb(g_hStt, sttErrorCallback, NULL);
-       PRINT_RESULT(STT_ERROR_NONE, nRet, "stt_set_error_cb", SttGetError(nRet));
-
-       //This API called for generating error
-       nRet = stt_set_credential(NULL,NULL);
-       PRINT_RESULT_NORETURN(STT_ERROR_NONE,nRet,"stt_set_credential",SttGetError(nRet));
-       
-       RUN_POLLING_LOOP;
-       if(g_CallBackHit != true)
-       {
-               FPRINTF("[Line : %d][%s] callback hit failed \\n", __LINE__, API_NAMESPACE);
-               stt_unset_error_cb(g_hStt);
-               return 1;
-       }
-       
-       nRet = stt_get_error_message(g_hStt, &err_msg);
-       PRINT_RESULT_CLEANUP(STT_ERROR_NONE,nRet,"stt_get_error_message",SttGetError(nRet),stt_unset_error_cb(g_hStt);FREE_MEMORY(err_msg));    
-       CHECK_HANDLE(err_msg, "stt_get_error_message");
-       FREE_MEMORY(err_msg);
-       
-       nRet = stt_unset_error_cb(g_hStt);
-       PRINT_RESULT_NORETURN(STT_ERROR_NONE, nRet, "stt_unset_error_cb", SttGetError(nRet));
-       
-       return 0;
-}
-
-
-//& type: auto
-//& purpose: To get the list of supported voices.
-/**
 * @testcase                            ITc_stt_set_unset_engine_changed_cb_p
 * @since_tizen                                 3.0
 * @author                                      SRID(asit.s)
@@ -2915,18 +2838,12 @@ int ITc_stt_get_error_message_p(void)
 int ITc_stt_set_unset_engine_changed_cb_p(void)
 {
        START_TEST;
-       int nIotconTimeoutId = 0;
        g_CallBackHit = false;
        
        int nRet = stt_set_engine_changed_cb(g_hStt,sttEngineChangedcb,NULL);
        PRINT_RESULT(STT_ERROR_NONE, nRet, "stt_set_engine_changed_cb", SttGetError(nRet));
-       
-       RUN_POLLING_LOOP;
-       if(g_CallBackHit != true)
-       {
-               FPRINTF("[Line : %d][%s] callback hit failed \\n", __LINE__, API_NAMESPACE);
-               return 1;
-       }
+
+       /*According to the developer, it is impossible to change the STT Engine in the situation and hence callback cannot be checked.*/
        
        nRet = stt_unset_engine_changed_cb(g_hStt);
        PRINT_RESULT(STT_ERROR_NONE, nRet, "stt_unset_engine_changed_cb", SttGetError(nRet));
index f06e225..6650920 100755 (executable)
@@ -44,7 +44,6 @@ extern int ITc_stt_foreach_supported_engines_p(void);
 extern int ITc_stt_foreach_supported_languages_p(void);
 extern int ITc_stt_set_credential_p(void);
 extern int ITc_stt_set_get_private_data_p(void);
-extern int ITc_stt_get_error_message_p(void);
 extern int ITc_stt_set_unset_engine_changed_cb_p(void);
 
 testcase tc_array[] = {
@@ -70,7 +69,6 @@ testcase tc_array[] = {
     {"ITc_stt_foreach_supported_languages_p", ITc_stt_foreach_supported_languages_p, ITs_stt_startup, ITs_stt_cleanup},
     {"ITc_stt_set_credential_p", ITc_stt_set_credential_p, ITs_stt_startup, ITs_stt_cleanup},
        {"ITc_stt_set_get_private_data_p", ITc_stt_set_get_private_data_p, ITs_stt_startup, ITs_stt_cleanup},
-       {"ITc_stt_get_error_message_p", ITc_stt_get_error_message_p, ITs_stt_startup, ITs_stt_cleanup},
     {"ITc_stt_set_unset_engine_changed_cb_p", ITc_stt_set_unset_engine_changed_cb_p, ITs_stt_startup, ITs_stt_cleanup},
     {NULL, NULL}
 };
index 0c25ccc..140e113 100755 (executable)
@@ -43,7 +43,6 @@ extern int ITc_stt_foreach_supported_engines_p(void);
 extern int ITc_stt_foreach_supported_languages_p(void);
 extern int ITc_stt_set_credential_p(void);
 extern int ITc_stt_set_get_private_data_p(void);
-extern int ITc_stt_get_error_message_p(void);
 extern int ITc_stt_set_unset_engine_changed_cb_p(void);
 
 testcase tc_array[] = {
@@ -69,7 +68,6 @@ testcase tc_array[] = {
     {"ITc_stt_foreach_supported_languages_p", ITc_stt_foreach_supported_languages_p, ITs_stt_startup, ITs_stt_cleanup},
     {"ITc_stt_set_credential_p", ITc_stt_set_credential_p, ITs_stt_startup, ITs_stt_cleanup},
        {"ITc_stt_set_get_private_data_p", ITc_stt_set_get_private_data_p, ITs_stt_startup, ITs_stt_cleanup},
-       {"ITc_stt_get_error_message_p", ITc_stt_get_error_message_p, ITs_stt_startup, ITs_stt_cleanup},
     {"ITc_stt_set_unset_engine_changed_cb_p", ITc_stt_set_unset_engine_changed_cb_p, ITs_stt_startup, ITs_stt_cleanup},
     {NULL, NULL}
 };
index f06e225..6650920 100755 (executable)
@@ -44,7 +44,6 @@ extern int ITc_stt_foreach_supported_engines_p(void);
 extern int ITc_stt_foreach_supported_languages_p(void);
 extern int ITc_stt_set_credential_p(void);
 extern int ITc_stt_set_get_private_data_p(void);
-extern int ITc_stt_get_error_message_p(void);
 extern int ITc_stt_set_unset_engine_changed_cb_p(void);
 
 testcase tc_array[] = {
@@ -70,7 +69,6 @@ testcase tc_array[] = {
     {"ITc_stt_foreach_supported_languages_p", ITc_stt_foreach_supported_languages_p, ITs_stt_startup, ITs_stt_cleanup},
     {"ITc_stt_set_credential_p", ITc_stt_set_credential_p, ITs_stt_startup, ITs_stt_cleanup},
        {"ITc_stt_set_get_private_data_p", ITc_stt_set_get_private_data_p, ITs_stt_startup, ITs_stt_cleanup},
-       {"ITc_stt_get_error_message_p", ITc_stt_get_error_message_p, ITs_stt_startup, ITs_stt_cleanup},
     {"ITc_stt_set_unset_engine_changed_cb_p", ITc_stt_set_unset_engine_changed_cb_p, ITs_stt_startup, ITs_stt_cleanup},
     {NULL, NULL}
 };