[UTC][wav-player][Non-ACR] fix resource path
authorMok Jeongho <jho.mok@samsung.com>
Tue, 6 Sep 2016 13:54:08 +0000 (22:54 +0900)
committerMok Jeongho <jho.mok@samsung.com>
Tue, 6 Sep 2016 14:03:17 +0000 (23:03 +0900)
Change-Id: I93e5740e6b0bd2246ef020c71c2d017b83a2a2de

src/utc/wav-player/utc-wav-player.c

index f480c35..11e0569 100755 (executable)
@@ -21,6 +21,9 @@
 #include <glib.h>
 #include <string.h>
 #include <sound_manager.h>
+#include "tct_common.h"
+
+#define API_NAMESPACE        "[WAV_PLAYER]"
 
 static char* TESTFILE = NULL;
 static const char* TESTFILENAME = "sound_5.wav";
@@ -31,19 +34,6 @@ static void _sound_stream_focus_state_changed_cb(sound_stream_info_h stream_info
 {
 }
 
-static bool wav_player_storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
-{
-    int str_size = 0;
-    if(type == STORAGE_TYPE_INTERNAL) {
-        str_size = strlen(path) + strlen(TESTFILENAME) + 6;
-        TESTFILE = (char*)malloc(str_size);
-        snprintf(TESTFILE, str_size, "%s/res/%s", path, TESTFILENAME);
-        return false;
-    }
-
-    return true;
-}
-
 /**
  * @function           utc_wav_player_startup
  * @description                Called before each test
@@ -52,11 +42,17 @@ static bool wav_player_storage_device_supported_cb(int storage_id, storage_type_
  */
 void utc_wav_player_startup(void)
 {
-    if(storage_foreach_device_supported(wav_player_storage_device_supported_cb, NULL) != STORAGE_ERROR_NONE) {
-        fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+    char pszValue[CONFIG_VALUE_LEN_MAX] = {0,};
+    if ( true == GetValueForTCTSetting("DEVICE_STORAGE_30", pszValue, API_NAMESPACE ))
+    {
+        PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_STORAGEE_30' Values Received = %s\\n", __LINE__, API_NAMESPACE,  pszValue);
+        unsigned int size_of_path = strlen(pszValue) + strlen(TESTFILENAME) + 6;
+        TESTFILE = (char*)malloc(size_of_path);
+        snprintf(TESTFILE, size_of_path, "%s/res/%s", pszValue, TESTFILENAME);
     }
-    if(TESTFILE == NULL) {
-        fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+    else
+    {
+        PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
     }
 }
 
@@ -70,6 +66,7 @@ void utc_wav_player_cleanup(void)
 {
     if(TESTFILE != NULL) {
         free(TESTFILE);
+        TESTFILE = NULL;
     }
 }