Change internal function to static
[platform/core/uifw/tts.git] / test / test_main.c
old mode 100644 (file)
new mode 100755 (executable)
index 428a356..1d39556
@@ -41,10 +41,14 @@ static bool __tts_test_get_text_from_file(const char* path, char** text)
                return 0;
        }
 
-       fseek(fp , 0 , SEEK_END);
+       if (0 != fseek(fp , 0 , SEEK_END)) {
+               SLOG(LOG_ERROR, tts_tag(), "Fail to fseek()");
+               fclose(fp);
+               return 0;
+       }
 
        int text_len = ftell(fp);
-       if (0 >= text_len) {
+       if (0 >= text_len || 0 > text_len + 1) {
                SLOG(LOG_ERROR, tts_tag(), "File has no contents");
                fclose(fp);
                return 0;
@@ -53,7 +57,7 @@ static bool __tts_test_get_text_from_file(const char* path, char** text)
        rewind(fp);
 
        char* temp = NULL;
-       temp = (char*)calloc(1, text_len+1);
+       temp = (char*)calloc(1, text_len + 1);
 
        if (temp == NULL) {
                SLOG(LOG_ERROR, tts_tag(), "Fail to memory allocation");
@@ -152,7 +156,7 @@ Eina_Bool __tts_test_destroy(void *data)
                SLOG(LOG_ERROR, tts_tag(), "Fail to unprepare");
        }
 
-       SLOG(LOG_ERROR, tts_tag(), "Destory tts client");
+       SLOG(LOG_ERROR, tts_tag(), "Destroy tts client");
        ret = tts_destroy(g_tts);
        if (TTS_ERROR_NONE != ret) {
                SLOG(LOG_ERROR, tts_tag(), "Fail to destroy");
@@ -208,7 +212,7 @@ int main(int argc, char *argv[])
                        SLOG(LOG_DEBUG, tts_tag(), "  TTS test usage");
                        SLOG(LOG_DEBUG, tts_tag(), " ==========================================");
                        SLOG(LOG_DEBUG, tts_tag(), "  -t : Synthesize text");
-                       SLOG(LOG_DEBUG, tts_tag(), "  -l : Determine langage to synthesize text, ex) en_US, ko_KR ...");
+                       SLOG(LOG_DEBUG, tts_tag(), "  -l : Determine language to synthesize text, ex) en_US, ko_KR ...");
                        SLOG(LOG_DEBUG, tts_tag(), "  -f : Determine file path which include text");
                        SLOG(LOG_DEBUG, tts_tag(), " ***************************************************");
                        SLOG(LOG_DEBUG, tts_tag(), "    Example : #tts-test -l en_US -t \"1 2 3 4\" ");
@@ -216,7 +220,7 @@ int main(int argc, char *argv[])
                        return 0;
                }
 
-               /* check langage option */
+               /* check language option */
                if (!strcmp("-l", argv[n])) {
                        lang = TTS_STRDUP(argv[n+1]);
                        SLOG(LOG_ERROR, tts_tag(), "Language : %s", lang);