INCLUDE(FindPkgConfig)
-SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden")
+SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden ")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
callback, user_data);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid view_uri(%s)", view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_inotify_subscribe() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_inotify_unsubscribe(CAL_NOTI_TODO_CHANGED, callback, user_data);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid view_uri(%s)", view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_inotify_unsubscribe() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
CAL_FN_CALL();
}
+/* LCOV_EXCL_START */
static void _cal_dbus_name_owner_notify(GObject *object, GParamSpec *pspec, gpointer user_data)
{
CAL_FN_CALL();
_cal_dbus_cleanup();
}
+/* LCOV_EXCL_STOP */
void cal_dbus_call_reminder_cb(GDBusConnection *connection,
const gchar *sender_name,
}
unsigned int cal_dbus_subscribe_signal(char *signal_name, GDBusSignalCallback callback,
- gpointer user_data, GDestroyNotify user_data_free_func)
+ gpointer user_data, GDestroyNotify user_data_free_func)
{
GDBusConnection *conn = g_dbus_proxy_get_connection(G_DBUS_PROXY(cal_dbus_object));
cal_dbus_call_register_resource_sync(cal_dbus_object, &ret, NULL, &error);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_register_resource_sync() Fail[%s]", error->message);
g_error_free(error);
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
cal_dbus_call_unregister_resource_sync(cal_dbus_object, &ret, NULL, &error);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_register_resource_sync() Fail[%s]", error->message);
g_error_free(error);
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
NULL,
&error);
if (NULL == cal_dbus_object) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_proxy_new_for_bus_sync() Fail");
if (error) {
ERR("error[%s]", error->message);
g_error_free(error);
}
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
_register_resource();
id = g_signal_connect(cal_dbus_object, "notify::g-name-owner",
G_CALLBACK(_cal_dbus_name_owner_notify), NULL);
if (0 == id) {
+ /* LCOV_EXCL_START */
ERR("g_signal_connect() Fail");
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
int cal_dbus_stop(void)
{
if (NULL == cal_dbus_object) {
+ /* LCOV_EXCL_START */
ERR("No object");
return CALENDAR_ERROR_NONE;
+ /* LCOV_EXCL_STOP */
}
DBG("[ALL CONNECTION IS CLOSED]");
return CALENDAR_ERROR_NONE;
}
+/* LCOV_EXCL_START */
int cal_dbus_recovery(void)
{
CAL_FN_CALL();
return CALENDAR_ERROR_NONE;
}
+/* LCOV_EXCL_STOP */
int cal_dbus_insert_record(calendar_h handle, calendar_record_h record, int *out_id)
{
g_variant_unref(arg_record);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_insert_record_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
if (out_id)
g_variant_unref(arg_record);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_update_record_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
&version, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_delete_record_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
g_variant_unref(arg_record);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_replace_record_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
g_variant_unref(arg_list);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_insert_records_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
g_variant_unref(arg_list);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_update_records_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
g_variant_unref(arg_ids);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_delete_records_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
g_variant_unref(arg_ids);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_replace_records_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
&arg_record, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_record_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("get_record() Fail(%d)", ret);
g_variant_unref(arg_record);
*out_record = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_dbus_utils_gvariant_to_record(arg_record, out_record);
g_variant_unref(arg_record);
offset, limit, &arg_list, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_all_records_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("get_all_records() Fail(%d)", ret);
g_variant_unref(arg_list);
*out_list = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_dbus_utils_gvariant_to_list(arg_list, out_list);
g_variant_unref(arg_query);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_records_with_query_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_dbus_utils_gvariant_to_list(arg_list, out_list);
g_variant_unref(arg_list);
&count, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_count_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_count = count;
g_variant_unref(arg_query);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_count_with_query_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_count = count;
cal_dbus_call_check_permission_write_sync(cal_dbus_object, NULL, &error);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_check_permission_write_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
return cal_client_db_add_changed_cb(handle, view_uri, callback, user_data);
cal_dbus_call_check_permission_write_sync(cal_dbus_object, NULL, &error);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_check_permission_write_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
return cal_client_db_remove_changed_cb(handle, view_uri, callback, user_data);
}
&version, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_current_version_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("server return Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_version = version;
cal_dbus_call_check_permission_read_sync(cal_dbus_object, NULL, &error);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_check_permission_read_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
return cal_handle_get_version(handle, out_version);
}
book_id, in_version, &arg_list, out_version, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_changes_by_version_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_dbus_utils_gvariant_to_list(arg_list, out_list);
g_variant_unref(arg_list);
view_uri, original_id, version, &arg_list, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_get_changes_exception_by_version_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
&ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_clean_after_sync_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
return ret;
&arg_ids, &count, &version, &ret, NULL, &error);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_insert_vcalendars_sync() Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
g_variant_unref(arg_ids);
g_variant_unref(arg_handle);
if (error) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_call_replace_vcalendars_sync Fail[%s]", error->message);
if (G_DBUS_ERROR_ACCESS_DENIED == error->code)
ret = CALENDAR_ERROR_PERMISSION_DENIED;
ret = CALENDAR_ERROR_IPC;
g_error_free(error);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_client_handle_set_version(handle, version);
static GHashTable *_cal_handle_table = NULL;
+/* LCOV_EXCL_START */
static void _foreach_cb(gpointer key, gpointer value, gpointer user_data)
{
DBG("[hash check]--------- key[%s] value[%p]", key, value);
if (table)
g_hash_table_foreach(table, _foreach_cb, NULL);
}
+/* LCOV_EXCL_STOP */
static int _cal_client_handle_get_key(unsigned int id, char *key, int key_len)
{
if (NULL == handle && tid != pid) {
ret = _cal_client_handle_get_key(pid, key, sizeof(key));
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_client_handle_get_key() Fail(%d):No handle(key[%s])", ret, key);
_print_hash(_cal_handle_table);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_mutex_lock(CAL_MUTEX_HANDLE);
handle = g_hash_table_lookup(_cal_handle_table, key);
cal_mutex_unlock(CAL_MUTEX_HANDLE);
if (NULL == handle) {
+ /* LCOV_EXCL_START */
ERR("g_hash_table_lookup() Fail:No handle(key[%s])", key);
_print_hash(_cal_handle_table);
return CALENDAR_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
}
*out_handle = handle;
handle = g_hash_table_lookup(_cal_handle_table, key);
cal_mutex_unlock(CAL_MUTEX_HANDLE);
if (NULL == handle) {
+ /* LCOV_EXCL_START */
ERR("g_hash_table_lookup() Fail:No handle:key[%s]", key);
_print_hash(_cal_handle_table);
return CALENDAR_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
*out_handle = handle;
return CALENDAR_ERROR_NONE;
ret = _cal_client_handle_add(handle, key);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_client_handle_add() Fail(%d)", ret);
cal_handle_destroy(handle);
return ret;
+ /* LCOV_EXCL_STOP */
}
*out_handle = handle;
callback_info_s *ci = NULL;
ci = calloc(1, sizeof(callback_info_s));
if (NULL == ci) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
pthread_mutex_unlock(&cal_mutex_reminder);
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
DBG("add reminer(0x%x)", callback);
}
if (0 == is_matched) {
+ /* LCOV_EXCL_START */
ERR("Not matched callback(0x%x)", callback);
pthread_mutex_unlock(&cal_mutex_reminder);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
DBG("remove reminder(0x%x)", callback);
while (cursor) {
callback_info_s *ci = (callback_info_s *)cursor->data;
if (NULL == ci) {
- ERR("data is NULL");
+ WARN("data is NULL");
cursor = g_slist_next(cursor);
continue;
}
ret = cal_client_handle_create(id, &handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_create() Fail(%d)", ret);
} else if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_client_connect(handle, id, &connection_count);
return ret;
if (CALENDAR_ERROR_NO_DATA == ret) {
return CALENDAR_ERROR_NONE;
} else if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_client_disconnect(handle, id, &connection_count);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_client_disconnect() Fail(%d)", ret);
ret = cal_client_handle_create(id, &handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_create() Fail(%d)", ret);
} else if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_client_connect(handle, id, &connection_count_on_thread);
return ret;
if (CALENDAR_ERROR_NO_DATA == ret) {
return CALENDAR_ERROR_NONE;
} else if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_client_disconnect(handle, id, &connection_count_on_thread);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_client_disconnect() Fail(%d)", ret);
ret = cal_client_handle_create(id, &handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_create() Fail(%d)", ret);
} else if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_client_connect_with_flags(handle, id, &connection_count, flags);
return ret;
#endif
ret = cal_inotify_init();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_inotify_init() Fail(%d)", ret);
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_view_initialize();
} else if (1 < *connection_count) {
DBG("[System] connection count(%d)", *connection_count);
} else {
- DBG("[System] calendar_connect() is needed");
+ /* LCOV_EXCL_START */
+ ERR("[System] calendar_connect() is needed");
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
(*connection_count)--;
GIOChannel *channel;
if (fd < 0) {
+ /* LCOV_EXCL_START */
ERR("Invalid argument: fd is NULL");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
channel = g_io_channel_unix_new(fd);
if (NULL == channel) {
+ /* LCOV_EXCL_START */
ERR("g_io_channel_unix_new() Fail");
return -1; /* CALENDAR_ERROR_FAILED_INOTIFY */
+ /* LCOV_EXCL_STOP */
}
g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL);
#endif
_inoti_fd = inotify_init();
if (_inoti_fd == -1) {
+ /* LCOV_EXCL_START */
ERR("inotify_init() Fail(%d)", errno);
#ifdef CAL_IPC_CLIENT
cal_mutex_lock(CAL_MUTEX_INOTIFY);
cal_mutex_unlock(CAL_MUTEX_INOTIFY);
#endif
return -1; /* CALENDAR_ERROR_FAILED_INOTIFY */
+ /* LCOV_EXCL_STOP */
}
ret = fcntl(_inoti_fd, F_SETFD, FD_CLOEXEC);
inoti_handler = _inotify_attach_handler(_inoti_fd);
if (inoti_handler <= 0) {
+ /* LCOV_EXCL_START */
ERR("_inotify_attach_handler() Fail");
close(_inoti_fd);
_inoti_fd = -1;
cal_mutex_unlock(CAL_MUTEX_INOTIFY);
#endif
return -1; /* CALENDAR_ERROR_FAILED_INOTIFY */
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = inotify_add_watch(fd, notipath, IN_CLOSE_WRITE);
if (ret < 0) {
+ /* LCOV_EXCL_START */
ERR("Failed to add watch(ret:%d)", ret);
return -1; /* CALENDAR_ERROR_FAILED_INOTIFY */
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
while (cursor) {
noti_info_s *info = (noti_info_s *)cursor->data;
if (NULL == info) {
- ERR("No info");
+ WARN("No info");
cursor = g_slist_next(cursor);
continue;
}
noti_info_s *info = NULL;
info = calloc(1, sizeof(noti_info_s));
if (NULL == info) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
info->wd = wd;
wd = _cal_inotify_get_wd(_inoti_fd, path);
if (wd == -1) {
+ /* LCOV_EXCL_START */
ERR("_cal_inotify_get_wd() Fail(%d)", errno);
if (errno == EACCES)
return CALENDAR_ERROR_PERMISSION_DENIED;
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
if (true == _has_noti(wd, cb, cb_data)) {
+ /* LCOV_EXCL_START */
ERR("noti is already registered: path[%s]", path);
_cal_inotify_add_watch(_inoti_fd, path);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = _cal_inotify_add_watch(_inoti_fd, path);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_inotify_add_watch() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
_append_noti(wd, type, cb, cb_data);
}
if (del_cnt == 0) {
+ /* LCOV_EXCL_START */
ERR("Nothing to delete");
return CALENDAR_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
*_noti_list = result;
wd = _cal_inotify_get_wd(_inoti_fd, path);
if (wd == -1) {
+ /* LCOV_EXCL_START */
ERR("_cal_inotify_get_wd() Fail(%d)", errno);
if (errno == EACCES)
return CALENDAR_ERROR_PERMISSION_DENIED;
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
ret = _cal_del_noti(&_noti_list, wd, cb, cb_data);
calendar_record_h clone_record = NULL;
ret = calendar_list_get_current_record_p(list, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_get_current_record_p() Fail(%d)", ret);
calendar_list_destroy(l, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_clone(record, &clone_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_clone() Fail(%d)", ret);
calendar_list_destroy(l, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_list_add(l, clone_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_add() Fail(%d)", ret);
calendar_list_destroy(l, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_list_next(list);
}
return CALENDAR_ERROR_NONE;
}
+ /* LCOV_EXCL_START */
ERR("Check count(%d) < index(%d)", list_s->count, index);
return CALENDAR_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
int cal_list_clear(cal_list_s *list_s)
while (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = calendar_list_remove(list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_remove() Fail(%d)", ret);
break;
+ /* LCOV_EXCL_STOP */
}
}
return ret;
ret_val = &_cal_handle_mutex;
break;
default:
+ /* LCOV_EXCL_START */
ERR("unknown type(%d)", type);
ret_val = NULL;
break;
+ /* LCOV_EXCL_STOP */
}
return ret_val;
}
que = (cal_query_s *)query;
if (NULL == ((cal_composite_filter_s*)filter)->filters) {
+ /* LCOV_EXCL_START */
ERR("Empty filter");
return CALENDAR_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
ret = cal_filter_clone(filter, &new_filter);
_record->properties_flags = calloc(count, sizeof(char));
_record->properties_max_count = count;
if (NULL == _record->properties_flags) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return ;
+ /* LCOV_EXCL_STOP */
}
} else {
+ /* LCOV_EXCL_START */
ERR("get property_info_Fail");
return ;
+ /* LCOV_EXCL_STOP */
}
}
*out_str = cal_strdup(rec->alarm_attach);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->alarm_attach);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->alarm_action);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = rec->alarm;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
rec->alarm_attach = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->remind_tick_unit = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_ALARM_PARENT_ID:
rec->alarm_action = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->alarm = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(rec->attendee_member);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->attendee_member);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->parent_id);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->attendee_member = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->parent_id) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(cal_rec->sync_data4);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (cal_rec->sync_data4);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (cal_rec->mode);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
cal_rec->sync_data4 = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(cal_rec->store_type) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : store type is invalid value (%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_CALENDAR_SYNC_EVENT:
(cal_rec->sync_event) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : sync event is invalid value (%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_CALENDAR_MODE:
(cal_rec->mode) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(rec->end_tzid);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->end_tzid);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->longitude);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = rec->until;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->end_tzid = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->event_status) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_PRIORITY:
(rec->priority) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_TIMEZONE:
(rec->busy_status) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_SENSITIVITY:
(rec->sensitivity) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_MEETING_STATUS:
(rec->meeting_status) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_ORIGINAL_EVENT_ID:
(rec->freq) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_RANGE_TYPE:
(rec->range_type) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_COUNT:
(rec->wkst) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_HAS_ATTENDEE:
(rec->system_type) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_EVENT_IS_ALLDAY:
(rec->is_allday) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->longitude) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->created_time) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
rec->until = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
((cal_event_s *)record)->index = 0;
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid child record type (%d)", record->type);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
ret = calendar_list_add((calendar_list_h)rec->extended_list, child_record);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
ret = calendar_list_remove((calendar_list_h)rec->extended_list, child_record);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = calendar_list_get_count((calendar_list_h)rec->extended_list, (int *)count);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = cal_list_get_nth_record_p(rec->extended_list, index, child_record);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = cal_list_clone((calendar_list_h)rec->extended_list, out_list);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
*out_str = cal_strdup(rec->value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->record_type);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->value = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->record_type) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(rec->sync_data1);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->sync_data1);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->is_allday);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->longitude);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = rec->end;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->sync_data1 = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->original_event_id) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->longitude) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->end = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(rec->sync_data4);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->sync_data4);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = rec->end;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->sync_data4 = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->has_attendee) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->end = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(rec->sync_data1);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->sync_data1);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->original_event_id);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = rec->end;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->sync_data1 = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->original_event_id) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->end = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(rec->sync_data4);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->sync_data4);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->has_attendee);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = rec->end;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->sync_data4 = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->has_attendee) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->end = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(data->value.s);
break;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
*out_str = (data->value.s);
break;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
*out_value = (data->value.i);
break;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
*out_value = (data->value.d);
break;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
*out_value = (data->value.lli);
break;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
*out_value = (data->value.caltime);
break;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
(data->value.s) = cal_strdup(value);
return CALENDAR_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
(data->value.i) = value;
return CALENDAR_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
(data->value.d) = value;
return CALENDAR_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
(data->value.lli) = value;
return CALENDAR_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
(data->value.caltime) = value;
return CALENDAR_ERROR_NONE;
} else {
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
}
}
*out_str = cal_strdup(rec->day_light_name);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->day_light_name);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->calendar_id);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->day_light_name = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->calendar_id) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = cal_strdup(rec->organizer_email);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_str = (rec->organizer_email);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->is_allday);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->longitude);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = (rec->completed_time);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
*out_value = rec->until;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
rec->organizer_email = cal_strdup(value);
break;
default:
+ /* LCOV_EXCL_START */
+ ERR("invalid parameter (value:%s)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->todo_status) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_TODO_PRIORITY:
(rec->priority) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_TODO_SENSITIVITY:
(rec->freq) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_TODO_RANGE_TYPE:
(rec->range_type) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_TODO_COUNT:
(rec->wkst) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (value:%d)", value);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CAL_PROPERTY_TODO_HAS_ALARM:
(rec->is_allday) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->longitude) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->created_time) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->until) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
((cal_extended_s *)record)->id = 0;
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid child record type (%d)", record->type);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
ret = calendar_list_add((calendar_list_h)rec->extended_list, child_record);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = calendar_list_remove((calendar_list_h)rec->extended_list, child_record);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = calendar_list_get_count((calendar_list_h)rec->extended_list, (int *)count);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = cal_list_get_nth_record_p(rec->extended_list, index, child_record);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = cal_list_clone((calendar_list_h)rec->extended_list, out_list);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
*out_value = (rec->version);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
(rec->version) = value;
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid parameter (property:0x%x)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
if (U_FAILURE(status)) {
+ /* LCOV_EXCL_START */
ERR("ucal_open() Fail(%s)", u_errorName(status));
return NULL;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_SUNDAY <= wkst && wkst <= CALENDAR_SATURDAY) {
DBG("set wkst(%d)", wkst);
ucal = cal_time_open_ucal(-1, tzid, -1);
if (NULL == ucal) {
+ /* LCOV_EXCL_START */
ERR("cal_time_open_ucal() Fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
ucal_setMillis(ucal, sec2ms(lli), &status);
if (U_FAILURE(status)) {
+ /* LCOV_EXCL_START */
ERR("ucal_setMillFail (%s)", u_errorName(status));
ucal_close(ucal);
return NULL;
+ /* LCOV_EXCL_STOP */
}
y = ucal_get(ucal, UCAL_YEAR, &status);
ucal = cal_time_open_ucal(-1, tzid, -1);
if (NULL == ucal) {
+ /* LCOV_EXCL_START */
ERR("cal_time_open_ucal() Fail");
return 0;
+ /* LCOV_EXCL_STOP */
}
ucal_set(ucal, UCAL_YEAR, y);
ucal_set(ucal, UCAL_MONTH, mon -1);
u_uastrcpy(utzid, tzid);
ucal = ucal_open(utzid, u_strlen(utzid), "en_US", UCAL_TRADITIONAL, &status);
if (U_FAILURE(status)) {
+ /* LCOV_EXCL_START */
ERR("ucal_open() Fail(%s)", u_errorName(status));
CAL_FREE(utzid);
return status;
+ /* LCOV_EXCL_STOP */
}
switch (today->type) {
ucal = cal_time_open_ucal(-1, tz, -1);
if (NULL == ucal) {
+ /* LCOV_EXCL_START */
ERR("cal_time_open_ucal() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
int32_t zone = ucal_get(ucal, UCAL_ZONE_OFFSET, &status);
int32_t dst = ucal_get(ucal, UCAL_DST_OFFSET, &status);
ucal = cal_time_open_ucal(-1, tz, -1);
if (NULL == ucal) {
+ /* LCOV_EXCL_START */
ERR("cal_time_open_ucal() Fail");
return false;
+ /* LCOV_EXCL_STOP */
}
ucal_setMillis(ucal, sec2ms(t), &status);
bool is_dst = ucal_inDaylightTime(ucal, &status);
UErrorCode status = U_ZERO_ERROR;
UCalendar *ucal = __get_gmt_ucal();
if (NULL == ucal) {
+ /* LCOV_EXCL_START */
ERR("__get_gmt_ucal() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
ucal_setMillis(ucal, sec2ms(t), &status);
if (y) *y = ucal_get(ucal, UCAL_YEAR, &status);
UErrorCode status = U_ZERO_ERROR;
UCalendar *ucal = cal_time_open_ucal(-1, tzid, 0);
if (NULL == ucal) {
+ /* LCOV_EXCL_START */
ERR("__get_gmt_ucal() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
ucal_setMillis(ucal, sec2ms(t), &status);
if (y) *y = ucal_get(ucal, UCAL_YEAR, &status);
char **t = NULL;
t = g_strsplit_set(src, " ,", -1);
if (NULL == t) {
+ /* LCOV_EXCL_START */
ERR("g_strsplit_set() Fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
int len_t = 0;
len_t = g_strv_length(t);
if (0 == len_t) {
+ /* LCOV_EXCL_START */
ERR("Empty src");
return NULL;
+ /* LCOV_EXCL_STOP */
}
int i;
continue;
int num = atoi(t[i]);
if (0 == num) {
+ /* LCOV_EXCL_START */
ERR("Invalid parameter[%s]", t[i]);
continue;
+ /* LCOV_EXCL_STOP */
}
if (g_list_find(l, GINT_TO_POINTER(num))) {
+ /* LCOV_EXCL_START */
ERR("Find same data[%s]", t[i]);
continue;
+ /* LCOV_EXCL_STOP */
}
l = g_list_append(l, GINT_TO_POINTER(num));
}
int len_src = strlen(src) +1;
char *out_str = calloc(len_src, sizeof(char));
if (NULL == out_str) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
g_list_free(l);
g_strfreev(t);
return NULL;
+ /* LCOV_EXCL_STOP */
}
int len = 0;
GList *cursor = NULL;
cal_vcalendar_make_free(&b);
if (!ical) {
+ /* LCOV_EXCL_START */
ERR("cal_vcalendar_make_get_data() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (!*ical) {
+ /* LCOV_EXCL_START */
ERR("No ical data");
free(ical);
return CALENDAR_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
*vcalendar_stream = ical;
len = (int)((long)vcal_cursor - (long)vcal_start);
vcalendar_object = calloc(len + 1, sizeof(char));
if (NULL == vcalendar_object) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
memcpy(vcalendar_object, vcal_start, len);
*pvcalendar_object = vcalendar_object;
err = cal_vcalendar_parse_vcalendar_object(vcalendar_object, list, NULL);
if (CALENDAR_ERROR_NONE != err) {
+ /* LCOV_EXCL_START */
ERR("cal_vcalendar_parse_vcalendar_object() failed(%d)", err);
calendar_list_destroy(list, true);
free(vcalendar_object);
cal_time_fini();
return err;
+ /* LCOV_EXCL_STOP */
}
free(vcalendar_object);
}
file = fopen(vcalendar_file_path, "r");
if (NULL == file) {
+ /* LCOV_EXCL_START */
ERR("Invalid argument: no file");
calendar_list_destroy(list, true);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
len = 0;
buf_size = ICALENAR_BUFFER_MAX;
stream = calloc(ICALENAR_BUFFER_MAX, sizeof(char));
if (NULL == stream) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
fclose(file);
calendar_list_destroy(list, true);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
foreach_data = calloc(1, sizeof(vcalendar_foreach_s));
if (NULL == foreach_data) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
free(stream);
fclose(file);
calendar_list_destroy(list, true);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
foreach_data->callback = callback;
foreach_data->user_data = user_data;
if (new_stream) {
stream = new_stream;
} else {
+ /* LCOV_EXCL_START */
+ ERR("out of memory");
free(stream);
fclose(file);
free(foreach_data);
calendar_list_destroy(list, true);
- ERR("out of memory");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
len += snprintf(stream + len, strlen(buf) +1, "%s", buf);
}
__calendar_vcalendar_get_vcalendar_object(stream, &vcalendar_object);
err = cal_vcalendar_parse_vcalendar_object(vcalendar_object, list, foreach_data);
if (CALENDAR_ERROR_NONE != err || false == foreach_data->ret) {
+ /* LCOV_EXCL_START */
ERR("cal_vcalendar_parse_vcalendar_object() failed(%d)", err);
calendar_list_destroy(list, true);
free(vcalendar_object);
free(foreach_data);
fclose(file);
return err;
+ /* LCOV_EXCL_STOP */
}
free(vcalendar_object);
len = 0;
char **t = NULL;
t = g_strsplit_set(mday, " ,", -1);
if (!t) {
+ /* LCOV_EXCL_START */
ERR("g_strsplit_set() Fail");
g_strfreev(t);
return 0;
+ /* LCOV_EXCL_STOP */
}
int len = strlen(buf);
int tlen = g_strv_length(t);
int len = strlen(buf);
t = g_strsplit_set(wday, " ,", -1);
if (!t) {
+ /* LCOV_EXCL_START */
ERR("g_strsplit_set() Fail");
g_strfreev(t);
return;
+ /* LCOV_EXCL_STOP */
}
length = g_strv_length(t);
num_past = 0;
t = g_strsplit_set(wday, " ,", -1);
if (!t) {
+ /* LCOV_EXCL_START */
ERR("g_strsplit_set() Fail");
g_strfreev(t);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
length = g_strv_length(t);
DBG("len(%d)", length);
}
if (num_past == num)
len += snprintf(buf +len, buf_len -len, "%s ", p +j);
- else
+ else
ERR("Out of 1.0 spec");
DBG("%d num(%d) val[%s]", i, num, p + j);
sensitivity = "CONFIDENTIAL";
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid sensitivity(%d)", value);
return;
+ /* LCOV_EXCL_STOP */
}
_cal_vcalendar_make_printf(b, "CLASS:", sensitivity);
}
ret = calendar_record_get_int(record, _calendar_event.range_type, &range_type);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_get_int() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
int len = strlen(buf);
case CALENDAR_RANGE_COUNT:
ret = calendar_record_get_int(record, _calendar_event.count, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_get_int() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
snprintf(buf +len, buf_len -len, "#%d", count);
break;
ret = calendar_record_get_caltime(record, _calendar_event.until_time, &caltime);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_get_caltime() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
switch (caltime.type) {
case CALENDAR_TIME_UTIME:
break;
default:
+ /* LCOV_EXCL_START */
ERR("Out of scope");
break;
+ /* LCOV_EXCL_STOP */
}
if (*buf) {
}
break;
case CALENDAR_BOOK_TYPE_TODO:
+ /* LCOV_EXCL_START */
ERR("No rrule in todo");
return;
+ /* LCOV_EXCL_STOP */
}
}
}
break;
case CALENDAR_BOOK_TYPE_TODO:
+ /* LCOV_EXCL_START */
ERR("No rrule in todo");
return;
+ /* LCOV_EXCL_STOP */
}
}
RETM_IF(CALENDAR_ERROR_NONE != ret, "calendar_record_get_str_p() Fail(%d)", ret);
break;
case CALENDAR_BOOK_TYPE_TODO:
+ /* LCOV_EXCL_START */
ERR("Not support exdate in TODO");
break;
+ /* LCOV_EXCL_STOP */
}
if (value && *value)
_cal_vcalendar_make_printf(b, "EXDATE:", value);
return;
}
if (strlen(p) < size) {
+ /* LCOV_EXCL_START */
ERR("out of size");
return;
+ /* LCOV_EXCL_STOP */
}
snprintf(p, size + 1, "%s%c", buf, '\0');
char *out_p = NULL;
out_p = realloc(p, len);
if (NULL == out_p) {
+ /* LCOV_EXCL_START */
ERR("realloc() Fail");
return NULL;
+ /* LCOV_EXCL_STOP */
}
/* check enough space */
char **s = NULL;
s = g_strsplit(t[0], ";", -1);
if (NULL == s) {
+ /* LCOV_EXCL_START */
ERR("g_strsplit() Fail");
g_strfreev(t);
return NULL;
+ /* LCOV_EXCL_STOP */
}
int count_param = g_strv_length(s);
DBG("count_param(%d)", count_param);
char *tzid = NULL;
tzid = strdup(s[i] + strlen("TZID="));
if (NULL == tzid) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
__adjust_tzid(tzid);
DBG("modified tzid[%s]", tzid);
if (ud->timezone_tzid && *ud->timezone_tzid) {
ud->datetime_tzid = strdup(ud->timezone_tzid);
if (NULL == ud->datetime_tzid) {
+ /* LCOV_EXCL_START */
ERR("strdup() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
DBG("set datetime_tzid[%s] as timezone_tzid", ud->datetime_tzid);
} else {
+ /* LCOV_EXCL_START */
ERR("INVALID tzid");
+ /* LCOV_EXCL_STOP */
}
break;
}
digit = 0;
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid value");
break;
+ /* LCOV_EXCL_STOP */
}
}
}
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid time format[%s]", p);
ret = CALENDAR_ERROR_INVALID_PARAMETER;
break;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
sign = 0;
if (0 == strlen(t[0])) {
+ /* LCOV_EXCL_START */
ERR("No hour");
g_strfreev(t);
return;
+ /* LCOV_EXCL_STOP */
}
char buf[8] = {0};
calendar_time_s dtstart = {0};
ret = _get_caltime(value, &dtstart, ud);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_get_caltime() Fail(%d)", ret);
return;
+ /* LCOV_EXCL_STOP */
}
char *tzid = NULL;
calendar_time_s dtend = {0};
ret = _get_caltime(value, &dtend, ud);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_get_caltime() Fail(%d)", ret);
return;
+ /* LCOV_EXCL_STOP */
}
char *tzid = NULL;
prop = "UNKNOWN";
} else {
+ /* LCOV_EXCL_START */
ERR("Invalid value[%s]", value);
+ /* LCOV_EXCL_STOP */
}
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
if (strlen(value) > strlen("CHAIR"))
prop = "CHAIR";
} else {
+ /* LCOV_EXCL_START */
ERR("Invalid value[%s]", value);
+ /* LCOV_EXCL_STOP */
}
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
prop = "IN-PROCESS";
} else {
+ /* LCOV_EXCL_START */
ERR("Invalid value[%s]", value);
+ /* LCOV_EXCL_STOP */
}
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
calendar_record_h alarm = NULL;
ret = calendar_record_create(_calendar_alarm._uri, &alarm);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail(%d)", ret);
g_strfreev(t);
return;
+ /* LCOV_EXCL_STOP */
}
ret = cal_record_set_int(alarm, _calendar_alarm.action, CALENDAR_ALARM_ACTION_DISPLAY);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
calendar_time_s alarm_time = {0};
ret = _get_caltime(t[i], &alarm_time, ud);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_get_caltime() Fail(%d)", ret);
index = VCAL_VER_10_AALARM_NONE;
break;
+ /* LCOV_EXCL_STOP */
}
if (true == ud->has_rrule) {
int diff = 0;
ret = _sub_caltime(ud, &start_time, &alarm_time, &diff);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_sub_caltime() Fail(%d)", ret);
index = VCAL_VER_10_DALARM_NONE;
break;
+ /* LCOV_EXCL_STOP */
}
_set_alarm_tick_unit(alarm, alarm_time, diff);
calendar_record_h alarm = NULL;
ret = calendar_record_create(_calendar_alarm._uri, &alarm);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail(%d)", ret);
g_strfreev(t);
return;
+ /* LCOV_EXCL_STOP */
}
ret = cal_record_set_int(alarm, _calendar_alarm.action, CALENDAR_ALARM_ACTION_EMAIL);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
calendar_time_s alarm_time = {0};
ret = _get_caltime(t[i], &alarm_time, ud);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_get_caltime() Fail(%d)", ret);
index = VCAL_VER_10_AALARM_NONE;
break;
+ /* LCOV_EXCL_STOP */
}
if (true == ud->has_rrule) {
int diff = 0;
ret = _sub_caltime(ud, &start_time, &alarm_time, &diff);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_sub_caltime() Fail(%d)", ret);
index = VCAL_VER_10_MALARM_NONE;
break;
+ /* LCOV_EXCL_STOP */
}
_set_alarm_tick_unit(alarm, alarm_time, diff);
calendar_record_h alarm = NULL;
ret = calendar_record_create(_calendar_alarm._uri, &alarm);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail(%d)", ret);
g_strfreev(t);
return;
+ /* LCOV_EXCL_STOP */
}
ret = cal_record_set_int(alarm, _calendar_alarm.action, CALENDAR_ALARM_ACTION_AUDIO);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
calendar_time_s alarm_time = {0};
ret = _get_caltime(t[i], &alarm_time, ud);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_get_caltime() Fail(%d)", ret);
index = VCAL_VER_10_AALARM_NONE;
break;
+ /* LCOV_EXCL_STOP */
}
if (true == ud->has_rrule) {
int diff = 0;
ret = _sub_caltime(ud, &start_time, &alarm_time, &diff);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_sub_caltime() Fail(%d)", ret);
index = VCAL_VER_10_AALARM_NONE;
break;
+ /* LCOV_EXCL_STOP */
}
_set_alarm_tick_unit(alarm, alarm_time, diff);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
break;
case CALENDAR_BOOK_TYPE_TODO:
+ /* LCOV_EXCL_START */
ERR("No exdate in todo");
break;
+ /* LCOV_EXCL_STOP */
}
}
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid index(%d)", index);
cursor = __crlf(cursor);
break;
+ /* LCOV_EXCL_STOP */
}
if (true == exit_loop) break;
if (CAL_STRING_EQUAL == strncmp(cursor, "TZID:", strlen("TZID:"))) {
char *p = cursor + strlen("TZID");
if (NULL == p || '\0' == *p) {
+ /* LCOV_EXCL_START */
ERR("Inavlid tzid");
cursor = __crlf(cursor);
continue;
+ /* LCOV_EXCL_STOP */
}
if (ud->timezone_tzid) {
free(ud->timezone_tzid);
else
ERR("g_hash_table_lookup() Fail");
} else {
+ /* LCOV_EXCL_START */
ERR("Unable to get cal_uri_property_hash[%s]", view_uri);
+ /* LCOV_EXCL_STOP */
}
return type;
snprintf(query, sizeof(query), "SELECT count(id) FROM %s WHERE deleted = 0 ", CAL_TABLE_CALENDAR);
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
info->write_list = calloc(count +1, sizeof(int));
if (NULL == info->write_list) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
info->write_list_count = 0;
snprintf(query, sizeof(query), "SELECT id, mode, owner_label FROM %s WHERE deleted = 0 ", CAL_TABLE_CALENDAR);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
int write_index = 0;
if (NULL == info) {
info = calloc(1, sizeof(cal_permission_info_s));
if (NULL == info) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
cal_mutex_unlock(CAL_MUTEX_ACCESS_CONTROL);
return;
+ /* LCOV_EXCL_STOP */
}
__thread_list = g_list_append(__thread_list, info);
}
unsigned int thread_id = pthread_self();
info = _cal_access_control_find_permission_info(thread_id);
if (NULL == info) {
+ /* LCOV_EXCL_START */
cal_mutex_unlock(CAL_MUTEX_ACCESS_CONTROL);
ERR("_cal_access_control_find_permission_info() Fail");
return false;
+ /* LCOV_EXCL_STOP */
}
if (NULL == info->write_list) {
+ /* LCOV_EXCL_START */
cal_mutex_unlock(CAL_MUTEX_ACCESS_CONTROL);
ERR("there is no write access info");
return false;
+ /* LCOV_EXCL_STOP */
}
int i = 0;
CAL_TABLE_CALENDAR, book_id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (CAL_SQLITE_ROW != cal_db_util_stmt_step(stmt)) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
ret = CALENDAR_ERROR_PERMISSION_DENIED;
GMainLoop* main_loop = NULL;
static int cal_timeout = 0;
+/* LCOV_EXCL_START */
void cal_server_quit_loop(void)
{
g_main_loop_quit(main_loop);
main_loop = NULL;
}
+/* LCOV_EXCL_STOP */
static int _cal_server_init(void)
{
ret = cal_connect();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_connect() Failed");
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_access_control_set_client_info(NULL, "calendar-service");
int main(int argc, char *argv[])
{
INFO("---------------------[SERVER START]------------------------");
+
if (getuid() == 0) { /* root */
gid_t glist[] = {CAL_SECURITY_FILE_GROUP};
if (setgroups(1, glist) < 0)
- ERR("setgroups() Failed");
+ WARN("setgroups() Failed");
}
cal_timeout = argc > 1 ? atoi(argv[1]) : CAL_TIMEOUT_FOR_DEFAULT;
pthread_mutex_lock(&cal_mutex_account);
ret = account_subscribe_create(&cal_account_h);
if (ACCOUNT_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("account_subscribe_create() Fail(%d)", ret);
pthread_mutex_unlock(&cal_mutex_account);
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
ret = account_subscribe_notification(cal_account_h, _noti_cb, NULL);
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail");
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
DBG("alarm_id(%d)", alarm_id);
CAL_TABLE_ALARM, alarm_id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_util_end_trans(true);
return CALENDAR_ERROR_NONE;
_cal_server_alarm_unset_alerted_alarmmgr_id(alarm_id);
ret = alarmmgr_remove_alarm(alarm_id);
if (ret != ALARMMGR_RESULT_SUCCESS) {
+ /* LCOV_EXCL_START */
ERR("alarmmgr_remove_alarm() Fail(ret:%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail");
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
DBG("Update alarm_id(%d) in alarm table", alarm_id);
CAL_TABLE_ALARM, alarm_id, event_id, tick, unit);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_util_end_trans(true);
return CALENDAR_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
long long int utime = 0;
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
const char *datetime = NULL;
datetime = (const char *)sqlite3_column_text(stmt, 0);
if (NULL == datetime || '\0' == *datetime) {
+ /* LCOV_EXCL_START */
ERR("Invalid datetime [%s]", datetime);
sqlite3_finalize(stmt);
return 0;
+ /* LCOV_EXCL_STOP */
}
int y = 0, m = 0, d = 0;
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int event_id = 0;
}
if (NULL == tt_alert) {
+ /* LCOV_EXCL_START */
ERR("Invalid parameter: tt_alert is NULL");
sqlite3_finalize(stmt);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_ALARM_TIME_UNIT_SPECIFIC == unit) {
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
struct _alarm_data_s *ad = calloc(1, sizeof(struct _alarm_data_s));
if (NULL == ad) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
sqlite3_finalize(stmt);
return;
+ /* LCOV_EXCL_STOP */
}
ad->event_id = sqlite3_column_int(stmt, 0);
{
int ret = 0;
char query[CAL_DB_SQL_MAX_LEN] = {0};
-snprintf(query, sizeof(query), "SELECT event_id,remind_tick_unit,remind_tick,"
+ snprintf(query, sizeof(query), "SELECT event_id,remind_tick_unit,remind_tick,"
"alarm_type,alarm_utime,alarm_datetime "
"FROM %s WHERE remind_tick_unit=%d AND alarm_type=%d AND alarm_datetime %s '%s' %s",
CAL_TABLE_ALARM, CALENDAR_ALARM_TIME_UNIT_SPECIFIC, CALENDAR_TIME_LOCALTIME,
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
struct _alarm_data_s *ad = calloc(1, sizeof(struct _alarm_data_s));
if (NULL == ad) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
sqlite3_finalize(stmt);
return;
+ /* LCOV_EXCL_STOP */
}
ad->event_id = sqlite3_column_int(stmt, 0);
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
struct _alarm_data_s *ad = calloc(1, sizeof(struct _alarm_data_s));
if (NULL == ad) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
sqlite3_finalize(stmt);
return;
+ /* LCOV_EXCL_STOP */
}
ad->event_id = sqlite3_column_int(stmt, 0);
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
struct _alarm_data_s *ad = calloc(1, sizeof(struct _alarm_data_s));
if (NULL == ad) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
sqlite3_finalize(stmt);
return;
+ /* LCOV_EXCL_STOP */
}
ad->event_id = sqlite3_column_int(stmt, 0);
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
struct _alarm_data_s *ad = calloc(1, sizeof(struct _alarm_data_s));
if (NULL == ad) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
sqlite3_finalize(stmt);
return;
+ /* LCOV_EXCL_STOP */
}
ad->event_id = sqlite3_column_int(stmt, 0);
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
struct _alarm_data_s *ad = calloc(1, sizeof(struct _alarm_data_s));
if (NULL == ad) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
sqlite3_finalize(stmt);
return;
+ /* LCOV_EXCL_STOP */
}
ad->event_id = sqlite3_column_int(stmt, 0);
/* clear all alarm which set by mine. */
ret = alarmmgr_enum_alarm_ids(_cal_server_alarm_clear_all_cb, NULL);
if (ret != ALARMMGR_RESULT_SUCCESS) {
+ /* LCOV_EXCL_START */
ERR("alarmmgr_enum_alarm_ids() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
time_t mod_time = (time_t)ad->alert_utime;
alarm_entry_t *alarm_info = NULL;
alarm_info = alarmmgr_create_alarm();
if (NULL == alarm_info) {
+ /* LCOV_EXCL_START */
ERR("Failed to create alarm");
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
tzset();
struct tm st_alarm = {0};
int alarm_id = 0;
ret = alarmmgr_add_alarm_with_localtime(alarm_info, NULL, &alarm_id);
if (ret < 0) {
+ /* LCOV_EXCL_START */
ERR("alarmmgr_add_alarm_with_localtime Fail (%d)", ret);
alarmmgr_free_alarm(alarm_info);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("alarmmgr id (%d)", alarm_id);
_cal_server_alarm_update_alarm_id(alarm_id, ad->event_id, ad->tick, ad->unit);
struct alarm_ud *au = (struct alarm_ud *)user_data;
GList *alarm_list = au->alarm_list;
if (NULL == alarm_list) {
+ /* LCOV_EXCL_START */
ERR("No list");
return true;
+ /* LCOV_EXCL_STOP */
}
int len = 0;
len = g_list_length(alarm_list);
app_control_h ac = NULL;
ret = app_control_create(&ac);
if (APP_CONTROL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("app_control_create() Fail(%d)", ret);
return true;
+ /* LCOV_EXCL_STOP */
}
ret = app_control_set_operation(ac, APP_CONTROL_OPERATION_DEFAULT);
if (APP_CONTROL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("app_control_create() Fail(%d)", ret);
app_control_destroy(ac);
return true;
+ /* LCOV_EXCL_STOP */
}
ret = app_control_set_app_id(ac, package);
if (APP_CONTROL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("app_control_set_app_id() Fail(%d)", ret);
app_control_destroy(ac);
return true;
+ /* LCOV_EXCL_STOP */
}
char **ids = NULL;
ids = calloc(len, sizeof(char *));
if (NULL == ids) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
app_control_destroy(ac);
return true;
+ /* LCOV_EXCL_STOP */
}
GList *cursor = g_list_first(alarm_list);
for (i = 0; i < len; i++) {
struct _alarm_data_s *ad = (struct _alarm_data_s *)cursor->data;
if (NULL == ad) {
- ERR("No data");
+ WARN("No data");
cursor = g_list_next(cursor);
continue;
}
app_control_h app_control = NULL;
ret = app_control_create(&app_control);
if (APP_CONTROL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("app_control_create() Fail(%d)", ret);
return;
+ /* LCOV_EXCL_STOP */
}
ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
if (APP_CONTROL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("app_control_set_operation() Fail(%d)", ret);
app_control_destroy(app_control);
return;
+ /* LCOV_EXCL_STOP */
}
ret = app_control_set_mime(app_control, "application/x-tizen.calendar.reminder");
if (APP_CONTROL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("app_control_set_mime() Fail(%d)", ret);
app_control_destroy(app_control);
return;
+ /* LCOV_EXCL_STOP */
}
struct alarm_ud *au = calloc(1, sizeof(struct alarm_ud));
if (NULL == au) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
app_control_destroy(app_control);
return;
+ /* LCOV_EXCL_STOP */
}
au->alarm_list = alarm_list;
ret = app_control_foreach_app_matched(app_control, __app_matched_cb, au);
if (APP_CONTROL_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("app_control_foreach_app_matched() Fail(%d)", ret);
free(au);
app_control_destroy(app_control);
return;
+ /* LCOV_EXCL_STOP */
}
free(au);
app_control_destroy(app_control);
while (l) {
struct _alarm_data_s *ad = (struct _alarm_data_s *)l->data;
if (NULL == ad) {
- ERR("No data");
+ WARN("No data");
l = g_list_next(l);
continue;
}
ret = alarmmgr_init("calendar-service");
if (ret < 0) {
+ /* LCOV_EXCL_START */
ERR("alarmmgr_init() Fail(%d)", ret);
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
ret = alarmmgr_set_cb(_alert_cb, NULL);
if (ret < 0) {
+ /* LCOV_EXCL_START */
ERR("alarmmgr_set_cb() Fail(%d)", ret);
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
cal_server_alarm_register_next_alarm(time(NULL));
static bool _cal_server_calendar_delete_step(int ret, __calendar_delete_data_s* data)
{
if (CALENDAR_ERROR_NONE != ret && CALENDAR_ERROR_NO_DATA != ret) {
+ /* LCOV_EXCL_START */
+ ERR("_cal_server_calendar_delete_step Fail(%d)", ret);
if (data->calendar_id_list)
g_list_free(data->calendar_id_list);
CAL_FREE(data);
- ERR("_cal_server_calendar_delete_step Fail(%d)", ret);
return false;
+ /* LCOV_EXCL_STOP */
}
switch (data->step) {
case STEP_1:
snprintf(query, sizeof(query), "SELECT id FROM %s WHERE deleted = 1", CAL_TABLE_CALENDAR);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
int id = 0;
count = g_list_length(data->calendar_id_list);
if (count <= 0)
- return CALENDAR_ERROR_NO_DATA;
+ return CALENDAR_ERROR_NO_DATA;
GList *cursor = g_list_first(data->calendar_id_list);
if (cursor) {
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() failed");
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
/* get event_list */
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id=%d", CAL_TABLE_SCHEDULE, id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
cal_db_util_end_trans(false);
g_list_free(list);
return ret;
+ /* LCOV_EXCL_STOP */
}
cursor = g_list_next(cursor);
}
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() failed");
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
CAL_FN_CALL();
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id=%d", CAL_TABLE_CALENDAR, data->current_calendar_id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_util_end_trans(true);
CAL_FN_CALL();
if (data == NULL) {
+ /* LCOV_EXCL_START */
ERR("data is NULL");
return false;
+ /* LCOV_EXCL_STOP */
}
switch (data->step) {
ret = _cal_server_calendar_delete_step3(data);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid step");
if (data->calendar_id_list)
g_list_free(data->calendar_id_list);
CAL_FREE(data);
-
return false;
+ /* LCOV_EXCL_STOP */
}
return _cal_server_calendar_delete_step(ret, data);
__calendar_delete_data_s *callback_data = NULL;
callback_data = calloc(1, sizeof(__calendar_delete_data_s));
if (NULL == callback_data) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
callback_data->step = STEP_1;
/* delete */
ret = cal_connect();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_connect() Fail(%d)", ret);
free(callback_data);
break;
+ /* LCOV_EXCL_STOP */
}
while (1) {
ret = calendar_record_set_str(event, _calendar_event.summary, label);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_str() Fail:summary");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_set_int(event, _calendar_event.calendar_book_id,
DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_int() Fail:calendar_book_id");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_set_caltime(event, _calendar_event.start_time, st);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_caltime() Fail:start_time");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_set_caltime(event, _calendar_event.end_time, et);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_caltime() Fail:end_time");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_set_int(event, _calendar_event.person_id, id);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_int() Fail:person_id");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_set_str(event, _calendar_event.sync_data1, type_str);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_str() Fail:sync_data1");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_set_int(event, _calendar_event.freq, CALENDAR_RECURRENCE_YEARLY);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_int() Fail:freq");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_set_int(event, _calendar_event.interval, 1);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_int() Fail:interval");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (CONTACTS_EVENT_CALENDAR_TYPE_CHINESE == calendar_type) {
ret = calendar_record_set_int(event, _calendar_event.calendar_system_type,
CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_int() Fail:calendar_system_type");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
} else {
ret = calendar_record_set_str(event, _calendar_event.bymonthday, buf);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_str() Fail:bymonthday");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
ret = calendar_record_set_int(event, _calendar_event.range_type, CALENDAR_RANGE_NONE);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_int() Fail:range type");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < account_id) {
snprintf(buf, sizeof(buf), "%d", account_id);
ret = calendar_record_set_str(event, _calendar_event.sync_data4, buf);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_set_str() Fail:sync data4");
calendar_record_destroy(event, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
array = calloc(max_count, sizeof(int));
if (NULL == array) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
char query[CAL_DB_SQL_MAX_LEN] = {0};
CAL_TABLE_SCHEDULE, contact_id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
free(array);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index = 0;
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
int event_id = sqlite3_column_int(stmt, 0);
if (0 == event_id) {
+ /* LCOV_EXCL_START */
ERR("event id is invalid");
break;
+ /* LCOV_EXCL_STOP */
}
if (max_count <= index) {
max_count *= 2;
array = realloc(array, max_count *sizeof(int));
if (NULL == array) {
+ /* LCOV_EXCL_START */
ERR("realloc() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
}
array[index] = event_id;
contacts_record_h contact = NULL;
ret = contacts_db_get_record(_contacts_contact._uri, id, &contact);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("contacts_db_get_record() Fail(%d)", ret);
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
int address_book_id = 0;
ret = contacts_record_get_int(contact, _contacts_contact.address_book_id, &address_book_id);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("contacts_record_get_int() Fail(%d)", ret);
contacts_record_destroy(contact, true);
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
if (0 < address_book_id) { /* default phone addressbook is 0 */
DBG("address_book_id(%d)", address_book_id);
contacts_record_h address_book = NULL;
ret = contacts_db_get_record(_contacts_address_book._uri, address_book_id, &address_book);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
DBG("contacts_db_get_record() Fail(%d)", ret);
contacts_record_destroy(contact, true);
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
ret = contacts_record_get_int(address_book, _contacts_address_book.account_id, &account_id);
contacts_record_destroy(address_book, true);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
DBG("contacts_record_get_inti() Fail(%d)", ret);
contacts_record_destroy(contact, true);
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
DBG("account_id[%d]", account_id);
}
case CONTACTS_EVENT_TYPE_CUSTOM:
ret = contacts_record_get_str_p(contact_event, _contacts_event.label, &type_str);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("contacts_record_get_str_p() Fail(%d)", ret);
is_proper_type = false;
break;
+ /* LCOV_EXCL_STOP */
}
break;
default:
cal_server_contacts_delete_event(contact_id, &delete_array, &delete_count);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid");
break;
+ /* LCOV_EXCL_STOP */
}
if (0 < delete_count) {
array = realloc(array, (count +delete_count) *sizeof(int));
if (NULL == array) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
free(delete_array);
break;
+ /* LCOV_EXCL_STOP */
}
memcpy(array +count, delete_array, delete_count *sizeof(int));
count += delete_count;
{
CAL_START_TIMESTAMP
- int ret;
+ int ret;
int contacts_ver = -1;
char query[CAL_DB_SQL_MAX_LEN] = {0};
snprintf(query, sizeof(query), "SELECT contacts_ver FROM %s", CAL_TABLE_VERSION);
ret = cal_db_util_query_get_first_int_result(query, NULL, &contacts_ver);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("contacts_ver(%d)", contacts_ver);
ret = contacts_db_get_changes_by_version(_contacts_contact_updated_info._uri,
-1, contacts_ver, &contacts_list, &latest_ver);
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("contacts_db_get_changes_by_version() Fail(%d)", ret);
contacts_list_destroy(contacts_list, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (NULL == contacts_list) {
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail(%d)", ret);
contacts_list_destroy(contacts_list, true);
calendar_list_destroy(insert_list, true);
free(delete_array);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_delete_records(_calendar_event._uri, delete_array, delete_count);
snprintf(query, sizeof(query), "UPDATE %s SET contacts_ver=%d", CAL_TABLE_VERSION, latest_ver);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
contacts_list_destroy(contacts_list, true);
calendar_list_destroy(insert_list, true);
free(delete_array);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_util_notify(CAL_NOTI_TYPE_EVENT);
contacts_list_destroy(contacts_list, true);
cal_db_util_end_trans(true);
CAL_PRINT_TIMESTAMP
- return CALENDAR_ERROR_NONE;
+ return CALENDAR_ERROR_NONE;
}
void cal_server_contacts_delete(int account_id)
RETM_IF(CALENDAR_ERROR_NONE != ret, "calendar_query_create() Fail");
ret = calendar_filter_create(_calendar_event._uri, &filter);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_filter_create() Fail");
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_filter_add_str(filter, _calendar_event.sync_data4,
CALENDAR_MATCH_EXACTLY, buf);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_filter_add_str() Fail(%d)", ret);
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_filter_add_operator(filter, CALENDAR_FILTER_OPERATOR_AND);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_filter_add_operator() Fail(%d)", ret);
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_filter_add_int(filter, _calendar_event.calendar_book_id,
CALENDAR_MATCH_EQUAL, DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_filter_add_int() Fail(%d)", ret);
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_query_set_filter(query, filter);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_query_set_filter() Fail");
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
unsigned int projection = _calendar_event.id;
ret = calendar_query_set_projection(query, &projection , 1);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_query_set_projection() Fail");
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_get_records_with_query(query, 0, 0, &list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_get_records_with_query() Fail");
calendar_list_destroy(list, true);
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_list_get_count(list, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_get_count() Fail");
calendar_list_destroy(list, true);
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return ;
+ /* LCOV_EXCL_STOP */
}
DBG("event count(%d)\n", count);
if (0 < count) {
record_id_array = (int *)calloc(count, sizeof(int));
if (NULL == record_id_array) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
calendar_list_destroy(list, true);
calendar_filter_destroy(filter);
calendar_query_destroy(query);
return;
+ /* LCOV_EXCL_STOP */
}
calendar_list_first(list);
ret = cal_connect();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_connect() Fail(%d)", ret);
cal_server_ondemand_start();
break;
+ /* LCOV_EXCL_STOP */
}
cal_access_control_set_client_info(NULL, "calendar-service");
ret = contacts_connect();
if (CONTACTS_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("contacts_connect() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = contacts_db_add_changed_cb(_contacts_event._uri, _changed_cb, NULL);
while (cursor) {
cal_sender_s *sender = (cal_sender_s *)cursor->data;
if (NULL == sender) {
- ERR("sender is NULL");
+ WARN("sender is NULL");
cursor = g_list_next(cursor);
continue;
}
cal_sender_s *sender = NULL;
sender = calloc(1, sizeof(cal_sender_s));
if (NULL == sender) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
sender->name = cal_strdup(name);
DBG("[SENDER] Append sender[%s]", sender->name);
g_mutex_lock(&cal_server_dbus_sender);
if (true == _has_sender(sender_name, NULL)) {
+ /* LCOV_EXCL_START */
ERR("Already has sender");
g_mutex_unlock(&cal_server_dbus_sender);
return TRUE;
+ /* LCOV_EXCL_STOP */
}
ret = _append_sender(sender_name);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_append_sender() Fail");
g_mutex_unlock(&cal_server_dbus_sender);
return TRUE;
+ /* LCOV_EXCL_STOP */
}
DBG("append sender");
g_mutex_unlock(&cal_server_dbus_sender);
while (cursor) {
cal_sender_s *sender = (cal_sender_s *)cursor->data;
if (NULL == sender) {
+ /* LCOV_EXCL_START */
ERR("sender is NULL");
return CALENDAR_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
if (CAL_STRING_EQUAL == g_strcmp0(sender->name, owner_name)) {
cal_sender_s *sender = NULL;
ret = _cal_server_dbus_find_sender(old_owner, &sender);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_server_dbus_find_sender() Fail(%d)", ret);
g_mutex_unlock(&cal_server_dbus_sender);
return;
+ /* LCOV_EXCL_STOP */
}
if (sender) { /* found bus name in our bus list */
NULL,
NULL);
if (0 == id) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_connection_signal_subscribe() Fail");
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
dbus_object = cal_dbus_skeleton_new();
if (NULL == dbus_object) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_skeleton_new() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
g_signal_connect(dbus_object, "handle-register-resource",
ret = g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(dbus_object),
conn, CAL_DBUS_OBJPATH, &error);
if (FALSE == ret) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_interface_skeleton_export() Fail(%s)", error->message);
g_error_free(error);
return;
+ /* LCOV_EXCL_STOP */
}
ret = _cal_server_dbus_subscribe_name_owner_changed(conn);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_server_dbus_subscribe_name_owner_changed() Fail(%d)", ret);
return;
+ /* LCOV_EXCL_STOP */
}
}
NULL,
NULL);
if (0 == id) {
+ /* LCOV_EXCL_START */
ERR("g_bus_own_name() Fail");
return 0;
+ /* LCOV_EXCL_STOP */
}
return id;
}
calDbusSkeleton *skeleton = NULL;
skeleton = CAL_DBUS_SKELETON(cal_dbus_get_object());
if (NULL == skeleton) {
+ /* LCOV_EXCL_START */
ERR("cal_dbus_get_object() Fail");
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
GDBusConnection *conn = NULL;
conn = g_dbus_interface_skeleton_get_connection(G_DBUS_INTERFACE_SKELETON(skeleton));
if (NULL == conn) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_interface_skeleton_get_connection() Fail");
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
ret = g_dbus_connection_emit_signal(conn,
&error);
if (FALSE == ret) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_connection_emit_signal() Fail");
if (error) {
ERR("error[%s]", error->message);
g_error_free(error);
}
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
if (FALSE == g_dbus_connection_flush_sync(conn, NULL, &error)) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_connection_flush_sync() Fail");
if (error) {
ERR("error[%s]", error->message);
g_error_free(error);
}
return CALENDAR_ERROR_IPC;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = db_util_open(db_file, &db, 0);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("db_util_open() Fail(%d) ", ret);
return -1;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_exec(db, schema_query, NULL, 0, &errmsg);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_exec() Fail[%s]", errmsg);
sqlite3_free(errmsg);
+ db_util_close(db);
+ return -1;
+ /* LCOV_EXCL_STOP */
}
db_util_close(db);
return 0;
fd = open(db_file, O_RDONLY);
if (fd < 0) {
+ /* LCOV_EXCL_START */
ERR("DB file(%s) is not exist(err:%d) ", db_file, fd);
return -1;
+ /* LCOV_EXCL_STOP */
}
close(fd);
return 0;
cal_view_initialize();
ret = cal_inotify_init();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_inotify_init() Fail(%d)", ret);
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
} else {
DBG("[System] calendar service has been already connected");
if (0 == cal_thread_connection) {
ret = cal_db_util_open();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_open() Fail(%d)", ret);
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
cal_thread_connection++;
if (1 == cal_thread_connection) {
cal_db_util_close();
} else if (cal_thread_connection <= 0) {
+ /* LCOV_EXCL_START */
DBG("[System] not connected, count(%d)", cal_thread_connection);
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
cal_thread_connection--;
} else if (1 < cal_total_connection) {
DBG("[System] connection count(%d)", cal_total_connection);
} else {
+ /* LCOV_EXCL_START */
DBG("[System] Not connected, count(%d)", cal_total_connection);
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
cal_total_connection--;
snprintf(query, sizeof(query), "PRAGMA user_version;");
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_prepare_v2() failed[%s]", sqlite3_errmsg(db));
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
ret = sqlite3_step(stmt);
if (SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_step() failed[%s]", sqlite3_errmsg(db));
sqlite3_finalize(stmt);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
if (version)
*version = (int)sqlite3_column_int(stmt, 0);
snprintf(db_file, sizeof(db_file), "%s/%s", DB_PATH, CALS_DB_NAME);
ret = db_util_open(db_file, &__db, 0);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("db_util_open() fail(%d):[%s]", ret, db_file);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
_cal_server_update_get_db_version(__db, &old_version);
DBG("[%s] old version(%d)", db_file, old_version);
+ /* LCOV_EXCL_START */
if (old_version < 100) {
/* ----------------------- start modified 2013/08/22
* added attendee_table(cutype, delegatee_uri, member), alarm_table(summary, action, attach).
}
old_version = 100;
/* ----------------------- end modified 2013/08/22
- */
+ */
}
if (old_version == 100) {
/* ----------------------- start modified 2013/09/22
}
old_version = 101;
/* ----------------------- end modified 2013/09/22
- */
+ */
}
if (old_version == 101) {
/* ----------------------- start modified 2014/07/02
sqlite3_free(errmsg);
}
/* ----------------------- end modified 2014/07/02
- */
+ */
old_version = 102;
}
if (old_version == 102) {
sqlite3_free(errmsg);
}
/* ----------------------- end modified 2014/10/24
- */
+ */
old_version = 103;
}
}
old_version = 105;
}
+ /* LCOV_EXCL_STOP */
/* update DB user_version */
snprintf(query, sizeof(query), "PRAGMA user_version = %d", __USER_VERSION);
ret = sqlite3_exec(__db, query, NULL, 0, &errmsg);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_exec() failed(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
+ db_util_close(__db);
+ return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
db_util_close(__db);
__db = NULL;
if (NULL == *dst) {
*dst = cal_strdup(src);
if (NULL == *dst) {
+ /* LCOV_EXCL_START */
ERR("cal_strdup() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
char *tmp = *dst;
tmp = (char *)realloc(tmp, len_dst + len_src + 2);
if (NULL == tmp) {
+ /* LCOV_EXCL_START */
ERR("realloc() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
*dst = tmp;
snprintf(*dst + len_dst, len_src + 2, " %s", src);
case CAL_RECORD_TYPE_EXTENDED:
return (&cal_db_extended_plugin_cb);
default:
+ /* LCOV_EXCL_START */
ERR("Invalid plugin(%d)", type);
return NULL;
+ /* LCOV_EXCL_STOP */
}
return NULL;
}
CAL_SCH_TYPE_EVENT);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/*
CAL_SCH_TYPE_TODO);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/*
CAL_TABLE_CALENDAR);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/* CAL_VIEW_TABLE_ALLDAY_INSTANCE : CALENDAR_VIEW_INSTANCE_ALLDAY_CALENDAR */
CAL_TABLE_CALENDAR);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/*
CAL_TABLE_CALENDAR);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/* CAL_VIEW_TABLE_ALLDAY_INSTANCE_EXTENDED : CALENDAR_VIEW_INSTANCE_ALLDAY_CALENDAR_EXTENDED */
CAL_TABLE_CALENDAR);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/*
CAL_TABLE_RRULE);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/*
CAL_TABLE_RRULE);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
/*
CAL_TABLE_RRULE);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("[%s]", query);
+ /* LCOV_EXCL_START */
+ SECURE("[%s]", query);
ERR("create view Fail");
+ /* LCOV_EXCL_STOP */
}
cal_db_util_end_trans(true);
return ;
ret = plugin_cb->get_all_records(offset, limit, &list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("get_all_records() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_list_first(list);
if (out_list) *out_list = list;
ret = plugin_cb->get_records_with_query(query, offset, limit, &list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("get_records_with_query() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_list_first(list);
if (out_list) *out_list = list;
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail");
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
/* !! please check rrule_table, alarm_table, attendee_table ..*/
ret = cal_is_owner(calendar_book_id);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
if (CALENDAR_ERROR_PERMISSION_DENIED == ret)
ERR("Does not have permission of calendar_book (%d)", calendar_book_id);
else
ERR("cal_is_owner() Fail(%d)", ret);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* delete event table */
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* delete delete table */
CAL_TABLE_DELETED, calendar_book_id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_util_end_trans(true);
calendar_record_h record = NULL;
ret = calendar_list_get_current_record_p(list, &record);
if (NULL == record || CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("No record in the list");
cal_db_util_end_trans(false);
CAL_FREE(_ids);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_record_s *temp = (cal_record_s *)record;
cal_db_plugin_cb_s* plugin_cb = _cal_db_get_plugin(temp->type);
if (NULL == plugin_cb || NULL == plugin_cb->insert_record) {
- DBG("Not plugin");
+ /* LCOV_EXCL_START */
+ ERR("Not plugin");
cal_db_util_end_trans(false);
CAL_FREE(_ids);
return CALENDAR_ERROR_NOT_PERMITTED;
+ /* LCOV_EXCL_STOP */
}
ret = plugin_cb->insert_record(record, &_ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
- DBG("insert_record() Fail(%d)", ret);
+ /* LCOV_EXCL_START */
+ ERR("insert_record() Fail(%d)", ret);
cal_db_util_end_trans(false);
CAL_FREE(_ids);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("insert with id(%d)", _ids[i]);
calendar_list_next(list);
sleep(1);
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("cal_db_util_begin_trans() Fail(%d)", ret);
calendar_list_destroy(list, true);
CAL_FREE(_ids);
- ERR("cal_db_util_begin_trans() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
}
calendar_record_h record = NULL;
ret = calendar_list_get_current_record_p(list, &record);
if (NULL == record || CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("No record in the list");
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_record_s *temp = (cal_record_s *)record;
cal_db_plugin_cb_s* plugin_cb = _cal_db_get_plugin(temp->type);
if (NULL == plugin_cb || NULL == plugin_cb->update_record) {
+ /* LCOV_EXCL_START */
ERR("Not plugin");
cal_db_util_end_trans(false);
ret = CALENDAR_ERROR_NOT_PERMITTED;
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = plugin_cb->update_record(record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("update_record() Fail(%d)", ret);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("update record");
calendar_list_next(list);
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
- calendar_list_destroy(list, true);
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail(%d)", ret);
+ calendar_list_destroy(list, true);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
}
calendar_record_h record = NULL;
ret = calendar_list_get_current_record_p(list, &record);
if (NULL == record || CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("No record in the list");
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_record_s *temp = (cal_record_s *)record;
cal_db_plugin_cb_s* plugin_cb = _cal_db_get_plugin(temp->type);
if (NULL == plugin_cb || NULL == plugin_cb->insert_record) {
- DBG("Not plugin");
+ /* LCOV_EXCL_START */
+ ERR("Not plugin");
cal_db_util_end_trans(false);
ret = CALENDAR_ERROR_NOT_PERMITTED;
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = plugin_cb->replace_record(record, ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
- DBG("replace_record() Fail(%d)", ret);
+ /* LCOV_EXCL_START */
+ ERR("replace_record() Fail(%d)", ret);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("insert with id(%d)", ids[i]);
calendar_list_next(list);
ret = calendar_list_get_count(list, &list_count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_get_count() Fail(%d)", ret);
calendar_list_destroy(list, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_list_first(list);
ids = calloc(1, sizeof(int)*list_count);
if (NULL == ids) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
calendar_list_destroy(list, true);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("cal_db_util_begin_trans() Fail(%d)", ret);
calendar_list_destroy(list, true);
CAL_FREE(ids);
- ERR("cal_db_util_begin_trans() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < list_count; i++) {
ret = calendar_list_get_current_record_p(list, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_get_current_record_p() Fail(%d)", ret);
calendar_list_destroy(list, true);
CAL_FREE(ids);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_insert_record(record, &ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_insert_record() Fail(%d)", ret);
calendar_list_destroy(list, true);
CAL_FREE(ids);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_list_next(list);
ret = calendar_list_get_count(list, &list_count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_get_count() Fail(%d)", ret);
calendar_list_destroy(list, true);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (count != list_count) {
calendar_list_destroy(list, true);
+ /* LCOV_EXCL_START */
ERR("Mismatched count: vcalendar_count=%d, input count=%d", list_count, count);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
calendar_list_first(list);
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(list, true);
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
/* divide count for accessing of another modules */
ret = calendar_list_get_current_record_p(list, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_get_current_record_p() Fail(%d)", ret);
calendar_list_destroy(list, true);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* set_id */
ret = calendar_record_get_uri_p(record, &view_uri);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_get_uri_p() Fail(%d)", ret);
calendar_list_destroy(list, true);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (CAL_STRING_EQUAL == strcmp(view_uri, _calendar_event._uri)) {
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_record_set_int() Fail(%d)", ret);
calendar_list_destroy(list, true);
cal_db_util_end_trans(false);
+ /* LCOV_EXCL_STOP */
return ret;
}
/* update */
ret = cal_db_update_record(record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_update_record() Fail(%d)", ret);
calendar_list_destroy(list, true);
cal_db_util_end_trans(false);
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_list_next(list);
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(list, true);
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
}
ret = cal_db_util_query_get_first_int_result(query, NULL, &transaction_ver);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (current_version) *current_version = transaction_ver;
schedule_type = CAL_SCH_TYPE_TODO;
record_type = CAL_RECORD_TYPE_TODO;
} else {
+ /* LCOV_EXCL_START */
ERR("Invalid parameter");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query),
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
calendar_list_destroy(*record_list, true);
*record_list = NULL;
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = calendar_record_create(_calendar_updated_info._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail");
calendar_list_destroy(*record_list, true);
*record_list = NULL;
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
id = sqlite3_column_int(stmt, 0);
ret = calendar_list_add(*record_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_add() Fail");
calendar_list_destroy(*record_list, true);
*record_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
record_type = CAL_RECORD_TYPE_EVENT;
} else {
+ /* LCOV_EXCL_START */
ERR("Invalid parameter");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query),
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
calendar_list_destroy(*record_list, true);
*record_list = NULL;
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = calendar_record_create(_calendar_updated_info._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail");
calendar_list_destroy(*record_list, true);
*record_list = NULL;
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
id = sqlite3_column_int(stmt, 0);
ret = calendar_list_add(*record_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_add() Fail");
calendar_list_destroy(*record_list, true);
*record_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
case CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR:
s_ucal = cal_time_open_ucal(-1, tzid, wkst);
if (NULL == s_ucal) {
+ /* LCOV_EXCL_START */
ERR("cal_time_open_ucal() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
ucal_setMillis(s_ucal, ucal_getMillis(ucal, &ec), &ec);
break;
case CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR:
s_ucal = cal_time_open_ucal(-1, event->start_tzid, event->wkst);
if (NULL == s_ucal) {
+ /* LCOV_EXCL_START */
ERR("cal_time_open_ucal() Fail");
return;
+ /* LCOV_EXCL_STOP */
}
ucal_setMillis(s_ucal, ucal_getMillis(ucal, &ec), &ec);
break;
}
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
g_strfreev(t);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
g_strfreev(t);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
switch (st->type) {
case CALENDAR_TIME_UTIME:
if (et->time.utime < st->time.utime) {
+ /* LCOV_EXCL_START */
ERR("check time: end(%lld < start(%lld)", et->time.utime, st->time.utime);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
_duration = et->time.utime - st->time.utime;
break;
_duration = ucal_getFieldDifference(ucal, ud, UCAL_SECOND, &ec);
if (U_FAILURE(ec)) {
+ /* LCOV_EXCL_START */
ERR("ucal_getFieldDifference() Fail[%s]", u_errorName(ec));
return ec;
+ /* LCOV_EXCL_STOP */
}
break;
}
DBG("exdate[%s]", exdate);
t = g_strsplit_set(exdate, " ,", -1);
if (NULL == t) {
+ /* LCOV_EXCL_START */
ERR("g_strsplit_set() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
int i;
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
g_strfreev(t);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
g_strfreev(t);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("delete allday");
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record = NULL;
ret = calendar_record_create(_calendar_alarm._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_alarm_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_finalize(stmt);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ALARM)) {
table_name = cal_strdup(CAL_TABLE_ALARM);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
CAL_FREE(query_str);
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_alarm._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create(%d) Fail", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record,
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_add(%d) Fail", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
CAL_FREE(query_str);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() failed");
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query, count);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ALARM)) {
table_name = cal_strdup(CAL_TABLE_ALARM);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() failed");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query_str, count);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index = 0;
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = calendar_record_create(_calendar_alarm._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
sqlite3_finalize(stmt);
cal_list_clear(list);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = 0;
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_record_h record = NULL;
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = calendar_record_create(_calendar_attendee._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_attendee_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_add() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_finalize(stmt);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ATTENDEE)) {
table_name = cal_strdup(CAL_TABLE_ATTENDEE);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
CAL_FREE(query_str);
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() failed");
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query, count);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ATTENDEE)) {
table_name = cal_strdup(CAL_TABLE_ATTENDEE);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() failed");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query_str, count);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
attendee->parent_id = parent_id;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index;
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = calendar_record_create(_calendar_attendee._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create() Fail(%d)", ret);
sqlite3_finalize(stmt);
cal_list_clear(list);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = 0;
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
return true;
default:
+ /* LCOV_EXCL_START */
ERR("store type is invalid(%d)", calendar->store_type);
return false;
+ /* LCOV_EXCL_STOP */
}
return true;
}
cal_book_s *book = (cal_book_s *)(record);
if (false == _cal_db_calendar_check_value_validation(book)) {
+ /* LCOV_EXCL_START */
ERR("cal_db_calendar_check_value_validation() Fail");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
char *client_label = NULL;
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
free(client_label);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (book->uid)
ret = cal_db_util_stmt_step(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
free(client_label);
- ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
sqlite3_finalize(stmt);
free(client_label);
ret = calendar_record_create(_calendar_book._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query), "SELECT * FROM %s WHERE id=%d AND (deleted = 0)",
CAL_TABLE_CALENDAR, id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_record_destroy(*out_record, true);
*out_record = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
SECURE("query[%s]", query);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE == ret)
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_calendar_get_stmt(stmt, *out_record);
cal_book_s* book = (cal_book_s*)(record);
if (false == _cal_db_calendar_check_value_validation(book)) {
+ /* LCOV_EXCL_START */
ERR("cal_db_calendar_check_value_validation() Fail");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (book->common.properties_flags != NULL)
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (book->uid)
ret = cal_db_util_stmt_step(stmt);
if (CALENDAR_ERROR_NONE != ret) {
- sqlite3_finalize(stmt);
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
+ sqlite3_finalize(stmt);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
sqlite3_finalize(stmt);
cal_db_util_notify(CAL_NOTI_TYPE_CALENDAR);
CAL_TABLE_CALENDAR, id);
ret = cal_db_util_query_get_first_int_result(query, NULL, &calendar_book_id);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
int count = 0;
snprintf(query, sizeof(query), "select count(*) from %s", CAL_TABLE_NORMAL_INSTANCE);
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query), "select count(*) from %s", CAL_TABLE_ALLDAY_INSTANCE);
ret = cal_db_util_query_get_first_int_result(query, NULL, &count2);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
count += count2;
cal_book_s *book = (cal_book_s *)(record);
if (false == _cal_db_calendar_check_value_validation(book)) {
+ /* LCOV_EXCL_START */
ERR("cal_db_calendar_check_value_validation() Fail");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
book->index = id;
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (book->uid)
ret = cal_db_util_stmt_step(stmt);
if (CALENDAR_ERROR_NONE != ret) {
- sqlite3_finalize(stmt);
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
+ sqlite3_finalize(stmt);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
sqlite3_finalize(stmt);
cal_db_util_notify(CAL_NOTI_TYPE_CALENDAR);
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_calendar_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
return ret;
+ /* LCOV_EXCL_STOP */
}
}
ret = cal_db_util_query_prepare(query_str, &stmt);
SECURE("[TEST]---------query[%s]", query_str);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_add() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
for (i = 0; i < count; i++) {
ret = _cal_db_calendar_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_calendar_delete_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
int ret = 0;
if (NULL == list) {
+ /* LCOV_EXCL_START */
ERR("Invalid argument: list is NULL");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_list_first(list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list first error");
return ret;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = _cal_db_calendar_replace_record(record, ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_calendar_replace_record() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
int count = 0;
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() failed");
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
CAL_FREE(query_str);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_CALENDAR)) {
table_name = cal_strdup(CAL_TABLE_CALENDAR);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() failed");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
free(set);
bind_text = NULL;
}
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind */
ret = cal_db_util_stmt_step(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
SECURE("query[%s]", query);
sqlite3_finalize(stmt);
bind_text = NULL;
}
return ret;
+ /* LCOV_EXCL_STOP */
}
sqlite3_finalize(stmt);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_begin_trans() Fail(%d)", ret);
g_list_free(calendar_list);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
GList* cursor = calendar_list;
ret = cal_db_delete_record(_calendar_book._uri, id);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_delete_record() Fail(%d)", ret);
SECURE("book_id(%d)", id);
+ /* LCOV_EXCL_STOP */
}
cursor = g_list_next(cursor);
}
ret = calendar_record_create(_calendar_event._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
event = (cal_event_s*)(*out_record);
CAL_TABLE_CALENDAR);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_record_destroy(*out_record, true);
*out_record = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
SECURE("[%s]", query);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE == ret)
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_event_get_stmt(stmt, false, *out_record, &exception, &extended);
calendar_record_destroy(record_calendar, true);
}
if (event->is_deleted == 1 && CALENDAR_BOOK_SYNC_EVENT_FOR_EVERY_AND_REMAIN != sync_event_type) {
+ /* LCOV_EXCL_START */
calendar_record_destroy(*out_record, true);
*out_record = NULL;
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_RECURRENCE_NONE != event->freq) {
ret = cal_db_rrule_get_rrule(event->index, &rrule);
field = calloc(len_field, sizeof(char)); /* add (len_t * 8) for YYYYMMDD -> YYYYMMDDTHHMMSSZ */
if (NULL == field) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
g_strfreev(t);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
struct tm tm = {0};
ret = cal_db_event_check_value_validation(event);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_event_check_value_validation() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* access control */
if (cal_access_control_have_write_permission(event->calendar_id) == false) {
+ /* LCOV_EXCL_START */
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
if (event->common.properties_flags) {
calendar_record_h old_record = NULL;
ret = cal_db_get_record(_calendar_event._uri, event->index, &old_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_db_get_record() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* get time diff */
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
/*
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* add recurrence id to end of the exdate of original event. */
len = strlen((const char *)temp) + strlen(recurrence_id) + 2;
exdate = calloc(len, sizeof(char));
if (NULL == exdate) {
+ /* LCOV_EXCL_START */
ERR("calloc() Fail");
sqlite3_finalize(stmt);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
snprintf(exdate, len, "%s,%s", temp, recurrence_id);
DBG("append [%s] to already has exdate [%s]", temp, recurrence_id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
free(exdate);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index = 1;
sqlite3_finalize(stmt);
free(exdate);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
/* get calendar_id, created_ver, original_event_id, recurrence_id */
ret = _cal_db_event_get_deleted_data(id, &calendar_book_id, &created_ver, &original_event_id, &recurrence_id);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
DBG("_cal_db_event_get_deleted_data() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
/* access control */
if (cal_access_control_have_write_permission(calendar_book_id) == false) {
+ /* LCOV_EXCL_START */
ERR("Fail");
CAL_FREE(recurrence_id);
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
if (0 < original_event_id) {
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
} else {
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id = %d ", CAL_TABLE_SCHEDULE, id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("attendee, alarm and rrule is deleted by trigger");
}
- cal_db_instance_discard_record(id);
+ cal_db_instance_discard_record(id);
cal_db_util_notify(CAL_NOTI_TYPE_EVENT);
return CALENDAR_ERROR_NONE;
}
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
SECURE("[TEST]---------query[%s]", query_str);
int exception = 0, extended = 0;
ret = calendar_record_create(_calendar_event._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_event_get_stmt(stmt, true, record, &exception, &extended);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_add() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
char *table_name;
if (NULL == query || NULL == out_list) {
+ /* LCOV_EXCL_START */
ERR("Invalid parameter");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
que = (cal_query_s *)query;
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR_ATTENDEE);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(&list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail(%d)", ret);
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
- ERR("calendar_list_create() Fail(%d)", ret);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = calendar_record_create(_calendar_event._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create() Fail(%d)", ret);
calendar_list_destroy(list, true);
if (bind_text) {
g_slist_free_full(bind_text, free);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record, que->projection, que->projection_count, que->property_count);
ret = calendar_list_add(list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_list_add() Fail(%d)", ret);
calendar_list_destroy(list, true);
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
for (i = 0; i < count; i++) {
ret = _cal_db_event_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_event_delete_record() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
int count = 0;
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
CAL_FREE(query_str);
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR_ATTENDEE);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
/* access control */
if (cal_access_control_have_write_permission(event->calendar_id) == false) {
+ /* LCOV_EXCL_START */
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
if (event->common.properties_flags != NULL)
return _cal_db_event_update_dirty(record, -1);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
/*
int ret = 0;
if (NULL == list) {
+ /* LCOV_EXCL_START */
ERR("Invalid argument: list is NULL");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_list_first(list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list first error");
return ret;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = _cal_db_event_replace_record(record, ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_event_replace_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
event->is_allday = sqlite3_column_int(stmt, *stmt_count);
break;
default:
+ /* LCOV_EXCL_START */
ERR("invalid (0x%x)", property);
break;
+ /* LCOV_EXCL_STOP */
}
*stmt_count = *stmt_count+1;
CAL_TABLE_CALENDAR, event->calendar_id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return false;
+ /* LCOV_EXCL_STOP */
}
if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
store_type = sqlite3_column_int(stmt, 0);
} else {
+ /* LCOV_EXCL_START */
+ ERR("Failed to get calendar: calendar_id(%d)", event->calendar_id);
sqlite3_finalize(stmt);
stmt = NULL;
- DBG("Failed to get calendar: calendar_id(%d)", event->calendar_id);
return false;
+ /* LCOV_EXCL_STOP */
}
sqlite3_finalize(stmt);
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id=%d ", CAL_TABLE_SCHEDULE, exception_ids[i]);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
calendar_record_h record = NULL;
int exception = 0, extended = 0;
ret = calendar_record_create(_calendar_event._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create() Fail(%d)", ret);
sqlite3_finalize(stmt);
cal_list_clear(list);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_event_get_stmt(stmt, false, record, &exception, &extended);
CAL_TABLE_SCHEDULE, original_id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
/* insert */
ret = cal_record_set_int(exception, _calendar_event.calendar_book_id, calendar_id);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_record_set_int() Fail(%d)", ret);
if (id_list)
g_list_free(id_list);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_event_insert_record(exception, original_id, NULL);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_event_insert_record() Fail(%d)", ret);
if (id_list)
g_list_free(id_list);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
calendar_list_next(exception_list);
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id=%d ", CAL_TABLE_SCHEDULE, tmp);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_db_util_query_exec() Fail(%d)", ret);
+ /* LCOV_EXCL_START */
+ WARN("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
+ /* LCOV_EXCL_STOP */
}
tmp_list = g_list_next(tmp_list);
}
CAL_TABLE_SCHEDULE, id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
SECURE("query[%s]", query);
sqlite3_finalize(stmt);
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
+ /* LCOV_EXCL_STOP */
}
*book_id = sqlite3_column_int(stmt, 0);
int exception_count = 0;
for (i = 0; i < len1; i++) {
if (NULL == patterns1[i]) {
- ERR("exdate is NULL, so check next");
+ WARN("exdate is NULL, so check next");
continue;
}
bool bFind = false;
for (j = 0; j < len2; j++) {
if (NULL == patterns2[j]) {
- ERR("original exdate is NULL");
+ WARN("original exdate is NULL");
continue;
}
if (CAL_STRING_EQUAL == strcmp(patterns1[i], patterns2[j])) {
);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
- ERR("cal_db_util_query_exec() Fail(%d)", ret);
+ /* LCOV_EXCL_START */
+ WARN("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
+ /* LCOV_EXCL_STOP */
}
int event_id = cal_db_util_last_insert_id();
DBG("last id(%d)", event_id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
RETV_IF(NULL == event, CALENDAR_ERROR_INVALID_PARAMETER);
if (event->start.type != event->end.type) {
+ /* LCOV_EXCL_START */
ERR("normal end(%lld) < start(%lld)",
event->end.time.utime, event->start.time.utime);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
switch (event->start.type) {
case CALENDAR_TIME_UTIME:
if (event->end.time.utime < event->start.time.utime) {
+ /* LCOV_EXCL_START */
ERR("normal end(%lld) < start(%lld) so set same", event->end.time.utime, event->start.time.utime);
event->end.time.utime = event->start.time.utime;
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
case CALENDAR_TIME_LOCALTIME:
/* check invalid value */
if (event->start.time.date.month < 1 || 12 < event->start.time.date.month) {
+ /* LCOV_EXCL_START */
ERR("Error check start month(input:%d)", event->start.time.date.month);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
} else if (event->start.time.date.mday < 1 || 31 < event->start.time.date.mday) {
+ /* LCOV_EXCL_START */
ERR("Error check start mday(input:%d)", event->start.time.date.mday);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
} else if (event->end.time.date.month < 1 || 12 < event->end.time.date.month) {
+ /* LCOV_EXCL_START */
ERR("Error check end month(input:%d)", event->end.time.date.month);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
} else if (event->end.time.date.mday < 1 || 31 < event->end.time.date.mday) {
+ /* LCOV_EXCL_START */
ERR("Error check end mday(input:%d)", event->end.time.date.mday);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
} else {
/* handle hour, minute, second */
if (event->start.time.date.hour < 0 || 24 < event->start.time.date.hour)
if (1 < slli - elli) {
/* 1 is to ignore milliseconds */
+ /* LCOV_EXCL_START */
ERR("allday end(%lld) < start(%lld) so set same", elli, slli);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
break;
}
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return NULL;
+ /* LCOV_EXCL_STOP */
}
GList *l = NULL;
CAL_TABLE_SCHEDULE, parent_id, child_id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return NULL;
+ /* LCOV_EXCL_STOP */
}
char *recurrence_id = NULL;
else if (CAL_STRING_EQUAL == strncmp(param, "THISANDPRIOR", strlen("THISANDPRIOR")))
range = CAL_RECURRENCE_ID_RANGE_THISANDPRIOR;
else
- ERR("Invalid param[%s]", s[i]);
+ WARN("Invalid param[%s]", s[i]);
} else {
- ERR("Invalid param[%s]", s[i]);
+ WARN("Invalid param[%s]", s[i]);
}
}
*out_tzid = tzid;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
CAL_TABLE_NORMAL_INSTANCE, parent_id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
dtstart->type = CALENDAR_TIME_UTIME;
CAL_TABLE_ALLDAY_INSTANCE, parent_id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
char *temp = NULL;
&(dtstart->time.date.year), &(dtstart->time.date.month), &(dtstart->time.date.mday),
&(dtstart->time.date.hour), &(dtstart->time.date.minute), &(dtstart->time.date.second));
} else {
- ERR("datetime is NULL");
+ WARN("datetime is NULL");
}
}
break;
}
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return;
+ /* LCOV_EXCL_STOP */
}
int y = 0, m = 0, d = 0;
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt))
parent_id = sqlite3_column_int64(stmt, 0);
ret = cal_db_event_check_value_validation(event);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_event_check_value_validation() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* access control */
if (cal_access_control_have_write_permission(event->calendar_id) == false) {
+ /* LCOV_EXCL_START */
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_get_int(record, _calendar_event.calendar_book_id, &calendar_book_id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
event_id = cal_db_util_last_insert_id();
int parent_id = 0;
parent_id = __get_parent_id_with_uid(event->uid, event_id);
if (parent_id < 0) {
+ /* LCOV_EXCL_START */
ERR("__get_parent_id_with_uid() Fail");
break;
+ /* LCOV_EXCL_STOP */
}
calendar_record_h parent = NULL;
cal_db_get_record(_calendar_event._uri, parent_id, &parent);
ret = calendar_record_create(_calendar_extended_property._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query), "SELECT * FROM %s WHERE id=%d",
CAL_TABLE_EXTENDED, id);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_record_destroy(*out_record, true);
*out_record = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
calendar_record_destroy(*out_record, true);
*out_record = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_extended_get_stmt(stmt, *out_record);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (extended_info->key)
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
CAL_TABLE_EXTENDED, id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (extended_info->key)
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_extended_property._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_extended_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
CAL_FREE(query_str);
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_extended_property._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record,
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
CAL_FREE(query_str);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
ret = calendar_list_get_count(list, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list get error");
return ret;
+ /* LCOV_EXCL_STOP */
}
id = calloc(1, sizeof(int)*count);
ret = calendar_list_first(list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list first error");
CAL_FREE(id);
return ret;
+ /* LCOV_EXCL_STOP */
}
do {
if (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = _cal_db_extended_insert_record(record, &id[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_extended_insert_record() Fail(%d)", ret);
CAL_FREE(id);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
i++;
ret = calendar_list_first(list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list first error");
return ret;
+ /* LCOV_EXCL_STOP */
}
do {
if (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = _cal_db_extended_update_record(record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_extended_update_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
} while (CALENDAR_ERROR_NO_DATA != calendar_list_next(list));
for (i = 0; i < count; i++) {
ret = _cal_db_extended_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_extended_delete_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
int ret = 0;
if (NULL == list) {
+ /* LCOV_EXCL_START */
ERR("Invalid argument: list is NULL");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_list_first(list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list first error");
return ret;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = _cal_db_extended_replace_record(record, ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_extended_replace_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query, count);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EXTENDED)) {
table_name = cal_strdup(CAL_TABLE_EXTENDED);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query_str, count);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
free(set);
bind_text = NULL;
}
return ret;
+ /* LCOV_EXCL_STOP */
}
if (bind_text) {
bind_text = NULL;
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int count = 0;
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
ret = calendar_record_create(_calendar_extended_property._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
sqlite3_finalize(stmt);
cal_list_clear(list);
return ret;
+ /* LCOV_EXCL_STOP */
}
count = 0;
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (extended->key)
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = cal_db_util_last_insert_id();
CAL_TABLE_SCHEDULE, record_id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
SECURE("[TEST]---------query[%s]", query_str);
calendar_record_h record;
ret = calendar_record_create(_calendar_instance_localtime_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_instance_allday_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_finalize(stmt);
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE_EXTENDED);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_record_create() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record, que->projection, que->projection_count, que->property_count);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_add() Fail(%d)", ret);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
int count = 0;
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
CAL_FREE(query_str);
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE_EXTENDED);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_instance_localtime_calendar_book_extended._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_instance_allday_extended_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_finalize(stmt);
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
+ /* LCOV_EXCL_START */
ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record, que->projection, que->projection_count, que->property_count);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
int count = 0;
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
CAL_FREE(query_str);
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
SECURE("[TEST]---------query[%s]", query_str);
calendar_record_h record;
ret = calendar_record_create(_calendar_instance_utime_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_instance_normal_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_finalize(stmt);
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_NORMAL_INSTANCE_EXTENDED);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
+ /* LCOV_EXCL_START */
ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
}
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record,
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
int count = 0;
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
CAL_FREE(query_str);
return ret;
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_NORMAL_INSTANCE_EXTENDED);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_instance_utime_calendar_book_extended._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_instance_normal_extended_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_finalize(stmt);
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
}
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
int count = 0;
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
CAL_FREE(query_str);
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
ret = cal_db_query_create_condition(query,
&condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
return ret;
+ /* LCOV_EXCL_STOP */
}
}
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
table_name = strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE_EXTENDED);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
CAL_FREE(projection);
CAL_FREE(condition);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
char *query_str = NULL;
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
_cal_db_search_get_projection_stmt(stmt, que->projection, que->projection_count,
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE);
projection = cal_strdup("event_id");
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
CAL_FREE(projection);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Failed");
if (bind_text) {
g_slist_free_full(bind_text, free);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
len += snprintf(out_projection+len, sizeof(out_projection)-len, "%s", field_name);
if (sizeof(out_projection) <= len) {
+ /* LCOV_EXCL_START */
ERR("buf len max");
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
for (i = 1; i < query_s->property_count; i++) {
if (field_name) {
len += snprintf(out_projection+len, sizeof(out_projection)-len, ", %s", field_name);
if (sizeof(out_projection) <= len) {
+ /* LCOV_EXCL_START */
ERR("buf len max");
return CALENDAR_ERROR_SYSTEM;
+ /* LCOV_EXCL_STOP */
}
}
}
CAL_TABLE_TIMEZONE);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_util_stmt_bind_text(stmt, 1, timezone->standard_name);
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = 0;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (timezone->standard_name)
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = cal_db_util_last_insert_id();
ret = calendar_record_create(_calendar_timezone._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query), "SELECT * FROM %s WHERE id = %d AND "
CAL_TABLE_CALENDAR);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_record_destroy(*out_record, true);
*out_record = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Faile%d)", ret);
sqlite3_finalize(stmt);
calendar_record_destroy(*out_record, true);
if (CALENDAR_ERROR_NONE == ret)
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_timezone_get_stmt(stmt, *out_record);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (timezone_info->standard_name)
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id = %d", CAL_TABLE_TIMEZONE, id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (timezone_info->standard_name)
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_timezone._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_timezone_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
CAL_FREE(query_str);
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
ret = calendar_record_create(_calendar_timezone._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record,
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
CAL_FREE(query_str);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
for (i = 0; i < count; i++) {
ret = _cal_db_timezone_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_timezone_delete_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
ret = calendar_list_first(list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list first error");
return ret;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = _cal_db_timezone_replace_record(record, ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_timezone_replace_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query, count);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TIMEZONE)) {
table_name = cal_strdup(CAL_TABLE_TIMEZONE);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("%s=%d", query_str, count);
timezone->calendar_id = sqlite3_column_int(stmt, stmt_count);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid property(0x%x)", property);
break;
+ /* LCOV_EXCL_STOP */
}
return;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
free(set);
bind_text = NULL;
}
return ret;
+ /* LCOV_EXCL_STOP */
}
if (bind_text) {
bind_text = NULL;
}
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
RETV_IF(false == _cal_db_todo_check_calendar_book_type(record), CALENDAR_ERROR_INVALID_PARAMETER);
if (cal_access_control_have_write_permission(todo->calendar_id) == false) {
+ /* LCOV_EXCL_START */
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_record_get_int(record,
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int count = 1;
ret = cal_db_util_stmt_step(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
SECURE("query[%s]", query);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = cal_db_util_last_insert_id();
ret = calendar_record_create(_calendar_todo._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
todo = (cal_todo_s*)(*out_record);
CAL_TABLE_CALENDAR);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
calendar_record_destroy(*out_record, true);
*out_record = NULL;
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
calendar_record_destroy(*out_record, true);
if (CALENDAR_ERROR_NONE == ret)
return CALENDAR_ERROR_DB_RECORD_NOT_FOUND;
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_todo_get_stmt(stmt, false, *out_record, &extended);
RETV_IF(NULL == todo, CALENDAR_ERROR_INVALID_PARAMETER);
if (cal_access_control_have_write_permission(todo->calendar_id) == false) {
+ /* LCOV_EXCL_START */
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
if (todo->common.properties_flags != NULL)
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int count = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_rrule_get_rrule_from_record(record, &rrule);
}
if (cal_access_control_have_write_permission(calendar_book_id) == false) {
+ /* LCOV_EXCL_START */
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
snprintf(query, sizeof(query), "SELECT sync_event FROM %s WHERE id = %d ",
CAL_TABLE_CALENDAR, calendar_book_id);
ret = cal_db_util_query_get_first_int_result(query, NULL, (int *)&sync_event_type);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("sync_event_type(%d)", sync_event_type);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("attendee, alarm and rrule will be deleted by trigger after sync clean");
} else {
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id = %d ", CAL_TABLE_SCHEDULE, id);
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("attendee, alarm and rrule is deleted by trigger");
}
todo->index = id;
if (cal_access_control_have_write_permission(todo->calendar_id) == false) {
+ /* LCOV_EXCL_START */
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
if (todo->common.properties_flags)
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int count = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_db_rrule_get_rrule_from_record(record, &rrule);
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
int extended = 0;
ret = calendar_record_create(_calendar_todo._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
_cal_db_todo_get_stmt(stmt, true, record, &extended);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
sqlite3_finalize(stmt);
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_TODO_CALENDAR);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query_str);
if (bind_text) {
}
free(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
/* bind text */
ret = calendar_list_create(out_list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
+ ERR("calendar_list_create() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
bind_text = NULL;
}
- ERR("calendar_list_create() Fail");
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
int attendee = 1, alarm = 1;
ret = calendar_record_create(_calendar_todo._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (0 < que->projection_count) {
cal_record_set_projection(record,
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_destroy(record, true);
sqlite3_finalize(stmt);
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
for (i = 0; i < count; i++) {
ret = _cal_db_todo_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_todo_delete_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
return CALENDAR_ERROR_NONE;
int count = 0;
ret = cal_db_util_query_get_first_int_result(query_str, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
CAL_FREE(query_str);
int ret = 0;
if (NULL == list) {
+ /* LCOV_EXCL_START */
ERR("Invalid argument: list is NULL");
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
ret = calendar_list_first(list);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("list first error");
return ret;
+ /* LCOV_EXCL_STOP */
}
for (i = 0; i < count; i++) {
if (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(list, &record)) {
ret = _cal_db_todo_replace_record(record, ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_todo_replace_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
}
if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_TODO_CALENDAR);
} else {
+ /* LCOV_EXCL_START */
ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
/* make filter */
if (que->filter) {
ret = cal_db_query_create_condition(query, &condition, &bind_text);
if (CALENDAR_ERROR_NONE != ret) {
- CAL_FREE(table_name);
+ /* LCOV_EXCL_START */
ERR("cal_db_query_create_condition() Fail(%d), ret");
+ CAL_FREE(table_name);
return ret;
+ /* LCOV_EXCL_STOP */
}
}
/* query */
ret = cal_db_util_query_get_first_int_result(query_str, bind_text, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
if (bind_text) {
g_slist_free_full(bind_text, free);
}
CAL_FREE(query_str);
return ret;
+ /* LCOV_EXCL_STOP */
}
DBG("count(%d) str[%s]", count, query_str);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return false;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
return false;
+ /* LCOV_EXCL_STOP */
}
store_type = sqlite3_column_int(stmt, 0);
sqlite3_finalize(stmt);
ret = _cal_db_todo_get_record(todo_id, &original_record);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_todo_get_record() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
cal_record_s *_record = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
*calendar_book_id = sqlite3_column_int(stmt, 0);
ret = _cal_db_query_create_attribute_condition(com_filter, (cal_attribute_filter_s*)filter, &cond, &binds);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_query_create_attribute_condition() Fail(%d)", ret);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
cursor_filter = com_filter->filters->next;
ret = _cal_db_query_create_attribute_condition(com_filter, (cal_attribute_filter_s*)filter, &cond, &binds2);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("_cal_db_query_create_attribute_condition() Fail(%d)", ret);
CAL_FREE(out_cond);
if (binds) {
binds = NULL;
}
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
op = (calendar_filter_operator_e)cursor_ops->data;
ret = _cal_db_query_create_caltime_condition(com_filter, filter, &cond);
break;
default:
+ /* LCOV_EXCL_START */
ERR("The filter type is not supported (%d)", filter->filter_type);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (CALENDAR_ERROR_NONE == ret)
snprintf(out_cond, sizeof(out_cond), "%s <> %d", field_name, filter->value.i);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
*condition = strdup(out_cond);
snprintf(out_cond, sizeof(out_cond), "%s <> %lf", field_name, filter->value.d);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
*condition = strdup(out_cond);
snprintf(out_cond, sizeof(out_cond), "%s <> %lld", field_name, filter->value.lli);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
*condition = strdup(out_cond);
snprintf(out_cond, sizeof(out_cond), "%s <> %lld", tmp, filter->value.caltime.time.utime);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else if (filter->value.caltime.type == CALENDAR_TIME_LOCALTIME) {
char sdate[CAL_STR_SHORT_LEN32] = {0};
break;
case CALENDAR_MATCH_NONE:
default:
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
} else {
+ /* LCOV_EXCL_START */
ERR("Invalid parameter : property id(%d)", filter->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
cal_record_type_e record_type = cal_view_get_type(com_filter->view_uri);
snprintf(out_cond, sizeof(out_cond), "%s IS NOT NULL", field_name);
break;
default:
+ /* LCOV_EXCL_START */
ERR("Invalid paramter : int match rule (%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (filter->value.s) {
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
index = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
rrule_id = cal_db_util_last_insert_id();
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CAL_SQLITE_ROW != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
SECURE("query[%s]", query);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
_rrule = calloc(1, sizeof(cal_rrule_s));
ret = cal_db_util_query_exec(query);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_exec() Fail(%d)", ret);
SECURE("[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() failed");
return ret;
+ /* LCOV_EXCL_STOP */
}
*has_record = 0 < count ? 1 : 0;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
SECURE("query[%s]", query);
return ret;
+ /* LCOV_EXCL_STOP */
}
int index = 1;
ret = cal_db_util_stmt_step(stmt);
sqlite3_finalize(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
close(fd);
event_change = false;
} else {
+ /* LCOV_EXCL_START */
ERR("open() Fail");
+ /* LCOV_EXCL_STOP */
}
}
close(fd);
todo_change = false;
} else {
+ /* LCOV_EXCL_START */
ERR("open() Fail");
+ /* LCOV_EXCL_STOP */
}
}
close(fd);
calendar_change = false;
} else {
+ /* LCOV_EXCL_START */
ERR("open() Fail");
+ /* LCOV_EXCL_STOP */
}
}
calendar_change = true;
break;
default:
+ /* LCOV_EXCL_START */
ERR("The type(%d) is not supported", type);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
_cal_db_util_notify_calendar_change();
break;
default:
+ /* LCOV_EXCL_START */
ERR("The type(%d) is not supported", type);
return CALENDAR_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
int ret = 0;
ret = db_util_open(CAL_DB_FILE, &cal_db, 0);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("db_util_open() Fail(%d).", ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
ret = CALENDAR_ERROR_NONE;
break;
case SQLITE_BUSY:
+ /* LCOV_EXCL_START */
ERR("SQLITE_BUSY");
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
case SQLITE_LOCKED:
+ /* LCOV_EXCL_START */
ERR("SQLITE_LOCKED");
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
default:
+ /* LCOV_EXCL_START */
ERR("ERROR(%d)", ret);
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
ret = CALENDAR_ERROR_NONE;
break;
case SQLITE_BUSY:
+ /* LCOV_EXCL_START */
ERR("SQLITE_BUSY");
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
case SQLITE_LOCKED:
+ /* LCOV_EXCL_START */
ERR("SQLITE_LOCKED");
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
default:
+ /* LCOV_EXCL_START */
ERR("ERROR(%d)", ret);
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
}
return ret;
}
sqlite3_stmt *stmt = NULL;
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_prepare() Fail(%d)", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = cal_db_util_stmt_step(stmt);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_stmt_step() Fail(%d)", ret);
SECURE("query[%s]", query);
sqlite3_finalize(stmt);
return ret;
+ /* LCOV_EXCL_STOP */
}
sqlite3_finalize(stmt);
do {
ret = sqlite3_prepare_v2(cal_db, query, strlen(query), &stmt, NULL);
if (SQLITE_BUSY == ret || SQLITE_LOCKED == ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_prepare_v2() Fail:[%s]", sqlite3_errmsg(cal_db));
SECURE("[%s]", query);
gettimeofday(&now, NULL);
retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ? true : false;
if (retry)
usleep(CAL_QUERY_RETRY_INTERVAL); /* 50ms */
+ /* LCOV_EXCL_STOP */
} else {
retry = false;
}
} while (retry);
if (SQLITE_OK != ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_prepare_v2(%s) Fail(%s).", query, sqlite3_errmsg(cal_db));
SECURE("query[%s]", query);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
if (bind_text) {
do {
ret = sqlite3_step(stmt);
if (SQLITE_BUSY == ret || SQLITE_LOCKED == ret) {
+ /* LCOV_EXCL_START */
ERR("sqlite3_step fail(%d, %s)", ret, sqlite3_errmsg(cal_db));
gettimeofday(&now, NULL);
timersub(&now, &from, &diff);
retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ? true : false;
if (retry)
usleep(CAL_QUERY_RETRY_INTERVAL); /* 50ms */
+ /* LCOV_EXCL_STOP */
} else {
retry = false;
}
ret = CALENDAR_ERROR_NO_DATA;
break;
case SQLITE_BUSY:
+ /* LCOV_EXCL_START */
ERR("SQLITE_BUSY");
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
case SQLITE_LOCKED:
+ /* LCOV_EXCL_START */
ERR("SQLITE_LOCKED");
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
default:
+ /* LCOV_EXCL_START */
ERR("ERROR(%d)", ret);
ret = CALENDAR_ERROR_DB_FAILED;
break;
+ /* LCOV_EXCL_STOP */
}
return CALENDAR_ERROR_NONE;
}
const char *query = "SELECT ver FROM "CAL_TABLE_VERSION;
ret = cal_db_util_query_get_first_int_result(query, NULL, &transaction_ver);
if (CALENDAR_ERROR_NONE != ret) {
+ /* LCOV_EXCL_START */
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
+ /* LCOV_EXCL_STOP */
}
version_up = false;
}
if (CALENDAR_ERROR_NONE != ret) {
int tmp_ret;
+ /* LCOV_EXCL_START */
ERR("cal_query_exec() Fail(%d)", ret);
_cal_db_util_cancel_changes();
tmp_ret = cal_db_util_query_exec("ROLLBACK TRANSACTION");
WARN_IF(CALENDAR_ERROR_NONE != tmp_ret, "cal_query_exec(ROLLBACK) Fail(%d).", tmp_ret);
return CALENDAR_ERROR_DB_FAILED;
+ /* LCOV_EXCL_STOP */
}
if (event_change) _cal_db_util_notify_event_change();
if (todo_change) _cal_db_util_notify_todo_change();