[ITC][stt][ACR-1785] Add TC's for setting and getting audio id 14/297114/1
authorTarun Kumar <tarun1.kumar@samsung.com>
Thu, 10 Aug 2023 08:32:26 +0000 (14:02 +0530)
committerTarun Kumar <tarun1.kumar@samsung.com>
Thu, 10 Aug 2023 08:32:26 +0000 (14:02 +0530)
Change-Id: Iedeec8c59dfb08695307138274ccc53cdb57f5c5
Signed-off-by: Tarun Kumar <tarun1.kumar@samsung.com>
src/itc/stt/ITs-stt.c
src/itc/stt/tct-stt-native_mobile.h
src/itc/stt/tct-stt-native_tizeniot.h
src/itc/stt/tct-stt-native_tv.h
src/itc/stt/tct-stt-native_wearable.h

index 688ca99d5fce9d27aad4f56f02ea3dd08b086369..9d41c6f94fda2bb200a8f843af50e9c5f1e0dc4c 100755 (executable)
@@ -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;
+}
+
+
 /** @} */
 /** @} */
index 705e7f8082703dcc1b5fe01658299e96f60a9007..9607da687cc3c2b75e4ef0d79ceeebd82acf4da2 100755 (executable)
@@ -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}
 };
 
index 705e7f8082703dcc1b5fe01658299e96f60a9007..9607da687cc3c2b75e4ef0d79ceeebd82acf4da2 100755 (executable)
@@ -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}
 };
 
index b4eddcd54ef510e1dd7e8124ef6f8e3c99ad707e..1dcf194c836bf62a6c343ba816cfb4689363a135 100755 (executable)
@@ -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}
 };
 
index 705e7f8082703dcc1b5fe01658299e96f60a9007..9607da687cc3c2b75e4ef0d79ceeebd82acf4da2 100755 (executable)
@@ -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}
 };