summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcookie <cookie@samsung.com>2018-05-15 15:18:32 +0900
committercookie <cookie@samsung.com>2018-05-15 15:18:32 +0900
commit0fc96eb66914f25c64bf69bce095626597b9d664 (patch)
treee474935335e2c0927a11b69334eea8e2d5b500b4
parent886a0f59965571f4868fc3b5f29863bf8b87c04e (diff)
downloadbrowser-provider-0fc96eb66914f25c64bf69bce095626597b9d664.tar.gz
browser-provider-0fc96eb66914f25c64bf69bce095626597b9d664.tar.bz2
browser-provider-0fc96eb66914f25c64bf69bce095626597b9d664.zip
Change-Id: I989ff9e9aa0bc7488ae36cb944cf9322aca67e2d Signed-off-by: cookie <cookie@samsung.com>
-rwxr-xr-xbookmark-adaptor/bookmark-adaptor.c138
-rwxr-xr-xhistory-adaptor/history-adaptor.c120
-rwxr-xr-xpackaging/browser-provider.spec2
3 files changed, 188 insertions, 72 deletions
diff --git a/bookmark-adaptor/bookmark-adaptor.c b/bookmark-adaptor/bookmark-adaptor.c
index 2a2e378..c301967 100755
--- a/bookmark-adaptor/bookmark-adaptor.c
+++ b/bookmark-adaptor/bookmark-adaptor.c
@@ -46,7 +46,7 @@ static void *__bookmark_adaptor_event_manager(void *arg)
{
int status = bp_common_adaptor_event_manager(arg,
&g_adaptor_noti_cb, &g_adaptor_noti_user_data);
-
+ /* LCOV_EXCL_START */
pthread_mutex_lock(&g_adaptor_mutex);
g_adaptor_event_thread_pid = 0; // set 0 to not call pthread_cancel
if (status >= 0) {
@@ -66,6 +66,7 @@ static void *__bookmark_adaptor_event_manager(void *arg)
}
}
TRACE_DEBUG("callback thread is end by deinit");
+ /* LCOV_EXCL_STOP */
return 0;
}
@@ -89,8 +90,10 @@ int __browser_adaptor_connect(int callback)
if (bp_common_adaptor_connect_to_provider(&g_adaptorinfo,
client_type) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CHECK connection]");
return -1;
+ /* LCOV_EXCL_STOP */
}
}
g_bp_command.cmd = BP_CMD_NONE;
@@ -98,21 +101,23 @@ int __browser_adaptor_connect(int callback)
if (g_adaptorinfo != NULL)
g_bp_command.cid = g_adaptorinfo->cid;
else
- g_bp_command.cid = 0;
+ g_bp_command.cid = 0; //LCOV_EXCL_LINE
if (callback == 1 && g_adaptor_event_thread_pid <= 0) {
// create thread here ( getting event_socket )
if (pthread_create(&g_adaptor_event_thread_pid, NULL,
__bookmark_adaptor_event_manager, g_adaptorinfo) != 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CRITICAL] pthread_create");
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_detach(g_adaptor_event_thread_pid);
TRACE_DEBUG("pthread:%0x", (int)g_adaptor_event_thread_pid);
}
return 0;
}
-
+/* LCOV_EXCL_START */
static int __bp_bookmark_adaptor_get_ids_p(int id, int **ids,
int *count, bp_command_defs cmd)
{
@@ -134,7 +139,7 @@ static int __bp_bookmark_adaptor_get_ids_p(int id, int **ids,
*count = ids_count;
return 0;
}
-
+/* LCOV_EXCL_STOP */
static int __bp_bookmark_adaptor_get_string(const int id,
bp_command_defs cmd, char **value)
{
@@ -148,7 +153,7 @@ static int __bp_bookmark_adaptor_get_string(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_get_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -166,7 +171,7 @@ static int __bp_bookmark_adaptor_get_int(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_get_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -185,7 +190,7 @@ static int __bp_bookmark_adaptor_set_string(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_set_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -203,7 +208,7 @@ static int __bp_bookmark_adaptor_set_int(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_set_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -220,8 +225,10 @@ static int __bp_bookmark_adaptor_send_cmd(const int id, bp_command_defs cmd)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
return -1;
+ /* LCOV_EXCL_STOP */
}
return 0;
}
@@ -257,8 +264,10 @@ int bp_bookmark_adaptor_deinitialize(void)
{
pthread_mutex_lock(&g_adaptor_mutex);
if (__browser_adaptor_connect(0) < 0) {
+ /* LCOV_EXCL_START */
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
int sock = BP_CHECK_IPC_SOCK;
@@ -287,6 +296,7 @@ int bp_bookmark_adaptor_get_root(int *id)
}
// caller should free ids fully
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_full_ids_p(int **ids, int *count)
{
return __bp_bookmark_adaptor_get_ids_p
@@ -324,6 +334,19 @@ int bp_bookmark_adaptor_clear_deleted_ids(void)
(-1, BP_CMD_COMMON_CLEAR_DELETED_IDS);
}
+int bp_bookmark_adaptor_set_sync(const int id, const char *value)
+{
+ return __bp_bookmark_adaptor_set_string
+ (id, BP_CMD_COMMON_SET_SYNC, value);
+}
+
+int bp_bookmark_adaptor_get_sync(const int id, char **value)
+{
+ return __bp_bookmark_adaptor_get_string
+ (id, BP_CMD_COMMON_GET_SYNC, value);
+}
+/* LCOV_EXCL_STOP */
+
int bp_bookmark_adaptor_set_data_changed_cb(
bp_bookmark_adaptor_data_changed_cb callback, void *user_data)
{
@@ -357,9 +380,11 @@ int bp_bookmark_adaptor_is_setted_data_changed_cb(void)
return -1;
}
if (g_adaptor_event_thread_pid <= 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CRITICAL] callback is setted, but event manager not work");
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
@@ -412,15 +437,17 @@ int bp_bookmark_adaptor_create(int *id)
}
bookmark_id = bp_adaptor_ipc_read_int(sock);
if (bookmark_id < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (*id == bookmark_id) {
- TRACE_INFO("created a bookmark:%d", *id);
+ TRACE_INFO("created a bookmark:%d", *id); //LCOV_EXCL_LINE
} else {
*id = bookmark_id;
TRACE_INFO("created new bookmark:%d", *id);
@@ -442,29 +469,29 @@ int bp_bookmark_adaptor_get_errorcode(void)
{
switch (errorcode) {
case BP_ERROR_INVALID_PARAMETER:
- return BP_BOOKMARK_ERROR_INVALID_PARAMETER;
+ return BP_BOOKMARK_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
case BP_ERROR_OUT_OF_MEMORY:
- return BP_BOOKMARK_ERROR_OUT_OF_MEMORY;
+ return BP_BOOKMARK_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
case BP_ERROR_IO_EINTR:
case BP_ERROR_IO_EAGAIN:
case BP_ERROR_IO_ERROR:
- return BP_BOOKMARK_ERROR_IO_ERROR;
+ return BP_BOOKMARK_ERROR_IO_ERROR; //LCOV_EXCL_LINE
case BP_ERROR_NO_DATA:
- return BP_BOOKMARK_ERROR_NO_DATA;
+ return BP_BOOKMARK_ERROR_NO_DATA; //LCOV_EXCL_LINE
case BP_ERROR_ID_NOT_FOUND:
- return BP_BOOKMARK_ERROR_ID_NOT_FOUND;
+ return BP_BOOKMARK_ERROR_ID_NOT_FOUND; //LCOV_EXCL_LINE
case BP_ERROR_DUPLICATED_ID:
- return BP_BOOKMARK_ERROR_DUPLICATED_ID;
+ return BP_BOOKMARK_ERROR_DUPLICATED_ID; //LCOV_EXCL_LINE
case BP_ERROR_PERMISSION_DENY:
- return BP_BOOKMARK_ERROR_PERMISSION_DENY;
+ return BP_BOOKMARK_ERROR_PERMISSION_DENY; //LCOV_EXCL_LINE
case BP_ERROR_DISK_FULL:
- return BP_BOOKMARK_ERROR_DISK_FULL;
+ return BP_BOOKMARK_ERROR_DISK_FULL; //LCOV_EXCL_LINE
case BP_ERROR_DISK_BUSY:
- return BP_BOOKMARK_ERROR_DISK_BUSY;
+ return BP_BOOKMARK_ERROR_DISK_BUSY; //LCOV_EXCL_LINE
case BP_ERROR_TOO_BIG_DATA:
- return BP_BOOKMARK_ERROR_TOO_BIG_DATA;
+ return BP_BOOKMARK_ERROR_TOO_BIG_DATA; //LCOV_EXCL_LINE
case BP_ERROR_UNKNOWN:
- return BP_BOOKMARK_ERROR_UNKNOWN;
+ return BP_BOOKMARK_ERROR_UNKNOWN; //LCOV_EXCL_LINE
default:
break;
}
@@ -476,12 +503,13 @@ int bp_bookmark_adaptor_get_type(const int id, int *value)
return __bp_bookmark_adaptor_get_int
(id, BP_CMD_BOOKMARK_GET_TYPE, value);
}
-
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_parent_id(const int id, int *value)
{
return __bp_bookmark_adaptor_get_int
(id, BP_CMD_BOOKMARK_GET_PARENT, value);
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_get_url(const int id, char **value)
{
@@ -489,6 +517,7 @@ int bp_bookmark_adaptor_get_url(const int id, char **value)
(id, BP_CMD_COMMON_GET_URL, value);
}
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_title(const int id, char **value)
{
return __bp_bookmark_adaptor_get_string
@@ -512,6 +541,7 @@ int bp_bookmark_adaptor_get_is_operator(const int id, int *value)
return __bp_bookmark_adaptor_get_int
(id, BP_CMD_BOOKMARK_GET_IS_OPERATOR, value);
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_get_access_count(const int id, int *value)
{
@@ -561,12 +591,6 @@ int bp_bookmark_adaptor_get_device_id(const int id, char **value)
(id, BP_CMD_COMMON_GET_DEVICE_ID, value);
}
-int bp_bookmark_adaptor_get_sync(const int id, char **value)
-{
- return __bp_bookmark_adaptor_get_string
- (id, BP_CMD_COMMON_GET_SYNC, value);
-}
-
int bp_bookmark_adaptor_set_type(const int id, const int value)
{
return __bp_bookmark_adaptor_set_int
@@ -647,12 +671,6 @@ int bp_bookmark_adaptor_set_device_id(const int id, const char *value)
(id, BP_CMD_COMMON_SET_DEVICE_ID, value);
}
-int bp_bookmark_adaptor_set_sync(const int id, const char *value)
-{
- return __bp_bookmark_adaptor_set_string
- (id, BP_CMD_COMMON_SET_SYNC, value);
-}
-
int bp_bookmark_adaptor_easy_create(int *id, bp_bookmark_info_fmt *info)
{
if (id == NULL || info == NULL)
@@ -664,8 +682,10 @@ int bp_bookmark_adaptor_easy_create(int *id, bp_bookmark_info_fmt *info)
return -1;
}
if (*id <= 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[failed to create new bookmark]");
return -1;
+ /* LCOV_EXCL_STOP */
}
}
@@ -690,20 +710,24 @@ int bp_bookmark_adaptor_easy_create(int *id, bp_bookmark_info_fmt *info)
// send command without waiting return value
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 1. send bp_bookmark_base_fmt structure
if (bp_ipc_send_custom_type(sock, &new_base_info,
sizeof(bp_bookmark_base_fmt)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(*id, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 2. wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
@@ -730,7 +754,7 @@ int bp_bookmark_adaptor_easy_create(int *id, bp_bookmark_info_fmt *info)
if (info->device_id != NULL)
bp_bookmark_adaptor_set_device_id(*id, info->device_id);
if (info->sync != NULL)
- bp_bookmark_adaptor_set_sync(*id, info->sync);
+ bp_bookmark_adaptor_set_sync(*id, info->sync); //LCOV_EXCL_LINE
if (info->favicon_length > 0 && info->favicon != NULL) {
bp_bookmark_adaptor_set_icon(*id, info->favicon_width,
@@ -778,32 +802,38 @@ int bp_bookmark_adaptor_get_info(const int id,
bp_bookmark_offset oflags = offset;
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_bookmark_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(id, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 2. wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_bookmark_base_fmt bookmark;
memset(&bookmark, 0x00, sizeof(bp_bookmark_base_fmt));
// getting bp_tab_base_fmt from provider.
if (bp_ipc_read_custom_type(sock, &bookmark,
sizeof(bp_bookmark_base_fmt)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
memset(info, 0x00, sizeof(bp_bookmark_info_fmt));
@@ -838,42 +868,44 @@ int bp_bookmark_adaptor_get_info(const int id,
// get strings . keep the order with provider
if (offset & BP_BOOKMARK_O_URL) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->url = bp_ipc_read_string(sock);
+ info->url = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_TITLE) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->title = bp_ipc_read_string(sock);
+ info->title = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_ACCOUNT_NAME) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->account_name = bp_ipc_read_string(sock);
+ info->account_name = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_ACCOUNT_TYPE) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->account_type = bp_ipc_read_string(sock);
+ info->account_type = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_DEVICE_NAME) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->device_name = bp_ipc_read_string(sock);
+ info->device_name = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_DEVICE_ID) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->device_id = bp_ipc_read_string(sock);
+ info->device_id = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_SYNC) {
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE)
- info->sync = bp_ipc_read_string(sock);
+ info->sync = bp_ipc_read_string(sock); //LCOV_EXCL_LINE
}
if (offset & BP_BOOKMARK_O_ICON) {
info->favicon_length = 0;
info->favicon_width = bookmark.favicon_width;
info->favicon_height = bookmark.favicon_height;
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
unsigned char *blob_data = NULL;
if ((info->favicon_length =
bp_common_adaptor_get_info_blob(sock, &blob_data,
&g_adaptorinfo->shm)) > 0 && blob_data != NULL)
info->favicon = blob_data;
+ /* LCOV_EXCL_STOP */
}
}
if (offset & BP_BOOKMARK_O_SNAPSHOT) {
@@ -881,11 +913,13 @@ int bp_bookmark_adaptor_get_info(const int id,
info->thumbnail_width = bookmark.thumbnail_width;
info->thumbnail_height = bookmark.thumbnail_height;
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
unsigned char *blob_data = NULL;
if ((info->thumbnail_length =
bp_common_adaptor_get_info_blob(sock, &blob_data,
&g_adaptorinfo->shm)) > 0 && blob_data != NULL)
info->thumbnail = blob_data;
+ /* LCOV_EXCL_STOP */
}
}
if (offset & BP_BOOKMARK_O_WEBICON) {
@@ -893,11 +927,13 @@ int bp_bookmark_adaptor_get_info(const int id,
info->webicon_width = bookmark.webicon_width;
info->webicon_height = bookmark.webicon_height;
if (bp_ipc_read_errorcode(sock) == BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
unsigned char *blob_data = NULL;
if ((info->webicon_length =
bp_common_adaptor_get_info_blob(sock, &blob_data,
&g_adaptorinfo->shm)) > 0 && blob_data != NULL)
info->webicon = blob_data;
+ /* LCOV_EXCL_STOP */
}
}
@@ -979,25 +1015,30 @@ static int __bp_bookmark_adaptor_get_cond_ids_p(
sizeof(bp_bookmark_rows_cond_fmt)) < 0 ||
bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_bookmark_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (oflags > 0) {
if (bp_adaptor_ipc_send_int(sock, is_like) < 0 ||
bp_ipc_send_string(sock, keyword) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
@@ -1007,6 +1048,7 @@ static int __bp_bookmark_adaptor_get_cond_ids_p(
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
// int count.
int ids_count = bp_adaptor_ipc_read_int(sock);
@@ -1014,6 +1056,7 @@ static int __bp_bookmark_adaptor_get_cond_ids_p(
if (ids_count < BP_MAX_IDS_COUNT && ids_count > 0) {
int *idlist = (int *)calloc(ids_count, sizeof(int));
if (idlist == NULL) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_OUT_OF_MEMORY;
BP_PRINT_ERROR(-1, errorcode);
if (bp_common_adaptor_clear_read_buffer(sock,
@@ -1022,10 +1065,12 @@ static int __bp_bookmark_adaptor_get_cond_ids_p(
}
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// getting ids array from provider
if (bp_ipc_read_blob(sock, idlist,
(sizeof(int) * ids_count)) < 0) {
+ /* LCOV_EXCL_START */
free(idlist);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
@@ -1033,17 +1078,21 @@ static int __bp_bookmark_adaptor_get_cond_ids_p(
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
*ids = idlist;
*count = ids_count;
} else {
+ /* LCOV_EXCL_START */
*ids = NULL;
*count = 0;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
}
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_timestamp_ids_p(
int **ids, int *count,
const bp_bookmark_property_cond_fmt *properties, //if NULL, ignore
@@ -1188,6 +1237,7 @@ int bp_bookmark_adaptor_get_timestamp_ids_p(
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_backup(char *value)
{
@@ -1200,7 +1250,7 @@ int bp_bookmark_adaptor_restore(char *value)
return __bp_bookmark_adaptor_set_string
(-1, BP_CMD_BOOKMARK_RESTORE, value);
}
-
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_ids_p(
int **ids, int *count, const int limit, const int offset,
const int parent, const int type,
@@ -1293,6 +1343,7 @@ int bp_bookmark_adaptor_get_ids_p(
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
}
+/* LCOV_EXCL_STOP */
int bp_bookmark_adaptor_get_cond_ids_p(
int **ids, int *count,
@@ -1305,7 +1356,7 @@ int bp_bookmark_adaptor_get_cond_ids_p(
BP_CMD_COMMON_GET_CONDS_DATE_IDS, ids, count, properties,
conds, check_offset, keyword, is_like);
}
-
+/* LCOV_EXCL_START */
int bp_bookmark_adaptor_get_raw_retrieved_ids_p(
int **ids, int *count,
bp_bookmark_property_cond_fmt *properties,
@@ -1317,6 +1368,7 @@ int bp_bookmark_adaptor_get_raw_retrieved_ids_p(
BP_CMD_COMMON_GET_CONDS_RAW_IDS, ids, count, properties,
conds, check_offset, keyword, is_like);
}
+/* LCOV_EXCL_STOP */
//////////////// internet_bookmark_xxx APIs
diff --git a/history-adaptor/history-adaptor.c b/history-adaptor/history-adaptor.c
index 102a5d6..4449b1a 100755
--- a/history-adaptor/history-adaptor.c
+++ b/history-adaptor/history-adaptor.c
@@ -44,7 +44,7 @@ static bp_error_defs errorcode = BP_ERROR_NONE;
static void *__history_adaptor_event_manager(void *arg)
{
int status = bp_common_adaptor_event_manager(arg, NULL, NULL);
-
+ /* LCOV_EXCL_START */
pthread_mutex_lock(&g_adaptor_mutex);
g_adaptor_event_thread_pid = 0; // set 0 to not call pthread_cancel
if (status >= 0) {
@@ -55,7 +55,7 @@ static void *__history_adaptor_event_manager(void *arg)
}
}
pthread_mutex_unlock(&g_adaptor_mutex);
-
+ /* LCOV_EXCL_STOP */
// Todo : the codes for cloud
TRACE_DEBUG("callback thread is end by deinit");
@@ -82,8 +82,10 @@ static int __browser_adaptor_connect(int callback)
if (bp_common_adaptor_connect_to_provider(&g_adaptorinfo,
client_type) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CHECK connection]");
return -1;
+ /* LCOV_EXCL_STOP */
}
}
g_bp_command.cmd = BP_CMD_NONE;
@@ -91,14 +93,16 @@ static int __browser_adaptor_connect(int callback)
if (g_adaptorinfo != NULL)
g_bp_command.cid = g_adaptorinfo->cid;
else
- g_bp_command.cid = 0;
+ g_bp_command.cid = 0; //LCOV_EXCL_LINE
if (callback == 1 && g_adaptor_event_thread_pid <= 0) {
// create thread here ( getting event_socket )
if (pthread_create(&g_adaptor_event_thread_pid, NULL,
__history_adaptor_event_manager, g_adaptorinfo) != 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CRITICAL] pthread_create");
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_detach(g_adaptor_event_thread_pid);
TRACE_DEBUG("pthread:%0x", (int)g_adaptor_event_thread_pid);
@@ -119,7 +123,7 @@ static int __bp_history_adaptor_get_string(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_get_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -137,7 +141,7 @@ static int __bp_history_adaptor_get_int(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_get_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -155,7 +159,7 @@ static int __bp_history_adaptor_set_string(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_set_string(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -173,7 +177,7 @@ static int __bp_history_adaptor_set_int(const int id,
g_bp_command.id = id;
int ret = bp_common_adaptor_set_int(sock, &g_bp_command, value, &errorcode);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -188,15 +192,17 @@ static int __bp_history_adaptor_send_cmd(const int id, bp_command_defs cmd)
g_bp_command.id = id;
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
return -1;
+ /* LCOV_EXCL_STOP */
}
return 0;
}
-
+/* LCOV_EXCL_START */
static int __bp_history_adaptor_get_blob_shm(const int id,
bp_command_defs cmd, int *width, int *height, unsigned char **value,
int *length)
@@ -216,7 +222,7 @@ static int __bp_history_adaptor_get_blob_shm(const int id,
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
-
+/* LCOV_EXCL_STOP */
static int __bp_history_adaptor_set_blob_shm(const int id,
bp_command_defs cmd, const int width, const int height,
const unsigned char *value, const int length)
@@ -232,7 +238,7 @@ static int __bp_history_adaptor_set_blob_shm(const int id,
int ret = bp_common_adaptor_set_blob_shm(sock, &g_bp_command, width,
height, value, length, &errorcode, &g_adaptorinfo->shm);
if (ret < 0 && errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
return ret;
}
@@ -302,20 +308,24 @@ int bp_history_adaptor_create(int *id)
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
history_id = bp_adaptor_ipc_read_int(sock);
if (history_id < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(*id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (*id == history_id) {
TRACE_INFO("created a history:%d", *id);
@@ -331,36 +341,36 @@ int bp_history_adaptor_delete(const int id)
{
if (id < 0)
return -1;
- return __bp_history_adaptor_send_cmd(id, BP_CMD_COMMON_DELETE);
+ return __bp_history_adaptor_send_cmd(id, BP_CMD_COMMON_DELETE); //LCOV_EXCL_LINE
}
int bp_history_adaptor_get_errorcode(void)
{
switch (errorcode) {
case BP_ERROR_INVALID_PARAMETER:
- return BP_HISTORY_ERROR_INVALID_PARAMETER;
+ return BP_HISTORY_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
case BP_ERROR_OUT_OF_MEMORY:
- return BP_HISTORY_ERROR_OUT_OF_MEMORY;
+ return BP_HISTORY_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
case BP_ERROR_IO_EINTR:
case BP_ERROR_IO_EAGAIN:
case BP_ERROR_IO_ERROR:
- return BP_HISTORY_ERROR_IO_ERROR;
+ return BP_HISTORY_ERROR_IO_ERROR; //LCOV_EXCL_LINE
case BP_ERROR_NO_DATA:
- return BP_HISTORY_ERROR_NO_DATA;
+ return BP_HISTORY_ERROR_NO_DATA; //LCOV_EXCL_LINE
case BP_ERROR_ID_NOT_FOUND:
- return BP_HISTORY_ERROR_ID_NOT_FOUND;
+ return BP_HISTORY_ERROR_ID_NOT_FOUND; //LCOV_EXCL_LINE
case BP_ERROR_DUPLICATED_ID:
- return BP_HISTORY_ERROR_DUPLICATED_ID;
+ return BP_HISTORY_ERROR_DUPLICATED_ID; //LCOV_EXCL_LINE
case BP_ERROR_PERMISSION_DENY:
- return BP_HISTORY_ERROR_PERMISSION_DENY;
+ return BP_HISTORY_ERROR_PERMISSION_DENY; //LCOV_EXCL_LINE
case BP_ERROR_DISK_FULL:
- return BP_HISTORY_ERROR_DISK_FULL;
+ return BP_HISTORY_ERROR_DISK_FULL; //LCOV_EXCL_LINE
case BP_ERROR_DISK_BUSY:
- return BP_HISTORY_ERROR_DISK_BUSY;
+ return BP_HISTORY_ERROR_DISK_BUSY; //LCOV_EXCL_LINE
case BP_ERROR_TOO_BIG_DATA:
- return BP_HISTORY_ERROR_TOO_BIG_DATA;
+ return BP_HISTORY_ERROR_TOO_BIG_DATA; //LCOV_EXCL_LINE
case BP_ERROR_UNKNOWN:
- return BP_HISTORY_ERROR_UNKNOWN;
+ return BP_HISTORY_ERROR_UNKNOWN; //LCOV_EXCL_LINE
default:
break;
}
@@ -509,29 +519,35 @@ int bp_history_adaptor_limit_size(
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (bp_ipc_send_custom_type(sock, &conds,
sizeof(bp_db_base_conds_fmt)) < 0 ||
bp_adaptor_ipc_send_int(sock, size) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode == BP_ERROR_IO_ERROR)
- __browser_adaptor_disconnect();
+ __browser_adaptor_disconnect(); //LCOV_EXCL_LINE
pthread_mutex_unlock(&g_adaptor_mutex);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
return -1;
+ /* LCOV_EXCL_STOP */
}
return 0;
}
@@ -543,8 +559,10 @@ int bp_history_adaptor_easy_create(int *id, bp_history_info_fmt *info)
if (*id <= 0) { // new history
if (bp_history_adaptor_create(id) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[failed to create new history]");
return -1;
+ /* LCOV_EXCL_STOP */
}
if (*id <= 0) {
TRACE_ERROR("[failed to create new history]");
@@ -596,36 +614,43 @@ int bp_history_adaptor_get_info(const int id,
// send command without waiting return value
errorcode = bp_ipc_simple_response(sock, &g_bp_command);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 1. oflags
unsigned int oflags = offset;
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_history_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(id, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// 2. wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(id, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_history_info_fmt history;
memset(&history, 0x00, sizeof(bp_history_info_fmt));
// getting bp_tab_base_fmt from provider.
if (bp_ipc_read_custom_type(sock, &history,
sizeof(bp_history_info_fmt)) < 0) {
+ /* LCOV_EXCL_START */
TRACE_ERROR("[CHECK IO] (%d)", id);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(id, errorcode);
@@ -633,6 +658,7 @@ int bp_history_adaptor_get_info(const int id,
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
memset(info, 0x00, sizeof(bp_history_info_fmt));
@@ -732,25 +758,30 @@ int bp_history_adaptor_get_date_count(
errorcode = bp_ipc_simple_response(sock, cmd);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_history_offset oflags = date_column_offset;
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_history_offset)) < 0 ||
bp_adaptor_ipc_send_int(sock, date_type) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
@@ -760,16 +791,19 @@ int bp_history_adaptor_get_date_count(
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
int recv_int = bp_adaptor_ipc_read_int(sock);
TRACE_DEBUG("response ids count:%d", recv_int);
if (recv_int < 0) {
+ /* LCOV_EXCL_START */
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
*count = recv_int;
@@ -799,42 +833,49 @@ static int __bp_history_adaptor_get_cond_ids_p(
if (conds != NULL)
memcpy(&t_conds, conds, sizeof(bp_history_rows_cond_fmt));
else
- t_conds.limit = -1;
+ t_conds.limit = -1; //LCOV_EXCL_LINE
errorcode = bp_ipc_simple_response(sock, cmd);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
bp_history_offset oflags = check_offset;
if (keyword == NULL)
- oflags = 0;
+ oflags = 0; //LCOV_EXCL_LINE
if (bp_ipc_send_custom_type(sock, &t_conds,
sizeof(bp_history_rows_cond_fmt)) < 0 ||
bp_ipc_send_custom_type(sock, &oflags,
sizeof(bp_history_offset)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (oflags > 0) {
if (bp_adaptor_ipc_send_int(sock, is_like) < 0 ||
bp_ipc_send_string(sock, keyword) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
@@ -844,6 +885,7 @@ static int __bp_history_adaptor_get_cond_ids_p(
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
// int count.
int ids_count = bp_adaptor_ipc_read_int(sock);
@@ -851,6 +893,7 @@ static int __bp_history_adaptor_get_cond_ids_p(
if (ids_count < BP_MAX_IDS_COUNT && ids_count > 0) {
int *idlist = (int *)calloc(ids_count, sizeof(int));
if (idlist == NULL) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_OUT_OF_MEMORY;
BP_PRINT_ERROR(-1, errorcode);
if (bp_common_adaptor_clear_read_buffer(sock,
@@ -859,10 +902,12 @@ static int __bp_history_adaptor_get_cond_ids_p(
}
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// getting ids array from provider
if (bp_ipc_read_blob(sock, idlist,
(sizeof(int) * ids_count)) < 0) {
+ /* LCOV_EXCL_START */
free(idlist);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
@@ -870,6 +915,7 @@ static int __bp_history_adaptor_get_cond_ids_p(
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
*ids = idlist;
*count = ids_count;
@@ -906,25 +952,29 @@ int bp_history_adaptor_get_timestamp_ids_p(
if (limits != NULL)
memcpy(&t_limits, limits, sizeof(bp_history_rows_fmt));
else
- t_limits.limit = -1;
+ t_limits.limit = -1; //LCOV_EXCL_LINE
errorcode = bp_ipc_simple_response(sock, cmd);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (bp_ipc_send_custom_type(sock, &t_limits,
sizeof(bp_history_rows_fmt)) < 0 ||
bp_adaptor_ipc_send_int(sock, times_count) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (times_count > 0) {
int i = 0;
@@ -933,39 +983,46 @@ int bp_history_adaptor_get_timestamp_ids_p(
(bp_history_timestamp_fmt *)(times + i);
if (bp_ipc_send_custom_type(sock, timestamps,
sizeof(bp_history_timestamp_fmt)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
}
unsigned int oflags = check_offset;
if (keyword == NULL)
- oflags = 0;
+ oflags = 0; //LCOV_EXCL_LINE
if (bp_ipc_send_custom_type(sock, &oflags,
sizeof(unsigned int)) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
if (oflags > 0) {
if (bp_adaptor_ipc_send_int(sock, is_like) < 0 ||
bp_ipc_send_string(sock, keyword) < 0) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_IO_ERROR;
BP_PRINT_ERROR(-1, errorcode);
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
}
// wait id from provider.
errorcode = bp_ipc_read_errorcode(sock);
if (errorcode != BP_ERROR_NONE) {
+ /* LCOV_EXCL_START */
BP_PRINT_ERROR(-1, errorcode);
if (errorcode == BP_ERROR_IO_ERROR)
__browser_adaptor_disconnect();
@@ -975,6 +1032,7 @@ int bp_history_adaptor_get_timestamp_ids_p(
return 0;
}
return -1;
+ /* LCOV_EXCL_STOP */
}
// int count.
int ids_count = bp_adaptor_ipc_read_int(sock);
@@ -982,6 +1040,7 @@ int bp_history_adaptor_get_timestamp_ids_p(
if (ids_count < BP_MAX_IDS_COUNT && ids_count > 0) {
int *idlist = (int *)calloc(ids_count, sizeof(int));
if (idlist == NULL) {
+ /* LCOV_EXCL_START */
errorcode = BP_ERROR_OUT_OF_MEMORY;
BP_PRINT_ERROR(-1, errorcode);
if (bp_common_adaptor_clear_read_buffer(sock,
@@ -990,10 +1049,12 @@ int bp_history_adaptor_get_timestamp_ids_p(
}
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
// getting ids array from provider
if (bp_ipc_read_blob(sock, idlist,
(sizeof(int) * ids_count)) < 0) {
+ /* LCOV_EXCL_START */
free(idlist);
errorcode = bp_ipc_check_stderr(BP_ERROR_IO_ERROR);
BP_PRINT_ERROR(-1, errorcode);
@@ -1001,12 +1062,15 @@ int bp_history_adaptor_get_timestamp_ids_p(
__browser_adaptor_disconnect();
pthread_mutex_unlock(&g_adaptor_mutex);
return -1;
+ /* LCOV_EXCL_STOP */
}
*ids = idlist;
*count = ids_count;
} else {
+ /* LCOV_EXCL_START */
*ids = NULL;
*count = 0;
+ /* LCOV_EXCL_STOP */
}
pthread_mutex_unlock(&g_adaptor_mutex);
return 0;
diff --git a/packaging/browser-provider.spec b/packaging/browser-provider.spec
index 794108c..54d9bed 100755
--- a/packaging/browser-provider.spec
+++ b/packaging/browser-provider.spec
@@ -1,7 +1,7 @@
Name: browser-provider
Summary: sync in background.
-Version: 1.8.5
+Version: 1.8.6
Release: 1
Group: Development/Libraries
License: Apache-2.0