From: Haejeong Kim Date: Tue, 22 Aug 2017 05:25:29 +0000 (+0900) Subject: [UTC][media-content][ACR-990] Add new TCs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccc76c6718eddadb7040d25cac5c318ed1658d3b;p=test%2Ftct%2Fnative%2Fapi.git [UTC][media-content][ACR-990] Add new TCs 3 new APIs was added. media_bookmark_foreach_bookmark_from_db media_face_get_face_count_from_db media_face_foreach_face_from_db Change-Id: Iaa64ce44599816379040a0e8fbcd24845c5761dd --- diff --git a/src/utc/media-content/public.list b/src/utc/media-content/public.list index 0c80c971f..7232111aa 100755 --- a/src/utc/media-content/public.list +++ b/src/utc/media-content/public.list @@ -51,6 +51,7 @@ media_album_get_name media_bookmark_clone media_bookmark_destroy media_bookmark_get_bookmark_count_from_db +media_bookmark_foreach_bookmark_from_db media_bookmark_get_bookmark_id media_bookmark_get_marked_time media_bookmark_get_thumbnail_path @@ -82,6 +83,8 @@ media_face_set_tag media_face_insert_to_db media_face_update_to_db media_face_delete_from_db +media_face_get_face_count_from_db +media_face_foreach_face_from_db media_filter_create media_filter_destroy media_filter_get_condition diff --git a/src/utc/media-content/tct-media-content-core_mobile.h b/src/utc/media-content/tct-media-content-core_mobile.h index b1f4ad5a7..c4427a693 100755 --- a/src/utc/media-content/tct-media-content-core_mobile.h +++ b/src/utc/media-content/tct-media-content-core_mobile.h @@ -107,6 +107,8 @@ extern int utc_media_bookmark_insert_to_db_n(void); extern int utc_media_bookmark_insert_to_db_p(void); extern int utc_media_bookmark_get_bookmark_count_from_db_n(void); extern int utc_media_bookmark_get_bookmark_count_from_db_p(void); +extern int utc_media_bookmark_foreach_bookmark_from_db_n(void); +extern int utc_media_bookmark_foreach_bookmark_from_db_p(void); extern int utc_media_bookmark_clone_n(void); extern int utc_media_bookmark_clone_p(void); extern int utc_media_bookmark_destroy_n(void); @@ -169,6 +171,10 @@ extern int utc_media_face_update_to_db_p(void); extern int utc_media_face_update_to_db_n(void); extern int utc_media_face_delete_from_db_p(void); extern int utc_media_face_delete_from_db_n(void); +extern int utc_media_face_get_face_count_from_db_p(void); +extern int utc_media_face_get_face_count_from_db_n(void); +extern int utc_media_face_foreach_face_from_db_p(void); +extern int utc_media_face_foreach_face_from_db_n(void); extern int utc_media_filter_create_n(void); extern int utc_media_filter_create_p(void); extern int utc_media_filter_destroy_n(void); @@ -649,6 +655,8 @@ testcase tc_array[] = { {"utc_media_bookmark_insert_to_db_p",utc_media_bookmark_insert_to_db_p,utc_media_bookmark_insert_startup,utc_media_bookmark_insert_cleanup}, {"utc_media_bookmark_get_bookmark_count_from_db_n",utc_media_bookmark_get_bookmark_count_from_db_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_get_bookmark_count_from_db_p",utc_media_bookmark_get_bookmark_count_from_db_p,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, + {"utc_media_bookmark_foreach_bookmark_from_db_n",utc_media_bookmark_foreach_bookmark_from_db_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, + {"utc_media_bookmark_foreach_bookmark_from_db_p",utc_media_bookmark_foreach_bookmark_from_db_p,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_clone_n",utc_media_bookmark_clone_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_clone_p",utc_media_bookmark_clone_p,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_destroy_n",utc_media_bookmark_destroy_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, @@ -711,6 +719,10 @@ testcase tc_array[] = { {"utc_media_face_update_to_db_n",utc_media_face_update_to_db_n,utc_media_face_startup,utc_media_face_cleanup}, {"utc_media_face_delete_from_db_p",utc_media_face_delete_from_db_p,utc_media_face_startup,utc_media_face_cleanup}, {"utc_media_face_delete_from_db_n",utc_media_face_delete_from_db_n,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_get_face_count_from_db_p",utc_media_face_get_face_count_from_db_p,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_get_face_count_from_db_n",utc_media_face_get_face_count_from_db_n,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_foreach_face_from_db_p",utc_media_face_foreach_face_from_db_p,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_foreach_face_from_db_n",utc_media_face_foreach_face_from_db_n,utc_media_face_startup,utc_media_face_cleanup}, {"utc_media_filter_create_n",utc_media_filter_create_n,NULL,utc_media_filter_create_cleanup}, {"utc_media_filter_create_p",utc_media_filter_create_p,NULL,utc_media_filter_create_cleanup}, {"utc_media_filter_destroy_n",utc_media_filter_destroy_n,utc_media_filter_destroy_startup,utc_media_filter_destroy_cleanup}, diff --git a/src/utc/media-content/tct-media-content-core_wearable.h b/src/utc/media-content/tct-media-content-core_wearable.h index 5c2d61123..e24c0601f 100755 --- a/src/utc/media-content/tct-media-content-core_wearable.h +++ b/src/utc/media-content/tct-media-content-core_wearable.h @@ -107,6 +107,8 @@ extern int utc_media_bookmark_insert_to_db_n(void); extern int utc_media_bookmark_insert_to_db_p(void); extern int utc_media_bookmark_get_bookmark_count_from_db_n(void); extern int utc_media_bookmark_get_bookmark_count_from_db_p(void); +extern int utc_media_bookmark_foreach_bookmark_from_db_n(void); +extern int utc_media_bookmark_foreach_bookmark_from_db_p(void); extern int utc_media_bookmark_clone_n(void); extern int utc_media_bookmark_clone_p(void); extern int utc_media_bookmark_destroy_n(void); @@ -169,6 +171,10 @@ extern int utc_media_face_update_to_db_p(void); extern int utc_media_face_update_to_db_n(void); extern int utc_media_face_delete_from_db_p(void); extern int utc_media_face_delete_from_db_n(void); +extern int utc_media_face_get_face_count_from_db_p(void); +extern int utc_media_face_get_face_count_from_db_n(void); +extern int utc_media_face_foreach_face_from_db_p(void); +extern int utc_media_face_foreach_face_from_db_n(void); extern int utc_media_filter_create_n(void); extern int utc_media_filter_create_p(void); extern int utc_media_filter_destroy_n(void); @@ -637,6 +643,8 @@ testcase tc_array[] = { {"utc_media_bookmark_insert_to_db_p",utc_media_bookmark_insert_to_db_p,utc_media_bookmark_insert_startup,utc_media_bookmark_insert_cleanup}, {"utc_media_bookmark_get_bookmark_count_from_db_n",utc_media_bookmark_get_bookmark_count_from_db_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_get_bookmark_count_from_db_p",utc_media_bookmark_get_bookmark_count_from_db_p,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, + {"utc_media_bookmark_foreach_bookmark_from_db_n",utc_media_bookmark_foreach_bookmark_from_db_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, + {"utc_media_bookmark_foreach_bookmark_from_db_p",utc_media_bookmark_foreach_bookmark_from_db_p,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_clone_n",utc_media_bookmark_clone_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_clone_p",utc_media_bookmark_clone_p,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, {"utc_media_bookmark_destroy_n",utc_media_bookmark_destroy_n,utc_media_bookmark_startup,utc_media_bookmark_cleanup}, @@ -699,6 +707,10 @@ testcase tc_array[] = { {"utc_media_face_update_to_db_n",utc_media_face_update_to_db_n,utc_media_face_startup,utc_media_face_cleanup}, {"utc_media_face_delete_from_db_p",utc_media_face_delete_from_db_p,utc_media_face_startup,utc_media_face_cleanup}, {"utc_media_face_delete_from_db_n",utc_media_face_delete_from_db_n,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_get_face_count_from_db_p",utc_media_face_get_face_count_from_db_p,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_get_face_count_from_db_n",utc_media_face_get_face_count_from_db_n,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_foreach_face_from_db_p",utc_media_face_foreach_face_from_db_p,utc_media_face_startup,utc_media_face_cleanup}, + {"utc_media_face_foreach_face_from_db_n",utc_media_face_foreach_face_from_db_n,utc_media_face_startup,utc_media_face_cleanup}, {"utc_media_filter_create_n",utc_media_filter_create_n,NULL,utc_media_filter_create_cleanup}, {"utc_media_filter_create_p",utc_media_filter_create_p,NULL,utc_media_filter_create_cleanup}, {"utc_media_filter_destroy_n",utc_media_filter_destroy_n,utc_media_filter_destroy_startup,utc_media_filter_destroy_cleanup}, diff --git a/src/utc/media-content/utc-media-bookmark.c b/src/utc/media-content/utc-media-bookmark.c index fa9a8af05..4ea16d1fc 100755 --- a/src/utc/media-content/utc-media-bookmark.c +++ b/src/utc/media-content/utc-media-bookmark.c @@ -88,6 +88,17 @@ static bool media_item_cb(media_info_h media, void *user_data) } +static bool sub_bookmark_cb(media_bookmark_h bookmark, void *user_data) +{ + int bm_id = 0; + + if (bookmark) + media_bookmark_get_bookmark_id(bookmark, &bm_id); + + return false; +} + + /** * @function utc_media_bookmark_startup * @description Called before each test @@ -226,6 +237,43 @@ int utc_media_bookmark_get_bookmark_count_from_db_p(void) } +/** + * @testcase utc_media_bookmark_foreach_bookmark_from_db_n + * @since_tizen 4.0 + * @description Negative test case of media_bookmark_foreach_bookmark_from_db() + */ +int utc_media_bookmark_foreach_bookmark_from_db_n(void) +{ + assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE); + + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_bookmark_foreach_bookmark_from_db(NULL, NULL, NULL); + assert_eq(ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER); + + return 0; +} + + +/** + * @testcase utc_media_bookmark_foreach_bookmark_from_db_p + * @since_tizen 4.0 + * @description Positive test case of media_bookmark_foreach_bookmark_from_db() + */ +int utc_media_bookmark_foreach_bookmark_from_db_p(void) +{ + assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE); + + int ret = MEDIA_CONTENT_ERROR_NONE; + int bookmark_count = 0; + + ret = media_bookmark_foreach_bookmark_from_db(g_filter, sub_bookmark_cb, NULL); + assert_eq(ret, MEDIA_CONTENT_ERROR_NONE); + + return 0; +} + + /** * @testcase utc_media_bookmark_clone_n * @since_tizen 2.3 diff --git a/src/utc/media-content/utc-media-face.c b/src/utc/media-content/utc-media-face.c index 96ec9d6a6..76b8ecf7e 100755 --- a/src/utc/media-content/utc-media-face.c +++ b/src/utc/media-content/utc-media-face.c @@ -64,6 +64,22 @@ static bool face_cb(media_face_h face, void *user_data) return false; } +static bool sub_face_cb(media_face_h face, void *user_data) +{ + char *face_id = NULL; + + if (face) { + media_face_get_face_id(face, &face_id); + } + + if (face_id) { + free(face_id); + face_id = NULL; + } + + return false; +} + static bool media_item_cb(media_info_h media, void *user_data) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -845,4 +861,74 @@ int utc_media_face_delete_from_db_n(void) return 0; } + +/** + * @testcase utc_media_face_get_face_count_from_db_p + * @since_tizen 4.0 + * @description Positive test case of media_face_get_face_count_from_db() + */ +int utc_media_face_get_face_count_from_db_p(void) +{ + assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE); + + int ret = MEDIA_CONTENT_ERROR_NONE; + int face_cnt = 0; + + ret = media_face_get_face_count_from_db(NULL, &face_cnt); + assert_eq(ret, MEDIA_CONTENT_ERROR_NONE); + + return 0; +} + +/** + * @testcase utc_media_face_get_face_count_from_db_n + * @since_tizen 4.0 + * @description Negative test case of media_face_get_face_count_from_db() + */ +int utc_media_face_get_face_count_from_db_n(void) +{ + assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE); + + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_face_get_face_count_from_db(NULL, NULL); + assert_eq(ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER); + + return 0; +} + +/** + * @testcase utc_media_face_foreach_face_from_db_p + * @since_tizen 4.0 + * @description Positive test case of media_face_foreach_face_from_db() + */ +int utc_media_face_foreach_face_from_db_p(void) +{ + assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE); + + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_face_foreach_face_from_db(NULL, sub_face_cb, NULL); + assert_eq(ret, MEDIA_CONTENT_ERROR_NONE); + + return 0; +} + +/** + * @testcase utc_media_face_foreach_face_from_db_n + * @since_tizen 4.0 + * @description Negative test case of media_face_foreach_face_from_db() + */ +int utc_media_face_foreach_face_from_db_n(void) +{ + assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE); + + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_face_foreach_face_from_db(NULL, NULL, NULL); + assert_eq(ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER); + + return 0; +} + #endif //COMMON_IOT