Reinforce line coverage
[platform/core/api/media-content.git] / src / media_content.c
index 360a59f..77030a4 100644 (file)
@@ -68,7 +68,7 @@ int _content_get_result(char *query, sqlite3_stmt **stmt)
        content_retip_if_fail(_content_get_db_handle());
        content_retip_if_fail(query);
 
-       content_sec_debug("Query[%s]", query);
+       content_debug("Query[%s]", query);
 
        err = sqlite3_prepare_v2(_content_get_db_handle(), query, strlen(query), stmt, NULL);
        if (err != SQLITE_OK) {
@@ -237,10 +237,10 @@ int media_content_scan_file(const char *path)
                        ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_id, path, _content_get_uid());
                        if (ret != MS_MEDIA_ERR_NONE) {
                                if (ret == MS_MEDIA_ERR_DB_CONSTRAINT_FAIL) {
-                                       content_sec_error("This item is already inserted. This may be normal operation because other process already did this (%s)", path);
+                                       content_error("This item is already inserted. This may be normal operation because other process already did this");
                                        ret = MEDIA_CONTENT_ERROR_NONE;
                                } else {
-                                       content_sec_error("media_svc_insert_item_immediately failed : %d (%s)", ret, path);
+                                       content_error("media_svc_insert_item_immediately failed : %d", ret);
                                }
 
                                return _content_error_capi(ret);
@@ -345,6 +345,8 @@ int media_content_scan_folder(const char *path, bool is_recursive, media_scan_co
        ret = _media_content_check_dir(path);
        content_retvm_if(ret == MEDIA_CONTENT_ERROR_PERMISSION_DENIED, ret, "Permission Denied");
 
+       content_sec_debug("Path : %s", path);
+
        if (ret == MEDIA_CONTENT_ERROR_NONE) {
                /* If directory exist check that's ignore directory or not*/
                content_retvm_if(_media_util_is_ignorable_dir(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid folder path");
@@ -352,7 +354,7 @@ int media_content_scan_folder(const char *path, bool is_recursive, media_scan_co
                /* This means this folder has to be deleted */
                /* Or, it is real invalid path.. check storage type */
                if (!ms_user_is_valid_path(_content_get_uid(), path)) {
-                       content_sec_error("ms_user_is_valid_path failed : %d (%s)", ret, path);
+                       content_error("ms_user_is_valid_path failed : %d", ret);
                        return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
                }
 
@@ -425,6 +427,8 @@ int media_content_scan_folder_v2(const char *path, bool is_recursive, media_scan
        content_retip_if_fail(STRING_VALID(path));
        content_retip_if_fail(callback);
 
+       content_sec_debug("Path : %s", path);
+
        content_retvm_if(!_is_mounted(path), MEDIA_CONTENT_ERROR_PERMISSION_DENIED, "path is not mounted");
        content_retvm_if(_media_util_is_ignorable_dir(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid folder path");