diff options
author | Haejeong Kim <backto.kim@samsung.com> | 2017-05-23 10:40:17 +0900 |
---|---|---|
committer | hj kim <backto.kim@samsung.com> | 2017-05-23 04:37:59 +0000 |
commit | a58fc2921649b31e168b2941c51a217471bfcd5f (patch) | |
tree | 1563e85ab90379c960bb7cde903da09f7e24d7f3 /test | |
parent | 2e72994ee5d47364c459f684ec6764059c34d02a (diff) | |
download | media-content-a58fc2921649b31e168b2941c51a217471bfcd5f.tar.gz media-content-a58fc2921649b31e168b2941c51a217471bfcd5f.tar.bz2 media-content-a58fc2921649b31e168b2941c51a217471bfcd5f.zip |
Add bookmark and playlist APIs for C# Supportingsubmit/tizen/20170523.044300
Change-Id: Ica5c4b2ea5ee68905e3c611cebf9ed0fb058dd26
Diffstat (limited to 'test')
-rwxr-xr-x | test/media-content_test.c | 91 |
1 files changed, 89 insertions, 2 deletions
diff --git a/test/media-content_test.c b/test/media-content_test.c index 646c0e2..7baf733 100755 --- a/test/media-content_test.c +++ b/test/media-content_test.c @@ -24,6 +24,8 @@ #include <pthread.h> #include <glib.h> #include <tzplatform_config.h> +#include <media_content_internal.h> + filter_h g_filter = NULL; filter_h g_filter_g = NULL; /*filter for group like folder, tag, playlist, album, year ... */ @@ -33,7 +35,7 @@ static int g_cnt = 0; static int g_media_cnt = 0; #define test_audio_id "0f999626-6218-450c-a4ad-181a3bab6ebf" -#define test_video_id "c1a92494-cc5b-4d74-aa7d-253199234548" +#define test_video_id "22aa5ba1-8b54-4a62-b0e4-d15f7169f7d3" #define test_image_id "db1c184c-6f31-43b4-b924-8c00ac5b6197" media_folder_h g_folder = NULL; @@ -1875,6 +1877,42 @@ int test_playlist_operation(void) return ret; } +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"); + + media_content_debug("\n============Playlist Test V2============\n\n"); + + ret = media_playlist_create(playlist_name_1, &playlist_1); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_playlist_create : [%d]", ret); + + ret = media_playlist_set_thumbnail_path(playlist_1, playlist_thumb_path); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_playlist_set_thumbnail_path : [%d]", ret); + + ret = media_playlist_insert_to_db_v2(playlist_1); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_playlist_insert_to_db_v2 : [%d]", ret); + + ret = media_playlist_set_name(playlist_1, "myPlaylist_3"); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_playlist_set_name : [%d]", ret); + + ret = media_playlist_update_to_db(playlist_1); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_playlist_update_to_db : [%d]", ret); + + ret = media_playlist_destroy(playlist_1); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_playlist_destroy : [%d]", ret); + + return ret; +} + int test_tag_operation(void) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -2088,6 +2126,45 @@ int test_bookmark_operation(void) return ret; } +int test_bookmark_operation_v2(void) +{ + media_content_debug("\n============Bookmark Test V2============\n\n"); + + 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"); + + ret = media_bookmark_create(test_video_id, 400, &bookmark); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_bookmark_create : [%d]", ret); + + ret = media_bookmark_set_name(bookmark, "test bookmark"); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_bookmark_set_name : [%d]", ret); + + ret = media_bookmark_set_thumbnail_path(bookmark, thumbnail_path1); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_bookmark_set_thumbnail_path : [%d]", ret); + + ret = media_bookmark_insert_to_db_v2(bookmark); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_bookmark_insert_to_db_v2 : [%d]", ret); + + ret = media_bookmark_set_name(bookmark, "test bookmark 2"); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_bookmark_set_name : [%d]", ret); + + ret = media_bookmark_update_to_db(bookmark); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_bookmark_update_to_db : [%d]", ret); + + ret = media_bookmark_destroy(bookmark); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error media_bookmark_destroy : [%d]", ret); + + return ret; +} + int test_album_list(void) { media_content_debug("\n============Album Test============\n\n"); @@ -2995,8 +3072,10 @@ gboolean test_insert_burst_shot_to_db_start(gpointer data) } ret = media_info_insert_burst_shot_to_db((const char **)file_list, 10, insert_burst_shot_cb, NULL); - if (ret != MEDIA_CONTENT_ERROR_NONE) + if (ret != MEDIA_CONTENT_ERROR_NONE) { media_content_error("media_info_insert_burst_shot_to_db failed : %d\n", ret); + g_main_loop_quit(g_loop); + } return ret; } @@ -3988,6 +4067,14 @@ int main(int argc, char *argv[]) ret = test_face_add_del(); if (ret != MEDIA_CONTENT_ERROR_NONE) return MEDIA_CONTENT_ERROR_NONE; + + ret = test_playlist_operation_v2(); + if (ret != MEDIA_CONTENT_ERROR_NONE) + return MEDIA_CONTENT_ERROR_NONE; + + ret = test_bookmark_operation_v2(); + if (ret != MEDIA_CONTENT_ERROR_NONE) + return MEDIA_CONTENT_ERROR_NONE; #endif ret = test_disconnect_database(); |