diff options
author | Minje Ahn <minje.ahn@samsung.com> | 2015-12-09 17:09:10 +0900 |
---|---|---|
committer | Minje Ahn <minje.ahn@samsung.com> | 2015-12-10 09:54:40 +0900 |
commit | 54b6e5f28de5f9deee36e3e26fae6b099ea6d6d4 (patch) | |
tree | a64964225d5702445cfe2ca092d0416cdc4945b5 /test | |
parent | b536c6c76b9de0f568c6047e2a01a72bdcfde099 (diff) | |
download | media-content-54b6e5f28de5f9deee36e3e26fae6b099ea6d6d4.tar.gz media-content-54b6e5f28de5f9deee36e3e26fae6b099ea6d6d4.tar.bz2 media-content-54b6e5f28de5f9deee36e3e26fae6b099ea6d6d4.zip |
Modify some test codesubmit/tizen/20151210.060140accepted/tizen/wearable/20151210.082838accepted/tizen/tv/20151210.082826accepted/tizen/mobile/20151210.082550
Change-Id: I4928930baa610ac24631453299836dcf6711f9b9
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/media-content_test.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/test/media-content_test.c b/test/media-content_test.c index 25e973e..23ee386 100755 --- a/test/media-content_test.c +++ b/test/media-content_test.c @@ -2916,17 +2916,43 @@ void _noti_cb(media_content_error_e error, if (user_data) media_content_debug("String : %s\n", (char *)user_data); - //g_main_loop_quit(g_loop); +// g_main_loop_quit(g_loop); return; } +void _noti_cb_2(media_content_error_e error, + int pid, + media_content_db_update_item_type_e update_item, + media_content_db_update_type_e update_type, + media_content_type_e media_type, + char *uuid, + char *path, + char *mime_type, + void *user_data) +{ + if (error == 0) { + media_content_debug("noti_2 success! : %d\n", error); + } else { + media_content_debug("error occured! : %d\n", error); + } + + media_content_debug("Noti_2 from PID(%d)\n", pid); + + g_main_loop_quit(g_loop); + return; +} + +static media_content_noti_h noti_h; +static media_content_noti_h noti_h_2; + gboolean _send_noti_operations(gpointer data) { int ret = MEDIA_CONTENT_ERROR_NONE; /* First of all, noti subscription */ char *user_str = strdup("hi"); - media_content_set_db_updated_cb(_noti_cb, (void*)user_str); + media_content_add_db_updated_cb(_noti_cb, (void*)user_str, ¬i_h); + media_content_add_db_updated_cb(_noti_cb_2, (void*)user_str, ¬i_h_2); /* media_info_insert_to_db */ media_info_h media_item = NULL; @@ -2943,8 +2969,11 @@ gboolean _send_noti_operations(gpointer data) /* media_info_delete_batch_from_db */ filter_h filter; - char *condition = "MEDIA_PATH LIKE \'"; - strncat(condition, tzplatform_mkpath(TZ_USER_CONTENT, "test/image%%jpg\'"), 17); + char condition[2048] = {0,}; + const char *temp= NULL; + temp = tzplatform_mkpath(TZ_USER_CONTENT, "test/image%%\'"); + snprintf(condition, sizeof(condition), "MEDIA_PATH LIKE \'%s", temp); +// strncat(condition, temp, strlen(temp)); ret = media_filter_create(&filter); if (ret != MEDIA_CONTENT_ERROR_NONE) { @@ -2970,6 +2999,8 @@ gboolean _send_noti_operations(gpointer data) media_filter_destroy(filter); + media_content_remove_db_updated_cb(noti_h); + /* media_info_update_to_db */ ret = media_info_update_to_db(media_item); if (ret != MEDIA_CONTENT_ERROR_NONE) { @@ -2999,7 +3030,7 @@ int test_noti() g_main_loop_unref(g_loop); test_filter_destroy(); - media_content_unset_db_updated_cb(); + media_content_remove_db_updated_cb(noti_h_2); return ret; } |