Change hard coded path to get by using tzplatform API 37/162237/4 accepted/tizen/unified/20171130.113330 submit/tizen/20171130.061035
authorhj kim <backto.kim@samsung.com>
Thu, 30 Nov 2017 01:13:22 +0000 (10:13 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 30 Nov 2017 05:37:14 +0000 (14:37 +0900)
Change-Id: Ifb60af2295a7f2edb4ea0cde0d9e1c4511eea4a7

test/media-content_test.c

index a14fa93..b01d768 100755 (executable)
@@ -1552,7 +1552,7 @@ int test_media_info_operation_2(void)
 
 #if 0
        /* Bookmark */
-       char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_CONTENT, "Images and videos/My video clips/teat11.jpg"));
+       char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_VIDEOS, "teat11.jpg");
        media_bookmark_insert_to_db(test_video_id, 100, thumbnail_path1);
        media_bookmark_insert_to_db(test_video_id, 200, thumbnail_path1);
 
@@ -1754,7 +1754,7 @@ int test_playlist_operation(void)
                media_playlist_add_media(playlist_1, test_video_id);
 
                #if 0
-               char *playlist_thumb_path = tzplatform_mkpath(TZ_USER_CONTENT, "Images/Default.jpg"));
+               char *playlist_thumb_path = tzplatform_mkpath(TZ_USER_IMAGES, "Default.jpg"));
                media_playlist_set_thumbnail_path(playlist_1, playlist_thumb_path);
                #endif
 
@@ -1787,8 +1787,8 @@ int test_playlist_operation(void)
        media_content_debug("playlist_id_3 [%d]", playlist_id_3);
 
        /* Export and import playlist */
-       media_playlist_export_to_file(playlist_3, "/opt/usr/media/Music/playlist.m3u");
-       media_playlist_import_from_file("/opt/usr/media/Music/playlist.m3u", "playlist_4", &playlist_4);
+       media_playlist_export_to_file(playlist_3, tzplatform_mkpath(TZ_USER_MUSIC, "playlist.m3u"));
+       media_playlist_import_from_file(tzplatform_mkpath(TZ_USER_MUSIC, "playlist.m3u"), "playlist_4", &playlist_4);
 
        /* Filter for media*/
        ret = media_filter_create(&m_filter);
@@ -1882,7 +1882,7 @@ int test_playlist_operation_v2(void)
        int ret = MEDIA_CONTENT_ERROR_NONE;
        media_playlist_h playlist_1 = NULL;
        const char *playlist_name_1 = "myPlaylist_1";
-       const char *playlist_thumb_path = tzplatform_mkpath(TZ_USER_CONTENT, "Images/Default.jpg");
+       const char *playlist_thumb_path = tzplatform_mkpath(TZ_USER_IMAGES, "Default.jpg");
        int playlist_id = 0;
 
        media_content_debug("\n============Playlist Test V2============\n\n");
@@ -2145,7 +2145,7 @@ int test_bookmark_operation(void)
                media_content_error("error media_filter_set_order : [%d]", ret);
 
        /* insert bookmark to video */
-       const char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_CONTENT, "Images and videos/My video clips/teat11.jpg");
+       const char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_VIDEOS, "teat11.jpg");
        ret = media_bookmark_insert_to_db(test_video_id, 400, thumbnail_path1);
        if (ret != MEDIA_CONTENT_ERROR_NONE)
                media_content_error("error media_bookmark_insert_to_db : [%d]", ret);
@@ -2192,7 +2192,7 @@ int test_bookmark_operation_v2(void)
 
        int ret = MEDIA_CONTENT_ERROR_NONE;
        media_bookmark_h bookmark = NULL;
-       const char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_CONTENT, "Images and videos/My video clips/teat11.jpg");
+       const char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_VIDEOS, "teat11.jpg");
 
        ret = media_bookmark_create(test_video_id, 400, &bookmark);
        if (ret != MEDIA_CONTENT_ERROR_NONE)
@@ -2415,9 +2415,9 @@ int test_update_operation()
 int test_insert(void)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       const char *path = "/opt/usr/media/Images/Default.jpg";
+       const char *path = tzplatform_mkpath(TZ_USER_IMAGES, "Default.jpg");
 #if 0
-       const char *path = "/opt/usr/media/Others/other.txt";
+       const char *path = tzplatform_mkpath(TZ_USER_DOCUMENTS, "other.txt"));
        char *path = NULL;
 #endif
        media_info_h media_item = NULL;
@@ -2460,7 +2460,7 @@ int test_move(void)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        const char *move_media_id = "60aea677-4742-408e-b5f7-f2628062d06d";
-       const char *dst_path = tzplatform_mkpath(TZ_USER_CONTENT, "Images/XX/Default1.jpg");
+       const char *dst_path = tzplatform_mkpath(TZ_USER_IMAGES, "XX/Default1.jpg");
        media_info_h move_media = NULL;
 
        ret = media_info_get_media_from_db(move_media_id, &move_media);
@@ -3214,7 +3214,7 @@ gboolean cancel_scan_dir_start(gpointer data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
 
-       const char *dir_path = "/opt/usr/media/Images";
+       const char *dir_path = tzplatform_getenv(TZ_USER_IMAGES);
 
        ret = media_content_cancel_scan_folder(dir_path);
 
@@ -3420,7 +3420,7 @@ int test_create_handle(void)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        media_info_h media = NULL;
-       const char *path = "/home/owner/content/test/test.txt";
+       const char *path = tzplatform_mkpath(TZ_USER_CONTENT, "test/test.txt");
        char *str_value = NULL;
        int int_value = -1;
        bool bool_value = FALSE;