static char *dir_path = NULL;
static GMainLoop *g_loop = NULL;
-
static media_content_error_e cb_result = MEDIA_CONTENT_ERROR_NONE;
static media_content_error_e startup_ret = MEDIA_CONTENT_ERROR_NONE;
return true;
}
-static void _scan_folder_cb(media_content_error_e error, void * user_data)
+static void _scan_folder_cb(media_content_error_e error, void *user_data)
{
cb_result = error;
g_main_loop_quit(g_loop);
return true;
}
-
/**
* @function utc_media_audio_startup
* @description Called before each test
return;
}
- ret = media_info_get_media_count_from_db(g_filter, &media_count);
+ ret = media_info_get_media_count_from_db(g_filter, &media_count);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_info_foreach_media_from_db failed (code: %d)\n", ret);
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
source = g_idle_source_new();
- g_source_set_callback (source, _startup_scan_start, NULL, NULL);
- g_source_attach (source, context);
+ g_source_set_callback(source, _startup_scan_start, NULL, NULL);
+ g_source_attach(source, context);
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
}
}
-
/**
* @function utc_media_audio_cleanup
* @description Called after each test
media_content_disconnect();
}
-
/**
* @testcase utc_media_audio_meta_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_destroy_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_media_id_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_media_id_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_album_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_artist_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_artist_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_album_artist_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_album_artist_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_genre_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_genre_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_composer_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_composer_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_year_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_year_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_recorded_date_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_recorded_date_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_copyright_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_copyright_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_track_num_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_track_num_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_bit_rate_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_bit_rate_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_sample_rate_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_sample_rate_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_channel_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_channel_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_duration_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_duration_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_audio_meta_get_bitpersample_p
* @since_tizen 2.3
return true;
}
-
/**
* @function utc_media_book_startup
* @description Called before each test
}
}
-
/**
* @function utc_media_book_cleanup
* @description Called after each test
media_content_disconnect();
}
-
-
/**
* @testcase utc_media_book_meta_destroy_n
* @since_tizen 6.5
return 0;
}
-
-
/**
* @testcase utc_media_book_meta_destroy_p
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_clone_n
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_clone_p
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_media_id_n
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_media_id_p
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_subject_n
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_subject_p
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_author_n
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_author_p
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_date_n
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_date_p
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_book_meta_get_publisher_n
* @since_tizen 6.5
return 0;
}
-
-
/**
* @testcase utc_media_book_meta_get_publisher_p
* @since_tizen 6.5
static bool del_flag = false;
-static char* img_path = NULL;
+static char *img_path = NULL;
static const char *img_file = "image.jpg";
-
static media_content_error_e startup_ret = MEDIA_CONTENT_ERROR_NONE;
static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
{
if (type == STORAGE_TYPE_INTERNAL) {
- img_path = (char*)malloc(strlen(path) + strlen(img_file) + 6);
- memset(img_path,0x00,strlen(path) + strlen(img_file) + 6);
- snprintf(img_path,strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
+ img_path = (char *)malloc(strlen(path) + strlen(img_file) + 6);
+ memset(img_path, 0x00, strlen(path) + strlen(img_file) + 6);
+ snprintf(img_path, strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
return false;
}
return true;
}
-
static bool bookmark_cb(media_bookmark_h bookmark, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return false;
}
-
static bool media_item_cb(media_info_h media, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
ret = media_info_get_media_id(media, &g_media_id);
- if((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL)) {
+ if ((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL)) {
fprintf(stderr, "CB error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "media_info_get_media_id failed (code: %d)\n", ret);
return false;
return false;
}
-
/**
* @function utc_media_bookmark_delete_startup
* @description Called before each test
*/
void utc_media_bookmark_delete_startup(void)
{
- media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
+ media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
if (storage_foreach_device_supported(__storage_device_supported_cb, NULL) != STORAGE_ERROR_NONE)
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
return;
}
- time_t stTime = {0};
+ time_t stTime = { 0 };
time(&stTime);
fprintf(stderr, "%s:%d img_path = %s\n", __FILE__, __LINE__, img_path);
ret = media_bookmark_insert_to_db(g_media_id, stTime, img_path);
}
}
-
/**
* @function utc_media_bookmark_delete_cleanup
* @description Called after each test
}
}
-
/**
* @testcase utc_media_bookmark_delete_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_delete_from_db_p
* @since_tizen 2.3
static filter_h g_filter;
static int g_bookmark_id;
-static char* img_path = NULL;
+static char *img_path = NULL;
static const char *img_file = "image.jpg";
-
static media_content_error_e startup_ret = MEDIA_CONTENT_ERROR_NONE;
static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
{
if (type == STORAGE_TYPE_INTERNAL) {
- img_path = (char*)malloc(strlen(path) + strlen(img_file) + 6);
- memset(img_path,0x00,strlen(path) + strlen(img_file) + 6);
- snprintf(img_path,strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
+ img_path = (char *)malloc(strlen(path) + strlen(img_file) + 6);
+ memset(img_path, 0x00, strlen(path) + strlen(img_file) + 6);
+ snprintf(img_path, strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
return false;
}
return true;
}
-
static bool bookmark_cb(media_bookmark_h bookmark, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return false;
}
-
static bool media_item_cb(media_info_h media, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return false;
}
-
/**
* @function utc_media_bookmark_insert_startup
* @description Called before each test
}
}
-
/**
* @function utc_media_bookmark_insert_cleanup
* @description Called after each test
}
}
-
/**
* @testcase utc_media_bookmark_insert_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_insert_to_db_p
* @since_tizen 2.3
int ret = MEDIA_CONTENT_ERROR_NONE;
- time_t stTime = {0};
+ time_t stTime = { 0 };
time(&stTime);
fprintf(stderr, "%s:%d img_path = %s\n", __FILE__, __LINE__, img_path);
ret = media_bookmark_insert_to_db(g_media_id, stTime, img_path);
static filter_h g_filter = NULL;
static int g_bookmark_id = 0;
-static char* img_path = NULL;
+static char *img_path = NULL;
static const char *img_file = "image.jpg";
-
-
static media_content_error_e startup_ret = MEDIA_CONTENT_ERROR_NONE;
-
static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
{
- if (type == STORAGE_TYPE_INTERNAL)
- {
- img_path = (char*)malloc(strlen(path) + strlen(img_file) + 6);
- memset(img_path,0x00,strlen(path) + strlen(img_file) + 6);
- snprintf(img_path,strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
+ if (type == STORAGE_TYPE_INTERNAL) {
+ img_path = (char *)malloc(strlen(path) + strlen(img_file) + 6);
+ memset(img_path, 0x00, strlen(path) + strlen(img_file) + 6);
+ snprintf(img_path, strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
return false;
}
return true;
}
-
static bool bookmark_cb(media_bookmark_h bookmark, void *user_data)
{
media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
return false;
}
-
static bool media_item_cb(media_info_h media, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return false;
}
-
static bool sub_bookmark_cb(media_bookmark_h bookmark, void *user_data)
{
int bm_id = 0;
return false;
}
-
/**
* @function utc_media_bookmark_startup
* @description Called before each test
return;
}
- time_t stTime = {0};
+ time_t stTime = { 0 };
time(&stTime);
fprintf(stderr, "%s:%d img_path = %s\n", __FILE__, __LINE__, img_path);
ret = media_bookmark_insert_to_db(g_media_id, stTime, img_path);
}
}
-
/**
* @function utc_media_bookmark_cleanup
* @description Called after each test
}
}
-
/**
* @testcase utc_media_bookmark_get_bookmark_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_bookmark_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_foreach_bookmark_from_db_n
* @since_tizen 4.0
return 0;
}
-
/**
* @testcase utc_media_bookmark_foreach_bookmark_from_db_p
* @since_tizen 4.0
return 0;
}
-
/**
* @testcase utc_media_bookmark_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_destroy_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_bookmark_id_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_bookmark_id_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_marked_time_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_marked_time_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_thumbnail_path_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_thumbnail_path_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_bookmark_get_name_p
* @since_tizen 2.3
return 0;
}
-
static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
{
- if (type == STORAGE_TYPE_INTERNAL)
- {
- g_origin_path = (char*)malloc(strlen(path) + strlen(g_origin_file) + 6);
- memset(g_origin_path,0x00,strlen(path) + strlen(g_origin_file) + 6);
- snprintf(g_origin_path,strlen(path) + strlen(g_origin_file) + 6, "%s/res/%s", path, g_origin_file);
+ if (type == STORAGE_TYPE_INTERNAL) {
+ g_origin_path = (char *)malloc(strlen(path) + strlen(g_origin_file) + 6);
+ memset(g_origin_path, 0x00, strlen(path) + strlen(g_origin_file) + 6);
+ snprintf(g_origin_path, strlen(path) + strlen(g_origin_file) + 6, "%s/res/%s", path, g_origin_file);
- g_insert_path = (char*)malloc(strlen(path) + strlen(g_insert_file) + 6);
- memset(g_insert_path,0x00,strlen(path) + strlen(g_insert_file) + 6);
- snprintf(g_insert_path,strlen(path) + strlen(g_insert_file) + 6, "%s/res/%s", path, g_insert_file);
+ g_insert_path = (char *)malloc(strlen(path) + strlen(g_insert_file) + 6);
+ memset(g_insert_path, 0x00, strlen(path) + strlen(g_insert_file) + 6);
+ snprintf(g_insert_path, strlen(path) + strlen(g_insert_file) + 6, "%s/res/%s", path, g_insert_file);
dir_path = strdup(path);
return true;
}
-static void _scan_folder_cb(media_content_error_e error, void * user_data)
+static void _scan_folder_cb(media_content_error_e error, void *user_data)
{
cb_result = error;
}
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
source = g_idle_source_new();
- g_source_set_callback (source, _startup_scan_start, NULL, NULL);
- g_source_attach (source, context);
+ g_source_set_callback(source, _startup_scan_start, NULL, NULL);
+ g_source_attach(source, context);
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
}
if (!g_file_test(g_insert_path, G_FILE_TEST_EXISTS)) {
- char test_copy[256] = {0, };
+ char test_copy[256] = { 0, };
snprintf(test_copy, sizeof(test_copy), "/bin/cp %s %s", g_origin_path, g_insert_path);
if (system(test_copy) < 0) {
}
}
-
/**
* @function utc_media_content_cleanup
* @description Called after each test
media_content_disconnect();
}
-
-static void _noti_cb(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)
+static void _noti_cb(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)
{
}
-
/**
* @testcase utc_media_content_connect_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_content_disconnect_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_content_disconnect_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_content_scan_file_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_content_scan_file_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_content_scan_folder_n
* @since_tizen 2.3
return false;
}
-
/**
* @testcase utc_media_content_scan_folder_p
* @since_tizen 2.3
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
source = g_idle_source_new();
- g_source_set_callback (source, _scan_folder_start, NULL, NULL);
- g_source_attach (source, context);
+ g_source_set_callback(source, _scan_folder_start, NULL, NULL);
+ g_source_attach(source, context);
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
return 0;
}
-
/**
* @testcase utc_media_content_add_db_updated_cb_n
* @since_tizen 3.0
return 0;
}
-
/**
* @testcase utc_media_content_add_db_updated_cb_p
* @since_tizen 2.3
static char *g_media_id = NULL;
static char *g_face_id = NULL;
-static char* img_path = NULL;
+static char *img_path = NULL;
static const char *img_file = "image.jpg";
static media_content_error_e startup_ret = MEDIA_CONTENT_ERROR_NONE;
-
static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
{
if (type == STORAGE_TYPE_INTERNAL) {
- img_path = (char*)malloc(strlen(path) + strlen(img_file) + 6);
- memset(img_path,0x00,strlen(path) + strlen(img_file) + 6);
- snprintf(img_path,strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
+ img_path = (char *)malloc(strlen(path) + strlen(img_file) + 6);
+ memset(img_path, 0x00, strlen(path) + strlen(img_file) + 6);
+ snprintf(img_path, strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
return false;
}
return true;
int ret = MEDIA_CONTENT_ERROR_NONE;
ret = media_info_get_media_id(media, &g_media_id);
- if((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL)) {
+ if ((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL)) {
return false;
}
media_filter_create(&filter);
media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_DISPLAY_NAME, MEDIA_CONTENT_COLLATE_DEFAULT);
- if(filter == NULL) {
+ if (filter == NULL) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_filter_create failed (code: %d)\n", ret);
startup_ret = ret;
}
ret = media_info_foreach_media_from_db(filter, media_item_cb, NULL);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_info_foreach_media_from_db failed (code: %d)\n", ret);
startup_ret = ret;
filter = NULL;
ret = media_face_create(g_media_id, &g_face);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_face_create failed (code: %d)\n", ret);
startup_ret = ret;
return;
}
-
ret = media_face_set_face_rect(g_face, 10, 10, 10, 10);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_face_set_face_rect failed (code: %d)\n", ret);
startup_ret = ret;
}
ret = media_face_set_tag(g_face, "Test");
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_face_set_tag failed (code: %d)\n", ret);
startup_ret = ret;
}
ret = media_face_insert_to_db(g_face);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_face_insert_to_db failed (code: %d)\n", ret);
startup_ret = ret;
}
ret = media_face_destroy(g_face);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_face_destroy failed (code: %d)\n", ret);
startup_ret = ret;
}
ret = media_info_foreach_face_from_db(g_media_id, NULL, face_cb, NULL);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_info_foreach_face_from_db failed (code: %d)\n", ret);
startup_ret = ret;
}
}
-
/**
* @function utc_media_face_cleanup
* @description Called after each test
unsigned int rect_h = -1;
ret = media_face_get_face_rect(g_face, &rect_x, &rect_y, &rect_w, &rect_h);
- if (rect_x <= 0 || rect_y <= 0 ||rect_w <= 0 || rect_h <= 0)
+ if (rect_x <= 0 || rect_y <= 0 || rect_w <= 0 || rect_h <= 0)
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
-
return 0;
}
}
}
-
/**
* @testcase utc_media_filter_create_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_create_p
* @since_tizen 2.3
}
}
-
/**
* @function utc_media_filter_destroy_cleanup
* @description Called after each test
}
}
-
/**
* @testcase utc_media_filter_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_destroy_p
* @since_tizen 2.3
}
-
/**
* @function utc_media_filter_cleanup
* @description Called after each test
g_filter = NULL;
}
-
/**
* @testcase utc_media_filter_set_offset_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_set_offset_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_set_condition_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_set_condition_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_set_order_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_set_order_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_set_storage_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_filter_get_offset_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_get_condition_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_filter_get_condition_p
* @since_tizen 2.3
ret = media_filter_get_condition(g_filter, &condition, &collate_type);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(condition != NULL) {
- if(strcmp(condition, SET_TEST_CONDITION))
+ if (condition != NULL) {
+ if (strcmp(condition, SET_TEST_CONDITION))
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
free(condition);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(collate_type != MEDIA_CONTENT_COLLATE_NOCASE)
+ if (collate_type != MEDIA_CONTENT_COLLATE_NOCASE)
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
return 0;
}
-
/**
* @testcase utc_media_filter_get_order_n
* @since_tizen 2.3
ret = media_filter_get_order(NULL, &order, &order_keyword, &collate_type);
- if(order_keyword){
+ if (order_keyword) {
free(order_keyword);
order_keyword = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_filter_get_order_p
* @since_tizen 2.3
ret = media_filter_get_order(g_filter, &order, &order_keyword, &collate_type);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(order_keyword != NULL) {
- if(strcmp(order_keyword, MEDIA_TITLE))
+ if (order_keyword != NULL) {
+ if (strcmp(order_keyword, MEDIA_TITLE))
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
free(order_keyword);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(order != MEDIA_CONTENT_ORDER_ASC)
+ if (order != MEDIA_CONTENT_ORDER_ASC)
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(collate_type != MEDIA_CONTENT_COLLATE_DEFAULT)
+ if (collate_type != MEDIA_CONTENT_COLLATE_DEFAULT)
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
ret = media_filter_get_storage(NULL, &storage_id);
- if(storage_id) {
+ if (storage_id) {
free(storage_id);
storage_id = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_filter_get_storage_p
* @since_tizen 2.4
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
if (storage_id != NULL) {
- if(strcmp(storage_id, "media"))
+ if (strcmp(storage_id, "media"))
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
free(storage_id);
#define TEST_SET_NAME "new_test"
#define TEST_DEFAULT_NAME "test"
-
//& set: MediaFolder
static media_folder_h g_folder = NULL;
static filter_h g_filter = NULL;
static char *g_folder_path = NULL;
-static char* g_test_folder_path = NULL;
-static char* g_default_folder_path = NULL;
-static char* g_set_folder_path = NULL;
+static char *g_test_folder_path = NULL;
+static char *g_default_folder_path = NULL;
+static char *g_set_folder_path = NULL;
static media_content_error_e startup_ret = MEDIA_CONTENT_ERROR_NONE;
{
char temp[500];
if (type == STORAGE_TYPE_INTERNAL) {
- memset(temp,0x00,sizeof(temp));
- snprintf(temp,sizeof(temp), "%s/%s",path, "res");
+ memset(temp, 0x00, sizeof(temp));
+ snprintf(temp, sizeof(temp), "%s/%s", path, "res");
g_default_folder_path = strdup(temp);
- memset(temp,0x00,sizeof(temp));
- snprintf(temp,sizeof(temp), "%s/res/%s",path, TEST_SET_NAME);
+ memset(temp, 0x00, sizeof(temp));
+ snprintf(temp, sizeof(temp), "%s/res/%s", path, TEST_SET_NAME);
g_set_folder_path = strdup(temp);
- memset(temp,0x00,sizeof(temp));
- snprintf(temp,sizeof(temp), "%s/%s",path, "res/test");
+ memset(temp, 0x00, sizeof(temp));
+ snprintf(temp, sizeof(temp), "%s/%s", path, "res/test");
g_test_folder_path = strdup(temp);
return false;
return true;
}
-
static bool capi_folder_list_cb(media_folder_h folder, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
}
}
- if (g_folder_path ) {
+ if (g_folder_path) {
free(g_folder_path);
g_folder_path = NULL;
}
}
-
/**
* @function utc_media_folder_cleanup
* @description Called after each test
}
}
-
/**
* @testcase utc_media_folder_foreach_folder_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_foreach_folder_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_media_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_media_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
static bool sub_media_cb(media_info_h media, void *user_data)
{
return true;
}
-
/**
* @testcase utc_media_folder_foreach_media_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_foreach_media_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_path_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_path_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_name_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_storage_type_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_storage_type_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_storage_id_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_folder_get_folder_id_p
* @since_tizen 2.3
int ret = MEDIA_CONTENT_ERROR_NONE;
char *folder_id = NULL;
- ret = media_folder_get_folder_id(g_folder, &folder_id);
+ ret = media_folder_get_folder_id(g_folder, &folder_id);
if (folder_id) {
free(folder_id);
return 0;
}
-
/**
* @testcase utc_media_folder_get_folder_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_folder_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_folder_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_get_folder_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_folder_destroy_p
* @since_tizen 2.3
ret = media_folder_destroy(g_folder);
g_folder = NULL;
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- } else return -1;
+ } else
+ return -1;
return 0;
}
return true;
}
-
static bool album_cb(media_album_h album, void *user_data)
{
if (album != NULL) {
return false;
}
-
static bool group_cb(const char *name, void *user_data)
{
return false;
}
-
/**
* @function utc_media_group_startup
* @description Called before each test
}
-
/**
* @function utc_media_group_cleanup
* @description Called after each test
}
-
/**
* @testcase utc_media_album_get_album_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_album_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_foreach_album_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_foreach_album_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_media_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_media_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_foreach_media_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_foreach_media_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_album_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_album_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_album_id_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_album_id_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_name_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_name_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_artist_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_artist_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_album_art_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_get_album_art_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_album_destroy_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_group_get_group_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_group_get_group_count_from_db_p
* @since_tizen 2.3
int group_count = 0;
int idx = 0;
- for(idx = 0; idx < MEDIA_CONTENT_GROUP_MAX; idx++) {
+ for (idx = 0; idx < MEDIA_CONTENT_GROUP_MAX; idx++) {
ret = media_group_get_group_count_from_db(g_filter, idx, &group_count);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
}
return 0;
}
-
/**
* @testcase utc_media_group_get_media_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_group_get_media_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_group_foreach_group_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_group_foreach_group_from_db_p
* @since_tizen 2.3
int ret = MEDIA_CONTENT_ERROR_NONE;
int idx = 0;
- for(idx = 0; idx < MEDIA_CONTENT_GROUP_MAX; idx++) {
+ for (idx = 0; idx < MEDIA_CONTENT_GROUP_MAX; idx++) {
ret = media_group_foreach_group_from_db(NULL, MEDIA_CONTENT_GROUP_DISPLAY_NAME, group_cb, TEST_SET_GROUP_NAME);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
}
return 0;
}
-
/**
* @testcase utc_media_group_foreach_media_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_group_foreach_media_from_db_p
* @since_tizen 2.3
return true;
}
-
/**
* @function utc_media_image_startup
* @description Called before each test
media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
ret = media_content_connect();
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_content_connect failed (code: %d)\n", ret);
startup_ret = ret;
media_filter_create(&filter);
media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_DISPLAY_NAME, MEDIA_CONTENT_COLLATE_DEFAULT);
- if (filter == NULL)
- {
+ if (filter == NULL) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "filter is NULL");
startup_ret = ret;
}
ret = media_info_foreach_media_from_db(filter, media_item_cb, NULL);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, " media_info_foreach_media_from_db failed (code: %d)\n", ret);
startup_ret = ret;
media_filter_destroy(filter);
}
-
/**
* @function utc_media_image_cleanup
* @description Called after each test
media_content_disconnect();
}
-
-
/**
* @testcase utc_image_meta_destroy_n
* @since_tizen 2.3
return 0;
}
-
-
/**
* @testcase utc_image_meta_destroy_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_media_id_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_media_id_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_width_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_width_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_height_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_height_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_orientation_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_orientation_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_date_taken_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_date_taken_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_image_meta_get_exposure_time_n
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_image_meta_get_exposure_time_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_image_meta_get_fnumber_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_image_meta_get_iso_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_image_meta_get_model_p
* @since_tizen 2.4
static const char *g_audio_file = "sound.mp3";
static const char *g_insert_audio_file = "test_sound.mp3";
-
static char *g_insert_path = NULL;
static char *g_origin_path = NULL;
static char *g_move_dst_path = NULL;
static bool g_isFaceRecognitionSupported = FALSE;
-
static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
{
int i;
- char temp[500] = {0, };
+ char temp[500] = { 0, };
if (type == STORAGE_TYPE_INTERNAL) {
- g_insert_path = (char*)malloc(strlen(path) + strlen(g_insert_file) + 6);
- memset(g_insert_path,0x00,strlen(path) + strlen(g_insert_file) + 6);
+ g_insert_path = (char *)malloc(strlen(path) + strlen(g_insert_file) + 6);
+ memset(g_insert_path, 0x00, strlen(path) + strlen(g_insert_file) + 6);
snprintf(g_insert_path, strlen(path) + strlen(g_insert_file) + 6, "%s/res/%s", path, g_insert_file);
- g_origin_path = (char*)malloc(strlen(path) + strlen(g_origin_file) + 6);
- memset(g_origin_path,0x00,strlen(path) + strlen(g_origin_file) + 6);
+ g_origin_path = (char *)malloc(strlen(path) + strlen(g_origin_file) + 6);
+ memset(g_origin_path, 0x00, strlen(path) + strlen(g_origin_file) + 6);
snprintf(g_origin_path, strlen(path) + strlen(g_origin_file) + 6, "%s/res/%s", path, g_origin_file);
- g_move_dst_path = (char*)malloc(strlen(path) + strlen(g_move_dst_file) + 6);
- memset(g_move_dst_path,0x00,strlen(path) + strlen(g_move_dst_file) + 6);
+ g_move_dst_path = (char *)malloc(strlen(path) + strlen(g_move_dst_file) + 6);
+ memset(g_move_dst_path, 0x00, strlen(path) + strlen(g_move_dst_file) + 6);
snprintf(g_move_dst_path, strlen(path) + strlen(g_move_dst_file) + 6, "%s/res/%s", path, g_move_dst_file);
- g_copy_dst_path = (char*)malloc(strlen(path) + strlen(g_copy_dst_file) + 6);
- memset(g_copy_dst_path,0x00,strlen(path) + strlen(g_copy_dst_file) + 6);
+ g_copy_dst_path = (char *)malloc(strlen(path) + strlen(g_copy_dst_file) + 6);
+ memset(g_copy_dst_path, 0x00, strlen(path) + strlen(g_copy_dst_file) + 6);
snprintf(g_copy_dst_path, strlen(path) + strlen(g_copy_dst_file) + 6, "%s/res/%s", path, g_copy_dst_file);
- g_audio_path = (char*)malloc(strlen(path) + strlen(g_audio_file) + 6);
- memset(g_audio_path,0x00,strlen(path) + strlen(g_audio_file) + 6);
+ g_audio_path = (char *)malloc(strlen(path) + strlen(g_audio_file) + 6);
+ memset(g_audio_path, 0x00, strlen(path) + strlen(g_audio_file) + 6);
snprintf(g_audio_path, strlen(path) + strlen(g_audio_file) + 6, "%s/res/%s", path, g_audio_file);
- g_insert_audio_path = (char*)malloc(strlen(path) + strlen(g_insert_audio_file) + 6);
- memset(g_insert_audio_path,0x00,strlen(path) + strlen(g_insert_audio_file) + 6);
+ g_insert_audio_path = (char *)malloc(strlen(path) + strlen(g_insert_audio_file) + 6);
+ memset(g_insert_audio_path, 0x00, strlen(path) + strlen(g_insert_audio_file) + 6);
snprintf(g_insert_audio_path, strlen(path) + strlen(g_insert_audio_file) + 6, "%s/res/%s", path, g_insert_audio_file);
for (i = 0; i < 3; i++) {
- memset(temp,0x00, sizeof(temp));
- snprintf(temp, sizeof(temp), "%s/res/batch%02d.jpg", path,i);
+ memset(temp, 0x00, sizeof(temp));
+ snprintf(temp, sizeof(temp), "%s/res/batch%02d.jpg", path, i);
g_insert_path_list[i] = strndup(temp, sizeof(temp));
- memset(temp,0x00, sizeof(temp));
- snprintf(temp, sizeof(temp), "%s/res/burst%02d.jpg", path,i);
+ memset(temp, 0x00, sizeof(temp));
+ snprintf(temp, sizeof(temp), "%s/res/burst%02d.jpg", path, i);
g_burst_path_list[i] = strndup(temp, sizeof(temp));
}
media_info_get_media_type(media, &type);
media_info_get_display_name(media, &name);
- if(g_item == NULL && g_strcmp0(name, g_insert_file) == 0)
+ if (g_item == NULL && g_strcmp0(name, g_insert_file) == 0)
media_info_clone(&g_item, media);
- if(g_item_sub == NULL && g_strcmp0(name, g_origin_file) == 0) {
+ if (g_item_sub == NULL && g_strcmp0(name, g_origin_file) == 0) {
media_info_clone(&g_item_sub, media);
if (!g_item_media_id)
media_info_get_media_id(media, &g_item_media_id);
}
- if(g_vitem == NULL && type == MEDIA_CONTENT_TYPE_VIDEO)
+ if (g_vitem == NULL && type == MEDIA_CONTENT_TYPE_VIDEO)
media_info_clone(&g_vitem, media);
- else if(g_aitem == NULL && type == MEDIA_CONTENT_TYPE_MUSIC)
+ else if (g_aitem == NULL && type == MEDIA_CONTENT_TYPE_MUSIC)
media_info_clone(&g_aitem, media);
- else if(g_bitem == NULL && type == MEDIA_CONTENT_TYPE_BOOK)
+ else if (g_bitem == NULL && type == MEDIA_CONTENT_TYPE_BOOK)
media_info_clone(&g_bitem, media);
free(name);
media_info_get_media_id(media, &id);
if (id != NULL) {
if (!strcmp(id, g_inserted_media_id)) {
- fprintf(stderr," file path : %s \n", id);
+ fprintf(stderr, " file path : %s \n", id);
foreach_cb_result = MEDIA_CONTENT_ERROR_DB_FAILED;
}
free(id);
return;
}
-
- char test_copy[256] = {0, };
+ char test_copy[256] = { 0, };
snprintf(test_copy, sizeof(test_copy), "/bin/cp %s %s", g_origin_path, g_insert_path);
system(test_copy);
media_content_disconnect();
- if(g_item_media_id){
+ if (g_item_media_id) {
free(g_item_media_id);
g_item_media_id = NULL;
}
- if(g_inserted_media_id){
+ if (g_inserted_media_id) {
free(g_inserted_media_id);
g_inserted_media_id = NULL;
}
- if(g_inserted_audio_id){
+ if (g_inserted_audio_id) {
free(g_inserted_audio_id);
g_inserted_audio_id = NULL;
}
- if(g_filter){
+ if (g_filter) {
media_filter_destroy(g_filter);
g_filter = NULL;
}
- if(g_insert_path != NULL) {
+ if (g_insert_path != NULL) {
free(g_insert_path);
g_insert_path = NULL;
}
- if(g_origin_path != NULL) {
+ if (g_origin_path != NULL) {
free(g_origin_path);
g_origin_path = NULL;
}
- if(g_move_dst_path != NULL) {
+ if (g_move_dst_path != NULL) {
free(g_move_dst_path);
g_move_dst_path = NULL;
}
- if(g_copy_dst_path != NULL) {
+ if (g_copy_dst_path != NULL) {
free(g_copy_dst_path);
g_copy_dst_path = NULL;
}
- if(g_audio_path != NULL) {
+ if (g_audio_path != NULL) {
free(g_audio_path);
g_audio_path = NULL;
}
- if(g_insert_audio_path != NULL) {
+ if (g_insert_audio_path != NULL) {
free(g_insert_audio_path);
g_insert_audio_path = NULL;
}
- for(i = 0; i < 3; i++)
- {
- if(g_burst_path_list[i]) {
+ for (i = 0; i < 3; i++) {
+ if (g_burst_path_list[i]) {
free(g_burst_path_list[i]);
g_burst_path_list[i] = NULL;
}
- if(g_insert_path_list[i]) {
+ if (g_insert_path_list[i]) {
free(g_insert_path_list[i]);
g_insert_path_list[i] = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_insert_to_db_p
* @since_tizen 2.3
return 0;
}
-
static void _insert_batch_cb(media_content_error_e error, void *user_data)
{
insert_batch_cb_result = error;
static gboolean _insert_batch_start(gpointer data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- char test_copy[256] = {0, };
- int i = 0 ;
+ char test_copy[256] = { 0, };
+ int i = 0;
- for (i = 0; i < 3; i ++) {
+ for (i = 0; i < 3; i++) {
memset(test_copy, 0x0, sizeof(test_copy));
snprintf(test_copy, sizeof(test_copy), "/bin/cp %s %s", g_origin_path, g_insert_path_list[i]);
ret = system(test_copy);
}
- ret = media_info_insert_batch_to_db(g_insert_path_list, sizeof(g_insert_path_list)/ sizeof(*g_insert_path_list), _insert_batch_cb, NULL);
- if (ret < 0)
- {
+ ret = media_info_insert_batch_to_db(g_insert_path_list, sizeof(g_insert_path_list) / sizeof(*g_insert_path_list), _insert_batch_cb, NULL);
+ if (ret < 0) {
g_main_loop_quit(g_loop);
insert_batch_cb_result = ret;
}
return false;
}
-
/**
* @testcase utc_media_info_insert_batch_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_insert_batch_to_db_p
* @since_tizen 2.3
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
source = g_idle_source_new();
- g_source_set_callback (source, _insert_batch_start, NULL, NULL);
- g_source_attach (source, context);
+ g_source_set_callback(source, _insert_batch_start, NULL, NULL);
+ g_source_attach(source, context);
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
return 0;
}
-
/**
* @testcase utc_media_info_set_favorite_n
* @since_tizen 2.3
media_info_get_file_path(media, &path);
- if(path){
- if(strcmp(path, g_insert_path) == 0) {
+ if (path) {
+ if (strcmp(path, g_insert_path) == 0) {
media_info_get_favorite(media, &fav);
- if(fav == false)
+ if (fav == false)
g_cb_ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
else
g_cb_ret = MEDIA_CONTENT_ERROR_NONE;
return true;
}
-
/**
* @testcase utc_media_info_set_favorite_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_update_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_update_to_db_p
* @since_tizen 2.3
return 0;
}
-
static void thumb_cb(media_content_error_e error, const char *path, void *user_data)
{
thumb_cb_result = error;
return false;
}
-
/**
* @testcase utc_media_info_create_thumbnail_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_create_thumbnail_p
* @since_tizen 2.3
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
source = g_idle_source_new();
- g_source_set_callback (source, _create_thumbnail_start, NULL, NULL);
- g_source_attach (source, context);
+ g_source_set_callback(source, _create_thumbnail_start, NULL, NULL);
+ g_source_attach(source, context);
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
return false;
}
-
/**
* @testcase utc_media_info_start_face_detection_n
* @since_tizen 3.0
return 0;
}
-
/**
* @testcase utc_media_info_start_face_detection_p
* @since_tizen 3.0
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
source = g_idle_source_new();
- g_source_set_callback (source, _face_detection_start, NULL, NULL);
- g_source_attach (source, context);
+ g_source_set_callback(source, _face_detection_start, NULL, NULL);
+ g_source_attach(source, context);
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
return 0;
}
-
/**
* @testcase utc_media_info_move_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_move_to_db_p
* @since_tizen 2.3
assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE);
int ret = MEDIA_CONTENT_ERROR_NONE;
- char test_copy[256] = {0, };
+ char test_copy[256] = { 0, };
snprintf(test_copy, sizeof(test_copy), "/bin/cp %s %s", g_origin_path, g_move_dst_path);
ret = media_info_delete_from_db(g_inserted_media_id);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- free (m_id);
+ free(m_id);
unlink(g_move_dst_path);
return 0;
}
-
/**
* @testcase utc_media_info_delete_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_delete_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_foreach_media_from_db_n
* @since_tizen 2.3
ret = media_info_foreach_media_from_db(NULL, NULL, NULL);
- if(filter){
+ if (filter) {
media_filter_destroy(filter);
filter = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_foreach_media_from_db_p
* @since_tizen 2.3
ret = media_info_foreach_media_from_db(filter, sub_item_cb, NULL);
- if(filter){
+ if (filter) {
media_filter_destroy(filter);
filter = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_destroy_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_media_id_n
* @since_tizen 2.3
ret = media_info_get_media_id(NULL, &media_id);
- if(media_id){
+ if (media_id) {
free(media_id);
media_id = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_media_id_p
* @since_tizen 2.3
char *media_id = NULL;
ret = media_info_get_media_id(g_item, &media_id);
- if(media_id){
+ if (media_id) {
free(media_id);
media_id = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_file_path_n
* @since_tizen 2.3
ret = media_info_get_file_path(NULL, &path);
- if(path){
+ if (path) {
free(path);
path = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_file_path_p
* @since_tizen 2.3
ret = media_info_get_file_path(g_item, &path);
- if(path){
+ if (path) {
free(path);
path = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_display_name_n
* @since_tizen 2.3
ret = media_info_get_display_name(NULL, &name);
- if(name){
+ if (name) {
free(name);
name = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_display_name_p
* @since_tizen 2.3
ret = media_info_get_display_name(g_item, &name);
- if(name){
+ if (name) {
free(name);
name = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_media_type_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_media_type_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_mime_type_n
* @since_tizen 2.3
ret = media_info_get_mime_type(NULL, &mime_type);
- if(mime_type){
+ if (mime_type) {
free(mime_type);
mime_type = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_mime_type_p
* @since_tizen 2.3
char *mime_type = NULL;
ret = media_info_get_mime_type(g_item, &mime_type);
- if(mime_type){
+ if (mime_type) {
free(mime_type);
mime_type = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_thumbnail_path_n
* @since_tizen 2.3
ret = media_info_get_thumbnail_path(NULL, &thumbnail_path);
- if(thumbnail_path){
+ if (thumbnail_path) {
free(thumbnail_path);
thumbnail_path = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_thumbnail_path_p
* @since_tizen 2.3
ret = media_info_get_thumbnail_path(g_item, &thumbnail_path);
- if(thumbnail_path){
+ if (thumbnail_path) {
free(thumbnail_path);
thumbnail_path = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_modified_time_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_modified_time_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_size_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_size_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_storage_type_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_storage_type_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_storage_id_p
* @since_tizen 2.4
ret = media_info_get_storage_id(g_item, &storage_id);
- if(storage_id) {
+ if (storage_id) {
free(storage_id);
storage_id = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_is_drm_p
* @since_tizen 2.3
bool is_drm = false;
ret = media_info_is_drm(g_item, &is_drm);
- if(is_drm)
+ if (is_drm)
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
return 0;
}
-
/**
* @testcase utc_media_info_get_altitude_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_altitude_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_latitude_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_latitude_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_longitude_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_longitude_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_description_n
* @since_tizen 2.3
assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE);
int ret = MEDIA_CONTENT_ERROR_NONE;
- char *description=NULL;
+ char *description = NULL;
ret = media_info_get_description(NULL, &description);
- if(description){
+ if (description) {
free(description);
description = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_description_p
* @since_tizen 2.3
ret = media_info_get_description(g_item, &description);
- if(description){
+ if (description) {
free(description);
description = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_rating_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_rating_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_added_time_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_added_time_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_favorite_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_favorite_p
* @since_tizen 2.3
ret = media_info_get_media_from_db(NULL, &media);
- if(media){
+ if (media) {
media_info_destroy(media);
media = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_media_from_db_p
* @since_tizen 2.3
ret = media_info_get_media_from_db(g_item_media_id, &media);
- if(media){
+ if (media) {
media_info_destroy(media);
media = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_media_from_db_by_path_n
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_info_get_media_from_db_by_path_p
* @since_tizen 6.5
return 0;
}
-
/**
* @testcase utc_media_info_get_image_n
* @since_tizen 2.3
ret = media_info_get_image(NULL, &image);
- if(image){
+ if (image) {
image_meta_destroy(image);
image = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_image_p
* @since_tizen 2.3
ret = media_info_get_image(g_item, &image);
- if(image){
+ if (image) {
image_meta_destroy(image);
image = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_video_n
* @since_tizen 2.3
ret = media_info_get_video(NULL, &video);
- if(video){
+ if (video) {
video_meta_destroy(video);
video = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_video_p
* @since_tizen 2.3
ret = media_info_get_video(g_vitem, &video);
- if(video){
+ if (video) {
video_meta_destroy(video);
video = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_audio_n
* @since_tizen 2.3
ret = media_info_get_audio(NULL, &audio);
- if(audio){
+ if (audio) {
audio_meta_destroy(audio);
audio = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_audio_p
* @since_tizen 2.3
ret = media_info_get_audio(g_aitem, &audio);
- if(audio){
+ if (audio) {
audio_meta_destroy(audio);
audio = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_book_p
* @since_tizen 6.5
ret = media_info_get_book(g_bitem, &book);
- if(book){
+ if (book) {
book_meta_destroy(book);
book = NULL;
}
return 0;
}
-
static bool sub_tag_cb(media_tag_h tag, void *user_data)
{
char *name = NULL;
- if(tag)
- {
+ if (tag) {
media_tag_get_name(tag, &name);
}
return false;
}
-
static bool sub_bookmark_cb(media_bookmark_h bookmark, void *user_data)
{
int bm_id;
- if(bookmark)
- {
+ if (bookmark) {
media_bookmark_get_bookmark_id(bookmark, &bm_id);
}
return false;
}
-
/**
* @testcase utc_media_info_foreach_tag_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_foreach_tag_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_foreach_bookmark_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_foreach_bookmark_from_db_p
* @since_tizen 2.3
int ret = MEDIA_CONTENT_ERROR_NONE;
filter_h filter = NULL;
- ret=media_filter_create(&filter);
+ ret = media_filter_create(&filter);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
ret = media_info_foreach_bookmark_from_db(g_item_media_id, filter, sub_bookmark_cb, NULL);
return 0;
}
-
/**
* @testcase utc_media_info_get_bookmark_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_bookmark_count_from_db_p
* @since_tizen 2.3
ret = media_info_get_bookmark_count_from_db(g_item_media_id, filter, &count);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(filter){
+ if (filter) {
media_filter_destroy(filter);
filter = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_media_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_media_count_from_db_p
* @since_tizen 2.3
ret = media_info_get_media_count_from_db(filter, &count);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(filter){
+ if (filter) {
media_filter_destroy(filter);
filter = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_tag_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_tag_count_from_db_p
* @since_tizen 2.3
ret = media_info_get_tag_count_from_db(g_item_media_id, filter, &count);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(filter){
+ if (filter) {
media_filter_destroy(filter);
filter = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_get_timeline_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_timeline_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_title_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_get_title_p
* @since_tizen 2.3
{
assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE);
- char* title = NULL;
+ char *title = NULL;
int ret = MEDIA_CONTENT_ERROR_NONE;
ret = media_info_get_title(g_item, &title);
- if(title){
+ if (title) {
free(title);
title = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_is_360_content_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_cancel_thumbnail_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_info_cancel_thumbnail_p
* @since_tizen 2.3
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
source = g_idle_source_new();
- g_source_set_callback (source, _create_cancel_thumbnail_start, NULL, NULL);
- g_source_attach (source, context);
+ g_source_set_callback(source, _create_cancel_thumbnail_start, NULL, NULL);
+ g_source_attach(source, context);
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
return 0;
}
-
/**
* @testcase utc_media_info_cancel_face_detection_p
* @since_tizen 3.0
return 0;
}
-
/**
* @testcase utc_media_info_get_face_count_from_db_p
* @since_tizen 3.0
ret = media_info_get_face_count_from_db(g_item_media_id, filter, &count);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(filter){
+ if (filter) {
media_filter_destroy(filter);
filter = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_foreach_face_from_db_p
* @since_tizen 3.0
ret = media_info_foreach_face_from_db(g_item_media_id, filter, face_cb, NULL);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(filter){
+ if (filter) {
media_filter_destroy(filter);
filter = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_info_generate_thumbnail_n
* @since_tizen 5.0
return 0;
}
-
/**
* @testcase utc_media_info_generate_thumbnail_p
* @since_tizen 5.0
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
return 0;
-}
\ No newline at end of file
+}
static bool __storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)
{
- if(type == STORAGE_TYPE_INTERNAL) {
- img_path = (char*)malloc(strlen(path) + strlen(img_file) + 6);
- memset(img_path,0x00,strlen(path) + strlen(img_file) + 6);
+ if (type == STORAGE_TYPE_INTERNAL) {
+ img_path = (char *)malloc(strlen(path) + strlen(img_file) + 6);
+ memset(img_path, 0x00, strlen(path) + strlen(img_file) + 6);
snprintf(img_path, strlen(path) + strlen(img_file) + 6, "%s/res/%s", path, img_file);
- playlist_path = (char*)malloc(strlen(path) + strlen(playlist_file) + 6);
- memset(playlist_path,0x00,strlen(path) + strlen(playlist_file) + 6);
+ playlist_path = (char *)malloc(strlen(path) + strlen(playlist_file) + 6);
+ memset(playlist_path, 0x00, strlen(path) + strlen(playlist_file) + 6);
snprintf(playlist_path, strlen(path) + strlen(playlist_file) + 6, "%s/res/%s", path, playlist_file);
- create_path = (char*)malloc(strlen(path) + strlen(create_file) + 6);
- memset(create_path,0x00,strlen(path) + strlen(create_file) + 6);
+ create_path = (char *)malloc(strlen(path) + strlen(create_file) + 6);
+ memset(create_path, 0x00, strlen(path) + strlen(create_file) + 6);
snprintf(create_path, strlen(path) + strlen(create_file) + 6, "%s/res/%s", path, create_file);
- copy_path = (char*)malloc(strlen(path) + strlen(copy_file) + 6);
- memset(copy_path,0x00,strlen(path) + strlen(copy_file) + 6);
+ copy_path = (char *)malloc(strlen(path) + strlen(copy_file) + 6);
+ memset(copy_path, 0x00, strlen(path) + strlen(copy_file) + 6);
snprintf(copy_path, strlen(path) + strlen(copy_file) + 6, "%s/res/%s", path, copy_file);
return false;
}
ret = media_info_get_media_id(media, &g_media_id);
- if((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL)) {
+ if ((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL)) {
fprintf(stderr, "CB error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "media_info_get_media_id failed (code: %d)\n", ret);
return false;
return true;
}
-
static bool playlist_item_cb(int playlist_member_id, media_info_h media, void *user_data)
{
- fprintf(stderr,"member id: %d", playlist_member_id);
+ fprintf(stderr, "member id: %d", playlist_member_id);
g_playlist_member_id = playlist_member_id;
return true;
}
-
static bool playlist_cb(media_playlist_h playlist, void *user_data)
{
int playlist_id = 0;
char *name = NULL;
- if(playlist != NULL) {
+ if (playlist != NULL) {
media_playlist_get_playlist_id(g_playlist, &playlist_id);
media_playlist_get_name(g_playlist, &name);
}
- if(name) {
+ if (name) {
free(name);
name = NULL;
}
return true;
}
-
/**
* @function utc_media_playlist_startup
* @description Called before each test
/* start of TC */
media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
- if(storage_foreach_device_supported(__storage_device_supported_cb, NULL) != STORAGE_ERROR_NONE)
- {
+ if (storage_foreach_device_supported(__storage_device_supported_cb, NULL) != STORAGE_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
}
ret = media_content_connect();
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "media_content_connect failed (code: %d)\n", ret);
startup_ret = ret;
media_filter_create(&g_filter);
media_filter_set_condition(g_filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
- if(g_filter == NULL) {
+ if (g_filter == NULL) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "g_filter is NULL");
startup_ret = ret;
}
ret = media_info_foreach_media_from_db(g_filter, media_item_cb, NULL);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "media_info_foreach_media_from_db failed (code: %d)\n", ret);
startup_ret = ret;
return;
}
-
//media_playlist_get_playlist_id(g_playlist, &g_playlist_id);
//media_playlist_delete_from_db(g_playlist_id);
// to check if the same date has been already inserted
ret = media_playlist_insert_to_db(TEST_SET_PLAYLIST_SUB_1, &g_playlist);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "media_playlist_insert_to_db failed (code: %d)\n", ret);
startup_ret = ret;
}
ret = media_playlist_get_playlist_id(g_playlist, &g_playlist_id);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "media_playlist_get_playlist_id failed (code: %d)\n", ret);
startup_ret = ret;
return;
}
- char test_copy[256] = {0, };
+ char test_copy[256] = { 0, };
snprintf(test_copy, sizeof(test_copy), "/bin/cp %s %s", create_path, copy_path);
ret = system(test_copy);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "media_playlist_get_playlist_id failed (code: %d)\n", ret);
startup_ret = ret;
}
}
-
/**
* @function utc_media_playlist_cleanup
* @description Called after each test
}
}
-
/**
* @testcase utc_media_playlist_insert_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_insert_to_db_p
* @since_tizen 2.3
ret = media_playlist_get_name(g_playlist, &name);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(strcmp(name, TEST_SET_PLAYLIST_SUB_2) == 0)
+ if (strcmp(name, TEST_SET_PLAYLIST_SUB_2) == 0)
ret = MEDIA_CONTENT_ERROR_NONE;
else
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
return 0;
}
-
/**
* @testcase utc_media_playlist_delete_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_delete_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_playlist_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_playlist_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_foreach_playlist_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_foreach_playlist_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_media_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_media_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_foreach_media_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_foreach_media_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_destroy_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_clone_p
* @since_tizen 2.3
ret = media_playlist_clone(&g_playlist_dst, g_playlist);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- ret = media_playlist_get_name(g_playlist,&org_name);
+ ret = media_playlist_get_name(g_playlist, &org_name);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- ret = media_playlist_get_name(g_playlist_dst,&dst_name);
+ ret = media_playlist_get_name(g_playlist_dst, &dst_name);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
if (org_name != NULL && dst_name != NULL) {
- if(strcmp(org_name, dst_name))
+ if (strcmp(org_name, dst_name))
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
free(org_name);
return 0;
}
-
/**
* @testcase utc_media_playlist_get_playlist_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_playlist_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_playlist_id_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_playlist_id_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_name_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_name_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_play_order_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_play_order_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_update_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_update_to_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_set_name_n
* @since_tizen 2.3
ret = media_playlist_get_playlist_id(playlist, &playlist_id);
- if(playlist_id == g_playlist_id) {
+ if (playlist_id == g_playlist_id) {
ret = media_playlist_get_name(playlist, &name);
- if(strcmp(name, "myPlaylist") != 0)
+ if (strcmp(name, "myPlaylist") != 0)
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
- if(name){
+ if (name) {
free(name);
name = NULL;
}
return 0;
}
-
/**
* @testcase utc_media_playlist_add_media_p
* @since_tizen 2.3
ret = media_playlist_get_media_count_from_db(playlist_id, g_filter, &media_count);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- if(media_count > 0)
+ if (media_count > 0)
ret = MEDIA_CONTENT_ERROR_NONE;
else
ret = MEDIA_CONTENT_ERROR_INVALID_OPERATION;
return 0;
}
-
/**
* @testcase utc_media_playlist_set_play_order_n
* @since_tizen 2.3
ret = media_playlist_get_playlist_id(playlist, &playlist_id);
- if(playlist_id == g_playlist_id) {
+ if (playlist_id == g_playlist_id) {
ret = media_playlist_get_play_order(playlist, g_playlist_member_id, &playlist_order);
- if(playlist_order != 1)
+ if (playlist_order != 1)
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_playlist_update_to_db(g_playlist);
media_playlist_foreach_media_from_db(g_playlist_id, g_filter, playlist_item_cb, NULL);
- fprintf(stderr,"member id: %d", g_playlist_member_id);
+ fprintf(stderr, "member id: %d", g_playlist_member_id);
ret = media_playlist_set_play_order(g_playlist, g_playlist_member_id, 1);
media_playlist_update_to_db(g_playlist);
return 0;
}
-
/**
* @testcase utc_media_playlist_remove_media_p
* @since_tizen 2.3
ret = media_playlist_foreach_media_from_db(g_playlist_id, g_filter, playlist_item_cb, NULL);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
- fprintf(stderr,"member id: %d", g_playlist_member_id);
+ fprintf(stderr, "member id: %d", g_playlist_member_id);
ret = media_playlist_remove_media(g_playlist, g_playlist_member_id);
assert_eq(ret, MEDIA_CONTENT_ERROR_NONE);
return 0;
}
-
/**
* @testcase utc_media_playlist_get_thumbnail_path_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_get_thumbnail_path_p
* @since_tizen 2.3
{
assert_eq(startup_ret, MEDIA_CONTENT_ERROR_NONE);
- char* thumbnail_path = NULL;
+ char *thumbnail_path = NULL;
int ret = MEDIA_CONTENT_ERROR_NONE;
ret = media_playlist_get_thumbnail_path(g_playlist, &thumbnail_path);
return 0;
}
-
/**
* @testcase utc_media_playlist_set_thumbnail_path_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_playlist_import_from_file_p
* @since_tizen 2.4
ret = media_playlist_import_from_file(copy_path, TEST_SET_PLAYLIST_SUB_3, &playlist);
- if(playlist != NULL) {
+ if (playlist != NULL) {
media_playlist_get_playlist_id(playlist, &playlist_id);
media_playlist_delete_from_db(playlist_id);
media_playlist_destroy(playlist);
return 0;
}
-
/**
* @testcase utc_media_playlist_export_to_file_p
* @since_tizen 2.4
goto MEDIA_STORAGE_CB_FAIL;
if (storage_path) {
- free(storage_path);
- storage_path = NULL;
+ free(storage_path);
+ storage_path = NULL;
}
return true;
-MEDIA_STORAGE_CB_FAIL:
+ MEDIA_STORAGE_CB_FAIL:
if (g_storage) {
- media_storage_destroy(g_storage);
- g_storage = NULL;
+ media_storage_destroy(g_storage);
+ g_storage = NULL;
}
if (g_storage_id) {
- free(g_storage_id);
- g_storage_id = NULL;
+ free(g_storage_id);
+ g_storage_id = NULL;
}
if (storage_path) {
- free(storage_path);
- storage_path = NULL;
+ free(storage_path);
+ storage_path = NULL;
}
return false;
}
-
/**
* @function utc_media_storage_startup
* @description Called before each test
}
}
-
/**
* @function utc_media_storage_cleanup
* @description Called after each test
return 0;
}
-
/**
* @testcase utc_media_storage_get_storage_count_from_db_n
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_storage_destroy_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_storage_clone_n
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_storage_clone_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_storage_get_id_n
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_storage_get_id_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_storage_get_path_p
* @since_tizen 2.4
return 0;
}
-
/**
* @testcase utc_media_storage_get_type_p
* @since_tizen 2.4
g_tag = NULL;
g_tag_dst = NULL;
- media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
+ media_content_error_e ret = MEDIA_CONTENT_ERROR_NONE;
ret = media_content_connect();
if (ret != MEDIA_CONTENT_ERROR_NONE) {
startup_ret = ret;
return;
}
-
// test if the same data already has been inserted
ret = media_tag_insert_to_db(tag_name, &g_tag);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_disconnect();
}
-
static bool tag_cb(media_tag_h tag, void *user_data)
{
char *name = NULL;
if (tag != NULL) {
media_tag_get_name(tag, &name);
- if (name != NULL && strcmp(name, tag_name) == 0) {
- fprintf(stderr," tag name : %s \n", name);
+ if (name != NULL && strcmp(name, tag_name) == 0) {
+ fprintf(stderr, " tag name : %s \n", name);
free(name);
}
}
return true;
}
-
/**
* @testcase utc_media_tag_insert_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_insert_to_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_delete_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_delete_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_tag_count_from_db_n
* @since_tizen 2.3
return 0;
}
+
/**
* @testcase utc_media_tag_get_tag_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_foreach_tag_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_foreach_tag_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_media_count_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_media_count_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_foreach_media_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_foreach_media_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_update_to_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_update_to_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_add_media_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_add_media_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_remove_media_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_remove_media_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_set_name_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_tag_id_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_tag_id_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_name_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_name_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_tag_from_db_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_get_tag_from_db_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_destroy_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_media_tag_destroy_p
* @since_tizen 2.3
return true;
}
-
/**
* @function utc_media_video_startup
* @description Called before each test
}
}
-
/**
* @function utc_media_video_cleanup
* @description Called after each test
g_video = NULL;
}
- if (g_video_dst!= NULL) {
+ if (g_video_dst != NULL) {
video_meta_destroy(g_video_dst);
g_video_dst = NULL;
}
media_content_disconnect();
}
-
-
/**
* @testcase utc_video_meta_destroy_n
* @since_tizen 2.3
return 0;
}
-
-
/**
* @testcase utc_video_meta_destroy_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_clone_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_clone_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_media_id_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_media_id_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_album_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_album_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_artist_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_artist_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_album_artist_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_album_artist_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_genre_n
* @since_tizen 2.3
return 0;
}
-
-
/**
* @testcase utc_video_meta_get_genre_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_composer_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_composer_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_year_n
* @since_tizen 2.3
return 0;
}
-
-
/**
* @testcase utc_video_meta_get_year_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_recorded_date_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_recorded_date_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_copyright_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_copyright_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_track_num_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_track_num_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_bit_rate_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_bit_rate_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_duration_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_duration_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_width_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_width_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_height_n
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_height_p
* @since_tizen 2.3
return 0;
}
-
/**
* @testcase utc_video_meta_get_rotation_p
* @since_tizen 4.0
return 0;
}
-