[ITC][tts][ACR-1779] TCs added for playing mode & pcm callback API 37/296937/1
authorShobhit Verma <shobhit.v@samsung.com>
Mon, 7 Aug 2023 11:10:24 +0000 (16:40 +0530)
committerShobhit Verma <shobhit.v@samsung.com>
Mon, 7 Aug 2023 11:10:24 +0000 (16:40 +0530)
Change-Id: I70571df13c1e6f7c40377d9f306fa3782d0cfade
Signed-off-by: Shobhit Verma <shobhit.v@samsung.com>
src/itc/tts/ITs-tts.c
src/itc/tts/tct-tts-native_mobile.h
src/itc/tts/tct-tts-native_tizeniot.h
src/itc/tts/tct-tts-native_tv.h
src/itc/tts/tct-tts-native_wearable.h

index 56de6abc644b0893f99b48fd6fc7ce37ac8ee001..0797ba48228238be3d4d694e065199b19d332d5e 100644 (file)
@@ -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;
+}
+/** @} */
 /** @} */
index c87f523ba47eac590c0d298088f2db489d11bfcb..87860e1dc471da92e953f9efe13cc8d2b0c255d8 100644 (file)
@@ -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}
 };
 
index c834ce42c14164d53e6e96a8532fedd73fac09dc..57a9d99b8c031f8a21ac322e1653bf10ba525391 100644 (file)
@@ -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}
 };
 
index 67244ac0ce1ace8870b58280a0b4490e6b5eb483..5e67fc549d91609b01104b36fe6fc5ec9f60f2e8 100644 (file)
@@ -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}
 };
 
index c87f523ba47eac590c0d298088f2db489d11bfcb..87860e1dc471da92e953f9efe13cc8d2b0c255d8 100644 (file)
@@ -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}
 };