#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;
}
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);
//& 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)
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));
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[] = {
{"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}
};
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[] = {
{"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}
};
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[] = {
{"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}
};