From: Shobhit Verma Date: Mon, 7 Aug 2023 11:10:24 +0000 (+0530) Subject: [ITC][tts][ACR-1779] TCs added for playing mode & pcm callback API X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d37d7d27e4d886eb535d09492720c7c293843c3;p=test%2Ftct%2Fnative%2Fapi.git [ITC][tts][ACR-1779] TCs added for playing mode & pcm callback API Change-Id: I70571df13c1e6f7c40377d9f306fa3782d0cfade Signed-off-by: Shobhit Verma --- diff --git a/src/itc/tts/ITs-tts.c b/src/itc/tts/ITs-tts.c index 56de6abc6..0797ba482 100644 --- a/src/itc/tts/ITs-tts.c +++ b/src/itc/tts/ITs-tts.c @@ -58,6 +58,11 @@ static bool TtsIsServiceStateChanged(tts_service_state_e service_state, int slee return true; } +static void TTs_synthesized_pcm_cb(tts_h tts, int utt_id, tts_synthesized_pcm_event_e event, const char* pcm_data, int pcm_data_size, tts_audio_type_e audio_type, int sample_rate, void *user_data) +{ + FPRINTF("[Line: %d][%s] TTs_synthesized_pcm_cb callback invoked\\n", __LINE__, API_NAMESPACE); +} + /** * @function ITs_tts_startup * @description Called before each test, created tts handle @@ -1761,5 +1766,85 @@ int ITc_tts_set_unset_service_state_changed_cb_p(void) return 0; } -/** @} */ + +//& type: auto +//& purpose: To set and unset synthesized pcm callback +/** +* @testcase ITc_tts_set_unset_synthesized_pcm_cb_p +* @since_tizen 8.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario Set synthesized pcm callback and unset +* @apicovered tts_set_synthesized_pcm_cb and tts_unset_synthesized_pcm_cb +* @passcase if all APIs are successful +* @failcase if API is not successful +* @precondition NA +* @postcondition NA +*/ +int ITc_tts_set_unset_synthesized_pcm_cb_p(void) +{ + START_TEST; + + int nRet = TTS_ERROR_NONE; + if (g_bFeatureSupported == false) + { + nRet = tts_set_synthesized_pcm_cb(g_pstTts, TTs_synthesized_pcm_cb, NULL); + PRINT_RESULT(TTS_ERROR_NOT_SUPPORTED, nRet, "tts_set_synthesized_pcm_cb", TtsGetError(nRet)); + + nRet = tts_unset_synthesized_pcm_cb(g_pstTts); + PRINT_RESULT(TTS_ERROR_NOT_SUPPORTED, nRet, "tts_unset_synthesized_pcm_cb", TtsGetError(nRet)); + return 0; + } + + nRet = tts_set_synthesized_pcm_cb(g_pstTts, TTs_synthesized_pcm_cb, NULL); + PRINT_RESULT(TTS_ERROR_NONE, nRet, "tts_set_synthesized_pcm_cb", TtsGetError(nRet)); + + nRet = tts_unset_synthesized_pcm_cb(g_pstTts); + PRINT_RESULT(TTS_ERROR_NONE, nRet, "tts_unset_synthesized_pcm_cb", TtsGetError(nRet)); + return 0; +} + +//& type: auto +//& purpose: To set playing mode by service +/** +* @testcase ITc_tts_set_playing_mode_p +* @since_tizen 8.0 +* @author SRID(shobhit.v) +* @reviewer SRID(tarun1.kumar) +* @type auto +* @scenario To set playing mode by service +* @apicovered tts_set_playing_mode +* @passcase if tts_set_playing_mode is successful +* @failcase if tts_set_playing_mode is not successful +* @precondition NA +* @postcondition NA +*/ +int ITc_tts_set_playing_mode_p(void) +{ + START_TEST; + + int nRet = TTS_ERROR_NONE; + tts_playing_mode_e playing_mode = TTS_PLAYING_MODE_BY_SERVICE; + if (g_bFeatureSupported == false) + { + nRet = tts_set_playing_mode(g_pstTts, playing_mode); + PRINT_RESULT(TTS_ERROR_NOT_SUPPORTED, nRet, "tts_set_playing_mode", TtsGetError(nRet)); + playing_mode = TTS_PLAYING_MODE_BY_CLIENT; + nRet = tts_set_playing_mode(g_pstTts, playing_mode); + PRINT_RESULT(TTS_ERROR_NOT_SUPPORTED, nRet, "tts_set_playing_mode", TtsGetError(nRet)); + return 0; + } + + playing_mode = TTS_PLAYING_MODE_BY_SERVICE; + nRet = tts_set_playing_mode(g_pstTts, playing_mode); + PRINT_RESULT(TTS_ERROR_NONE, nRet, "tts_set_playing_mode", TtsGetError(nRet)); + + playing_mode = TTS_PLAYING_MODE_BY_CLIENT; + nRet = tts_set_playing_mode(g_pstTts, playing_mode); + PRINT_RESULT(TTS_ERROR_NONE, nRet, "tts_set_playing_mode", TtsGetError(nRet)); + + return 0; +} +/** @} */ /** @} */ diff --git a/src/itc/tts/tct-tts-native_mobile.h b/src/itc/tts/tct-tts-native_mobile.h index c87f523ba..87860e1dc 100644 --- a/src/itc/tts/tct-tts-native_mobile.h +++ b/src/itc/tts/tct-tts-native_mobile.h @@ -55,6 +55,8 @@ extern int ITc_ttse_set_activated_mode_changed_cb_p(void); extern int ITc_ttse_get_activated_mode_p(void); extern int ITc_tts_get_service_state_p(void); extern int ITc_tts_set_unset_service_state_changed_cb_p(void); +extern int ITc_tts_set_unset_synthesized_pcm_cb_p(void); +extern int ITc_tts_set_playing_mode_p(void); testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -88,6 +90,8 @@ testcase tc_array[] = { {"ITc_ttse_get_activated_mode_p",ITc_ttse_get_activated_mode_p,ITs_ttse_startup,ITs_ttse_cleanup}, {"ITc_tts_get_service_state_p",ITc_tts_get_service_state_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_set_unset_service_state_changed_cb_p",ITc_tts_set_unset_service_state_changed_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_unset_synthesized_pcm_cb_p",ITc_tts_set_unset_synthesized_pcm_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_playing_mode_p",ITc_tts_set_playing_mode_p,ITs_tts_startup,ITs_tts_cleanup}, {NULL, NULL} }; diff --git a/src/itc/tts/tct-tts-native_tizeniot.h b/src/itc/tts/tct-tts-native_tizeniot.h index c834ce42c..57a9d99b8 100644 --- a/src/itc/tts/tct-tts-native_tizeniot.h +++ b/src/itc/tts/tct-tts-native_tizeniot.h @@ -54,6 +54,8 @@ extern int ITc_ttse_set_activated_mode_changed_cb_p(void); extern int ITc_ttse_get_activated_mode_p(void); extern int ITc_tts_get_service_state_p(void); extern int ITc_tts_set_unset_service_state_changed_cb_p(void); +extern int ITc_tts_set_unset_synthesized_pcm_cb_p(void); +extern int ITc_tts_set_playing_mode_p(void); testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -86,6 +88,8 @@ testcase tc_array[] = { {"ITc_ttse_get_activated_mode_p",ITc_ttse_get_activated_mode_p,ITs_ttse_startup,ITs_ttse_cleanup}, {"ITc_tts_get_service_state_p",ITc_tts_get_service_state_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_set_unset_service_state_changed_cb_p",ITc_tts_set_unset_service_state_changed_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_unset_synthesized_pcm_cb_p",ITc_tts_set_unset_synthesized_pcm_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_playing_mode_p",ITc_tts_set_playing_mode_p,ITs_tts_startup,ITs_tts_cleanup}, {NULL, NULL} }; diff --git a/src/itc/tts/tct-tts-native_tv.h b/src/itc/tts/tct-tts-native_tv.h index 67244ac0c..5e67fc549 100644 --- a/src/itc/tts/tct-tts-native_tv.h +++ b/src/itc/tts/tct-tts-native_tv.h @@ -47,6 +47,8 @@ extern int ITc_tts_set_unset_screen_reader_changed_cb_p(void); extern int ITc_tts_prepare_sync_p(void); extern int ITc_tts_get_service_state_p(void); extern int ITc_tts_set_unset_service_state_changed_cb_p(void); +extern int ITc_tts_set_unset_synthesized_pcm_cb_p(void); +extern int ITc_tts_set_playing_mode_p(void); testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -72,6 +74,8 @@ testcase tc_array[] = { {"ITc_tts_prepare_sync_p",ITc_tts_prepare_sync_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_get_service_state_p",ITc_tts_get_service_state_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_set_unset_service_state_changed_cb_p",ITc_tts_set_unset_service_state_changed_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_unset_synthesized_pcm_cb_p",ITc_tts_set_unset_synthesized_pcm_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_playing_mode_p",ITc_tts_set_playing_mode_p,ITs_tts_startup,ITs_tts_cleanup}, {NULL, NULL} }; diff --git a/src/itc/tts/tct-tts-native_wearable.h b/src/itc/tts/tct-tts-native_wearable.h index c87f523ba..87860e1dc 100644 --- a/src/itc/tts/tct-tts-native_wearable.h +++ b/src/itc/tts/tct-tts-native_wearable.h @@ -55,6 +55,8 @@ extern int ITc_ttse_set_activated_mode_changed_cb_p(void); extern int ITc_ttse_get_activated_mode_p(void); extern int ITc_tts_get_service_state_p(void); extern int ITc_tts_set_unset_service_state_changed_cb_p(void); +extern int ITc_tts_set_unset_synthesized_pcm_cb_p(void); +extern int ITc_tts_set_playing_mode_p(void); testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -88,6 +90,8 @@ testcase tc_array[] = { {"ITc_ttse_get_activated_mode_p",ITc_ttse_get_activated_mode_p,ITs_ttse_startup,ITs_ttse_cleanup}, {"ITc_tts_get_service_state_p",ITc_tts_get_service_state_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_set_unset_service_state_changed_cb_p",ITc_tts_set_unset_service_state_changed_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_unset_synthesized_pcm_cb_p",ITc_tts_set_unset_synthesized_pcm_cb_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_set_playing_mode_p",ITc_tts_set_playing_mode_p,ITs_tts_startup,ITs_tts_cleanup}, {NULL, NULL} };