From: Tarun Kumar Date: Thu, 10 Aug 2023 08:32:26 +0000 (+0530) Subject: [ITC][stt][ACR-1785] Add TC's for setting and getting audio id X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36f45d1e96c35cbaca7f0ce60d3ea5f09ba0d52d;p=test%2Ftct%2Fnative%2Fapi.git [ITC][stt][ACR-1785] Add TC's for setting and getting audio id Change-Id: Iedeec8c59dfb08695307138274ccc53cdb57f5c5 Signed-off-by: Tarun Kumar --- diff --git a/src/itc/stt/ITs-stt.c b/src/itc/stt/ITs-stt.c index 688ca99d5..9d41c6f94 100755 --- a/src/itc/stt/ITs-stt.c +++ b/src/itc/stt/ITs-stt.c @@ -3289,5 +3289,46 @@ int ITc_stt_send_audio_streaming_p(void) return 0; } +//& type: auto +//& purpose: Set and get audio id. +/** +* @testcase ITc_stt_get_set_audio_id_p +* @since_tizen 8.0 +* @author SRID(tarun1.kumar) +* @reviewer SRID(shobhit.v) +* @type auto +* @scenario create a stt handler\n +* @apicovered stt_set_audio_id, stt_get_audio_id +* @passcase if stt_set_audio_id, stt_get_audio_id and precondition API are successful +* @failcase if stt_set_audio_id, stt_get_audio_id and precondition API are successful +* @precondition NA +* @postcondition NA +*/ +int ITc_stt_set_get_audio_id_p(void) +{ + START_TEST; + const char *audio_id = "test"; + char *get_id = NULL; + + if ( false==g_bFeatureSupported ){ + int nRet=stt_set_audio_id(g_hStt, audio_id); + PRINT_RESULT(STT_ERROR_NOT_SUPPORTED, nRet, "stt_set_audio_id", SttGetError(nRet)); + + nRet=stt_get_audio_id(g_hStt, &get_id); + PRINT_RESULT(STT_ERROR_NOT_SUPPORTED, nRet, "stt_get_audio_id", SttGetError(nRet)); + return 0; + } + + int nRet=stt_set_audio_id(g_hStt, audio_id); + PRINT_RESULT(STT_ERROR_NONE, nRet, "stt_set_audio_id", SttGetError(nRet)); + nRet=stt_get_audio_id(g_hStt, &get_id); + PRINT_RESULT(STT_ERROR_NONE, nRet, "stt_get_audio_id", SttGetError(nRet)); + nRet=strncmp(get_id, audio_id, strlen(get_id)); + PRINT_RESULT(0, nRet, "strncmp","audio_id_mismatch_error"); + + return 0; +} + + /** @} */ /** @} */ diff --git a/src/itc/stt/tct-stt-native_mobile.h b/src/itc/stt/tct-stt-native_mobile.h index 705e7f808..9607da687 100755 --- a/src/itc/stt/tct-stt-native_mobile.h +++ b/src/itc/stt/tct-stt-native_mobile.h @@ -55,6 +55,7 @@ extern int ITc_stte_set_unset_audio_type_set_cb_p(void); extern int ITc_stt_start_stop_audio_streaming_p(void); extern int ITc_stt_get_audio_format_p(void); extern int ITc_stt_send_audio_streaming_p(void); +extern int ITc_stt_set_get_audio_id_p(void); testcase tc_array[] = { {"ITc_stt_create_destroy_p",ITc_stt_create_destroy_p,ITs_stt_startup,ITs_stt_cleanup}, @@ -88,6 +89,7 @@ testcase tc_array[] = { {"ITc_stt_start_stop_audio_streaming_p",ITc_stt_start_stop_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_get_audio_format_p",ITc_stt_get_audio_format_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_send_audio_streaming_p",ITc_stt_send_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, + {"ITc_stt_set_get_audio_id_p",ITc_stt_set_get_audio_id_p,ITs_stt_startup, ITs_stt_cleanup}, {NULL, NULL} }; diff --git a/src/itc/stt/tct-stt-native_tizeniot.h b/src/itc/stt/tct-stt-native_tizeniot.h index 705e7f808..9607da687 100755 --- a/src/itc/stt/tct-stt-native_tizeniot.h +++ b/src/itc/stt/tct-stt-native_tizeniot.h @@ -55,6 +55,7 @@ extern int ITc_stte_set_unset_audio_type_set_cb_p(void); extern int ITc_stt_start_stop_audio_streaming_p(void); extern int ITc_stt_get_audio_format_p(void); extern int ITc_stt_send_audio_streaming_p(void); +extern int ITc_stt_set_get_audio_id_p(void); testcase tc_array[] = { {"ITc_stt_create_destroy_p",ITc_stt_create_destroy_p,ITs_stt_startup,ITs_stt_cleanup}, @@ -88,6 +89,7 @@ testcase tc_array[] = { {"ITc_stt_start_stop_audio_streaming_p",ITc_stt_start_stop_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_get_audio_format_p",ITc_stt_get_audio_format_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_send_audio_streaming_p",ITc_stt_send_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, + {"ITc_stt_set_get_audio_id_p",ITc_stt_set_get_audio_id_p,ITs_stt_startup, ITs_stt_cleanup}, {NULL, NULL} }; diff --git a/src/itc/stt/tct-stt-native_tv.h b/src/itc/stt/tct-stt-native_tv.h index b4eddcd54..1dcf194c8 100755 --- a/src/itc/stt/tct-stt-native_tv.h +++ b/src/itc/stt/tct-stt-native_tv.h @@ -52,6 +52,7 @@ extern int ITc_stte_set_unset_audio_type_set_cb_p(void); extern int ITc_stt_start_stop_audio_streaming_p(void); extern int ITc_stt_get_audio_format_p(void); extern int ITc_stt_send_audio_streaming_p(void); +extern int ITc_stt_set_get_audio_id_p(void); testcase tc_array[] = { {"ITc_stt_create_destroy_p",ITc_stt_create_destroy_p,ITs_stt_startup,ITs_stt_cleanup}, @@ -82,6 +83,7 @@ testcase tc_array[] = { {"ITc_stt_start_stop_audio_streaming_p",ITc_stt_start_stop_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_get_audio_format_p",ITc_stt_get_audio_format_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_send_audio_streaming_p",ITc_stt_send_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, + {"ITc_stt_set_get_audio_id_p",ITc_stt_set_get_audio_id_p,ITs_stt_startup, ITs_stt_cleanup}, {NULL, NULL} }; diff --git a/src/itc/stt/tct-stt-native_wearable.h b/src/itc/stt/tct-stt-native_wearable.h index 705e7f808..9607da687 100755 --- a/src/itc/stt/tct-stt-native_wearable.h +++ b/src/itc/stt/tct-stt-native_wearable.h @@ -55,6 +55,7 @@ extern int ITc_stte_set_unset_audio_type_set_cb_p(void); extern int ITc_stt_start_stop_audio_streaming_p(void); extern int ITc_stt_get_audio_format_p(void); extern int ITc_stt_send_audio_streaming_p(void); +extern int ITc_stt_set_get_audio_id_p(void); testcase tc_array[] = { {"ITc_stt_create_destroy_p",ITc_stt_create_destroy_p,ITs_stt_startup,ITs_stt_cleanup}, @@ -88,6 +89,7 @@ testcase tc_array[] = { {"ITc_stt_start_stop_audio_streaming_p",ITc_stt_start_stop_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_get_audio_format_p",ITc_stt_get_audio_format_p,ITs_stt_startup,ITs_stt_cleanup}, {"ITc_stt_send_audio_streaming_p",ITc_stt_send_audio_streaming_p,ITs_stt_startup,ITs_stt_cleanup}, + {"ITc_stt_set_get_audio_id_p",ITc_stt_set_get_audio_id_p,ITs_stt_startup, ITs_stt_cleanup}, {NULL, NULL} };