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
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
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
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);
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);
{"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},
{"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},
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);
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);
{"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},
{"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},
}
+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
}
+/**
+ * @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
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;
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