From: shobhitv Date: Mon, 30 Sep 2024 09:43:52 +0000 (+0530) Subject: [ITC][TTS][ACR-1862] TCs added for new APIs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F318477%2F3;p=test%2Ftct%2Fnative%2Fapi.git [ITC][TTS][ACR-1862] TCs added for new APIs Change-Id: I61be7a14b9c54ff8c7a392060fa34cdde151fdab Signed-off-by: shobhitv --- diff --git a/src/itc/tts/ITs-tts.c b/src/itc/tts/ITs-tts.c index c9ba2084f..2b8c0e18d 100644 --- a/src/itc/tts/ITs-tts.c +++ b/src/itc/tts/ITs-tts.c @@ -63,6 +63,12 @@ static void TTs_synthesized_pcm_cb(tts_h tts, int utt_id, tts_synthesized_pcm_ev FPRINTF("[Line: %d][%s] TTs_synthesized_pcm_cb callback invoked\\n", __LINE__, API_NAMESPACE); } +static bool TtsSupportedPersonalVoice(tts_h tts, const char* language, const char* unique_id, const char* display_name, const char* device_name, void* user_data) +{ + FPRINTF("[Line: %d][%s] TtsSupportedPersonalVoice callback invoked\\n", __LINE__, API_NAMESPACE); + FPRINTF("[Line: %d][%s] language: %s, unique id: %s, display_name: %s, device_name: %s\\n", __LINE__, API_NAMESPACE, language, unique_id, display_name, device_name); + return true; +} /** * @function ITs_tts_startup * @description Called before each test, created tts handle @@ -2300,5 +2306,37 @@ int ITc_tts_add_text_with_synthesis_parameter_p(void) return 0; } + +//& purpose: Get each supported personal voices of the current engine +/** +* @testcase ITc_tts_foreach_supported_personal_voices_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(utk.tiwari) +* @type auto +* @scenario Get each supported personal voices of the current engine +* @apicovered tts_foreach_supported_personal_voices +* @passcase if tts_foreach_supported_personal_voices is successful +* @failcase if tts_foreach_supported_personal_voices is not successful +* @precondition NA +* @postcondition NA +*/ +int ITc_tts_foreach_supported_personal_voices_p(void) +{ + START_TEST; + int nRet = TTS_ERROR_NONE; + + if (g_bFeatureSupported == false) + { + nRet = tts_foreach_supported_personal_voices(g_pstTts, TtsSupportedPersonalVoice, NULL); + PRINT_RESULT(TTS_ERROR_NOT_SUPPORTED, nRet, "tts_foreach_supported_personal_voices", TtsGetError(nRet)); + return 0; + } + + nRet = tts_foreach_supported_personal_voices(g_pstTts, TtsSupportedPersonalVoice, NULL); + PRINT_RESULT(TTS_ERROR_NONE, nRet, "tts_foreach_supported_personal_voices", TtsGetError(nRet)); + + return 0; +} /** @} */ /** @} */ diff --git a/src/itc/tts/ITs-ttse.c b/src/itc/tts/ITs-ttse.c index abfeb787b..2dc310b49 100644 --- a/src/itc/tts/ITs-ttse.c +++ b/src/itc/tts/ITs-ttse.c @@ -115,6 +115,12 @@ static void TTSEActivatedModeChangedCB(int activated_mode) FPRINTF("[Line : %d][%s] TTSEActivatedModeChangedCB callback invoked. Activated mode is [%d]\\n", __LINE__, API_NAMESPACE, activated_mode); return; } + +static int tts_engine_send_personal_voice(const char* ptts_id, void* user_data) +{ + FPRINTF("[Line : %d][%s] tts_engine_send_personal_voice callback invoked. \\n", __LINE__, API_NAMESPACE); + return 0; +} /** * @function ITs_ttse_startup * @description Called before each test @@ -418,5 +424,59 @@ int ITc_ttse_get_activated_mode_p(void) PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_get_activated_mode", TtseGetError(nRet)); return 0; } + +/** +* @testcase ITc_ttse_send_personal_voice_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(utk.tiwari) +* @type auto +* @description Sends the personal voice's information to the engine service user +* @scenario call ttse_send_personal_voice to send personal voice's information to the engine service user +* @apicovered ttse_send_personal_voice +* @passcase If ttse_send_personal_voice api gets pass +* @failcase If ttse_send_personal_voice api gets fail +* @precondition NA +* @postcondition NA +*/ +int ITc_ttse_send_personal_voice_p(void) +{ + START_TEST_TTSE; + + int nRet = ttse_main(g_argc, g_argv, &g_tts_engine_callback); + PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_main", TtseGetError(nRet)); + + nRet = ttse_send_personal_voice("ko_KR", "id", "1234", "5678"); + PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_send_personal_voice", TtseGetError(nRet)); + + return 0; +} + +/** +* @testcase ITc_ttse_set_personal_tts_id_set_cb_p +* @since_tizen 9.0 +* @author SRID(shobhit.v) +* @reviewer SRID(utk.tiwari) +* @type auto +* @description Sets a callback function to be called when a personal TTS id is set +* @scenario call ttse_set_personal_tts_id_set_cb to set callback function to be called when a personal TTS id is set +* @apicovered ttse_set_personal_tts_id_set_cb +* @passcase If ttse_set_personal_tts_id_set_cb api gets pass +* @failcase If ttse_set_personal_tts_id_set_cb api gets fail +* @precondition NA +* @postcondition NA +*/ +int ITc_ttse_set_personal_tts_id_set_cb_p(void) +{ + START_TEST_TTSE; + + int nRet = ttse_main(g_argc, g_argv, &g_tts_engine_callback); + PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_main", TtseGetError(nRet)); + + nRet = ttse_set_personal_tts_id_set_cb(tts_engine_send_personal_voice, NULL); + PRINT_RESULT(TTSE_ERROR_NONE, nRet, "ttse_set_personal_tts_id_set_cb", TtseGetError(nRet)); + + return 0; +} /** @} */ /** @} */ diff --git a/src/itc/tts/tct-tts-native_mobile.h b/src/itc/tts/tct-tts-native_mobile.h index cb473436c..279c5652d 100644 --- a/src/itc/tts/tct-tts-native_mobile.h +++ b/src/itc/tts/tct-tts-native_mobile.h @@ -66,6 +66,9 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void); extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void); extern int ITc_tts_get_pitch_volume_range_p(void); extern int ITc_tts_add_text_with_synthesis_parameter_p(void); +extern int ITc_tts_foreach_supported_personal_voices_p(void); +extern int ITc_ttse_send_personal_voice_p(void); +extern int ITc_ttse_set_personal_tts_id_set_cb_p(void); testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -110,6 +113,9 @@ testcase tc_array[] = { {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_ttse_send_personal_voice_p",ITc_ttse_send_personal_voice_p,ITs_ttse_startup,ITs_ttse_cleanup}, + {"ITc_ttse_set_personal_tts_id_set_cb_p",ITc_ttse_set_personal_tts_id_set_cb_p,ITs_ttse_startup,ITs_ttse_cleanup}, {NULL, NULL} }; diff --git a/src/itc/tts/tct-tts-native_tizeniot.h b/src/itc/tts/tct-tts-native_tizeniot.h index c46caacfc..80d459e39 100644 --- a/src/itc/tts/tct-tts-native_tizeniot.h +++ b/src/itc/tts/tct-tts-native_tizeniot.h @@ -65,6 +65,9 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void); extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void); extern int ITc_tts_get_pitch_volume_range_p(void); extern int ITc_tts_add_text_with_synthesis_parameter_p(void); +extern int ITc_tts_foreach_supported_personal_voices_p(void); +extern int ITc_ttse_send_personal_voice_p(void); +extern int ITc_ttse_set_personal_tts_id_set_cb_p(void); testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -108,6 +111,9 @@ testcase tc_array[] = { {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_ttse_send_personal_voice_p",ITc_ttse_send_personal_voice_p,ITs_ttse_startup,ITs_ttse_cleanup}, + {"ITc_ttse_set_personal_tts_id_set_cb_p",ITc_ttse_set_personal_tts_id_set_cb_p,ITs_ttse_startup,ITs_ttse_cleanup}, {NULL, NULL} }; diff --git a/src/itc/tts/tct-tts-native_tv.h b/src/itc/tts/tct-tts-native_tv.h index 2d8858481..693ac5869 100644 --- a/src/itc/tts/tct-tts-native_tv.h +++ b/src/itc/tts/tct-tts-native_tv.h @@ -58,6 +58,8 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void); extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void); extern int ITc_tts_get_pitch_volume_range_p(void); extern int ITc_tts_add_text_with_synthesis_parameter_p(void); +extern int ITc_tts_foreach_supported_personal_voices_p(void); + testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -94,6 +96,7 @@ testcase tc_array[] = { {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_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 cb473436c..279c5652d 100644 --- a/src/itc/tts/tct-tts-native_wearable.h +++ b/src/itc/tts/tct-tts-native_wearable.h @@ -66,6 +66,9 @@ extern int ITc_tts_synthesis_parameter_set_speed_set_pitch_p(void); extern int ITc_tts_synthesis_parameter_set_volume_background_ratio_p(void); extern int ITc_tts_get_pitch_volume_range_p(void); extern int ITc_tts_add_text_with_synthesis_parameter_p(void); +extern int ITc_tts_foreach_supported_personal_voices_p(void); +extern int ITc_ttse_send_personal_voice_p(void); +extern int ITc_ttse_set_personal_tts_id_set_cb_p(void); testcase tc_array[] = { {"ITc_tts_create_destroy_p",ITc_tts_create_destroy_p,ITs_tts_startup,ITs_tts_cleanup}, @@ -110,6 +113,9 @@ testcase tc_array[] = { {"ITc_tts_add_silence_utterance_p",ITc_tts_add_silence_utterance_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_add_text_with_synthesis_parameter_p",ITc_tts_add_text_with_synthesis_parameter_p,ITs_tts_startup,ITs_tts_cleanup}, {"ITc_tts_get_pitch_volume_range_p",ITc_tts_get_pitch_volume_range_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_tts_foreach_supported_personal_voices_p",ITc_tts_foreach_supported_personal_voices_p,ITs_tts_startup,ITs_tts_cleanup}, + {"ITc_ttse_send_personal_voice_p",ITc_ttse_send_personal_voice_p,ITs_ttse_startup,ITs_ttse_cleanup}, + {"ITc_ttse_set_personal_tts_id_set_cb_p",ITc_ttse_set_personal_tts_id_set_cb_p,ITs_ttse_startup,ITs_ttse_cleanup}, {NULL, NULL} };