Add internal method to get speech status info
[platform/core/uifw/stt.git] / test / test_main.c
index 7e80ad1..5eef8d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -201,10 +201,12 @@ static void __stt_recognition_result_cb(stt_h stt, stt_result_event_e event, con
                SLOG(LOG_DEBUG, TAG_STT_TEST, "( %s )", data[0]);
        }
 
+       if (STT_RESULT_EVENT_FINAL_RESULT == event) {
        ecore_timer_add(0, __stt_finalize, NULL);
+       }
 }
 
-int main (int argc, char *argv[])
+int main(int argc, char *argv[])
 {
        if (2 > argc) {
                SLOG(LOG_DEBUG, TAG_STT_TEST, "Please check parameter");
@@ -292,6 +294,13 @@ int main (int argc, char *argv[])
                        return 0;
                }
 
+               SLOG(LOG_DEBUG, TAG_STT_TEST, "STT set credential");
+               ret = stt_set_credential(g_stt, "1Q2W3E4R5T");
+               if (STT_ERROR_NONE != ret) {
+                       SLOG(LOG_ERROR, TAG_STT_TEST, "Fail to set credential");
+                       return 0;
+               }
+
                SLOG(LOG_DEBUG, TAG_STT_TEST, "STT prepare");
                ret = stt_prepare(g_stt);
                if (STT_ERROR_NONE != ret) {