summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-06-17 17:13:41 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2016-06-17 17:13:41 +0900
commit5cf7ab5cd2a0135c432589aa0e27a04c24e9d23e (patch)
tree27327f01e03914382d99b0011966f3217c996307
parent8943e9872a2d1fcf67d81ba05614a10e77d1962b (diff)
downloadminicontrol-5cf7ab5cd2a0135c432589aa0e27a04c24e9d23e.tar.gz
minicontrol-5cf7ab5cd2a0135c432589aa0e27a04c24e9d23e.tar.bz2
minicontrol-5cf7ab5cd2a0135c432589aa0e27a04c24e9d23e.zip
Change-Id: I487c898dd695b8cb2b7fbac675ff30ef117f1223 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rwxr-xr-xsrc/minicontrol-internal.c22
-rwxr-xr-xsrc/minicontrol-monitor.c8
-rwxr-xr-xsrc/minicontrol-provider.c28
-rwxr-xr-xsrc/minicontrol-viewer.c16
4 files changed, 74 insertions, 0 deletions
diff --git a/src/minicontrol-internal.c b/src/minicontrol-internal.c
index 1c31840..e6ac2dc 100755
--- a/src/minicontrol-internal.c
+++ b/src/minicontrol-internal.c
@@ -50,18 +50,22 @@ static int __send_signal(const char *object_path, const char *interface_name,
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (conn == NULL) {
+ /* LCOV_EXCL_START */
ERR("g_bus_get_sync() failed. %s", err->message);
g_error_free(err);
return MINICONTROL_ERROR_IPC_FAILURE;
+ /* LCOV_EXCL_STOP */
}
ret = g_dbus_connection_emit_signal(conn, NULL, object_path,
interface_name, signal_name, parameters, &err);
if (!ret) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_connection_emit_signal() failed. %s", err->message);
g_error_free(err);
g_object_unref(conn);
return MINICONTROL_ERROR_IPC_FAILURE;
+ /* LCOV_EXCL_STOP */
}
g_dbus_connection_flush_sync(conn, NULL, &err);
@@ -95,8 +99,10 @@ int _minictrl_provider_proc_send(int type)
param = g_variant_new("(si)", type_str, pid);
if (param == NULL) {
+ /* LCOV_EXCL_START */
ERR("out of memory");
return MINICONTROL_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ret = __send_signal(PROC_DBUS_OBJECT, PROC_DBUS_INTERFACE,
@@ -122,14 +128,18 @@ int _minictrl_send_event(const char *signal_name, const char *minicontrol_name,
ret = bundle_encode(signal_arg, &serialized_arg,
(int *)&serialized_arg_length);
if (ret != BUNDLE_ERROR_NONE) {
+ /* LCOV_EXCL_START */
ERR("Failed to serialize bundle argument");
return MINICONTROL_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
} else {
serialized_arg = (bundle_raw *)strdup("");
if (serialized_arg == NULL) {
+ /* LCOV_EXCL_START */
ERR("out of memory");
return MINICONTROL_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
serialized_arg_length = 0;
}
@@ -137,9 +147,11 @@ int _minictrl_send_event(const char *signal_name, const char *minicontrol_name,
param = g_variant_new("(sisu)", minicontrol_name, event,
serialized_arg, serialized_arg_length);
if (param == NULL) {
+ /* LCOV_EXCL_START */
ERR("out of memory");
free(serialized_arg);
return MINICONTROL_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ret = __send_signal(MINICTRL_DBUS_PATH, MINICTRL_DBUS_INTERFACE,
@@ -160,8 +172,10 @@ int _minictrl_provider_message_send(int event, const char *minicontrol_name,
event_arg_bundle = bundle_create();
if (event_arg_bundle == NULL) {
+ /* LCOV_EXCL_START */
ERR("Fail to create a bundle instance");
return MINICONTROL_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
snprintf(bundle_value_buffer, sizeof(bundle_value_buffer),
@@ -210,16 +224,20 @@ minictrl_sig_handle *_minictrl_dbus_sig_handle_attach(const char *signal,
handle = (minictrl_sig_handle *)malloc(sizeof(minictrl_sig_handle));
if (handle == NULL) {
+ /* LCOV_EXCL_START */
ERR("out of memory");
return NULL;
+ /* LCOV_EXCL_STOP */
}
handle->conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (handle->conn == NULL) {
+ /* LCOV_EXCL_START */
ERR("g_bus_get_sync() failed. %s", err->message);
g_error_free(err);
free(handle);
return NULL;
+ /* LCOV_EXCL_STOP */
}
handle->s_id = g_dbus_connection_signal_subscribe(handle->conn,
@@ -227,10 +245,12 @@ minictrl_sig_handle *_minictrl_dbus_sig_handle_attach(const char *signal,
MINICTRL_DBUS_PATH, NULL, G_DBUS_SIGNAL_FLAGS_NONE,
__minictrl_signal_filter, handle, NULL);
if (handle->s_id == 0) {
+ /* LCOV_EXCL_START */
ERR("g_dbus_connection_signal_subscribe() failed.");
g_object_unref(handle->conn);
free(handle);
return NULL;
+ /* LCOV_EXCL_STOP */
}
handle->callback = callback;
@@ -246,8 +266,10 @@ minictrl_sig_handle *_minictrl_dbus_sig_handle_attach(const char *signal,
void _minictrl_dbus_sig_handle_dettach(minictrl_sig_handle *handle)
{
if (!handle) {
+ /* LCOV_EXCL_START */
ERR("handle is NULL");
return;
+ /* LCOV_EXCL_STOP */
}
g_dbus_connection_signal_unsubscribe(handle->conn, handle->s_id);
diff --git a/src/minicontrol-monitor.c b/src/minicontrol-monitor.c
index 67df885..0767508 100755
--- a/src/minicontrol-monitor.c
+++ b/src/minicontrol-monitor.c
@@ -30,6 +30,7 @@ struct _minicontrol_monitor {
static struct _minicontrol_monitor *g_monitor_h;
+/* LCOV_EXCL_START */
static minicontrol_priority_e _int_to_priority(unsigned int value)
{
minicontrol_priority_e priority;
@@ -48,7 +49,9 @@ static minicontrol_priority_e _int_to_priority(unsigned int value)
return priority;
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void _sig_to_viewer_handler_cb(minicontrol_event_e event,
const char *minicontrol_name, bundle *event_arg, void *data)
{
@@ -94,7 +97,9 @@ static void _sig_to_viewer_handler_cb(minicontrol_event_e event,
g_monitor_h->callback(action, minicontrol_name, width, height,
priority, g_monitor_h->user_data);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
EXPORT_API minicontrol_error_e minicontrol_monitor_start(
minicontrol_monitor_cb callback, void *data)
{
@@ -121,7 +126,9 @@ EXPORT_API minicontrol_error_e minicontrol_monitor_start(
return _minictrl_viewer_req_message_send();
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
EXPORT_API minicontrol_error_e minicontrol_monitor_stop(void)
{
if (!g_monitor_h)
@@ -134,4 +141,5 @@ EXPORT_API minicontrol_error_e minicontrol_monitor_stop(void)
return MINICONTROL_ERROR_NONE;
}
+/* LCOV_EXCL_STOP */
diff --git a/src/minicontrol-provider.c b/src/minicontrol-provider.c
index 886e38c..fdc7a4a 100755
--- a/src/minicontrol-provider.c
+++ b/src/minicontrol-provider.c
@@ -137,8 +137,10 @@ static char *_minictrl_create_name(const char *name)
size = strlen(name) + 3;
minictrl_name = malloc(sizeof(char) * size);
if (minictrl_name == NULL) {
+ /* LCOV_EXCL_START */
ERR("out of memory");
return NULL;
+ /* LCOV_EXCL_STOP */
}
snprintf(minictrl_name, size, "[%s]", name);
@@ -163,35 +165,43 @@ EXPORT_API Evas_Object *minicontrol_create_window(const char *name,
win = elm_win_add(NULL, "minicontrol", ELM_WIN_SOCKET_IMAGE);
if (!win) {
+ /* LCOV_EXCL_START */
ERR("elm_win_add failed");
set_last_result(MINICONTROL_ERROR_ELM_FAILURE);
return NULL;
+ /* LCOV_EXCL_STOP */
}
name_inter = _minictrl_create_name(name);
if (!name_inter) {
+ /* LCOV_EXCL_START */
ERR("Fail to create name_inter for : %s", name);
set_last_result(MINICONTROL_ERROR_OUT_OF_MEMORY);
evas_object_del(win);
return NULL;
+ /* LCOV_EXCL_STOP */
}
err_from_elm = elm_win_socket_listen(win, name_inter, 0, EINA_TRUE);
if (!err_from_elm) {
+ /* LCOV_EXCL_START */
ERR("Fail to elm win socket listen [%d]", err_from_elm);
set_last_result(MINICONTROL_ERROR_ELM_FAILURE);
evas_object_del(win);
free(name_inter);
return NULL;
+ /* LCOV_EXCL_STOP */
}
pd = malloc(sizeof(struct _minicontrol_provider));
if (!pd) {
+ /* LCOV_EXCL_START */
ERR("Fail to alloc memory");
set_last_result(MINICONTROL_ERROR_OUT_OF_MEMORY);
evas_object_del(win);
free(name_inter);
return NULL;
+ /* LCOV_EXCL_STOP */
}
memset(pd, 0x00, sizeof(struct _minicontrol_provider));
@@ -236,13 +246,17 @@ EXPORT_API int minicontrol_send_event(Evas_Object *mincontrol,
pd = evas_object_data_get(mincontrol, MINICTRL_DATA_KEY);
if (!pd) {
+ /* LCOV_EXCL_START */
ERR("pd is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (!pd->name) {
+ /* LCOV_EXCL_START */
ERR("pd name is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (pd->state == MINICTRL_STATE_RUNNING) {
@@ -267,13 +281,17 @@ static int minicontrol_win_start(Evas_Object *mincontrol)
pd = evas_object_data_get(mincontrol, MINICTRL_DATA_KEY);
if (!pd) {
+ /* LCOV_EXCL_START */
ERR("pd is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (!pd->name) {
+ /* LCOV_EXCL_START */
ERR("pd name is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (pd->state != MINICTRL_STATE_RUNNING) {
@@ -293,19 +311,25 @@ static int minicontrol_win_stop(Evas_Object *mincontrol)
int ret = MINICONTROL_ERROR_NONE;
if (!mincontrol) {
+ /* LCOV_EXCL_START */
ERR("mincontrol is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
pd = evas_object_data_get(mincontrol, MINICTRL_DATA_KEY);
if (!pd) {
+ /* LCOV_EXCL_START */
ERR("pd is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (!pd->name) {
+ /* LCOV_EXCL_START */
ERR("pd name is NULL, invaild parameter");
return MINICONTROL_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
}
if (pd->state != MINICTRL_STATE_READY) {
@@ -362,6 +386,7 @@ static void _minictrl_win_resize_cb(void *data, Evas *e,
}
}
+/* LCOV_EXCL_START */
EXPORT_API Evas_Object *minicontrol_win_add(const char *name)
{
Evas_Object *win = NULL;
@@ -429,7 +454,9 @@ EXPORT_API Evas_Object *minicontrol_win_add(const char *name)
return win;
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
EXPORT_API int minicontrol_request(Evas_Object *mincontrol,
minicontrol_request_e request)
{
@@ -477,4 +504,5 @@ EXPORT_API int minicontrol_request(Evas_Object *mincontrol,
return MINICONTROL_ERROR_NONE;
}
+/* LCOV_EXCL_STOP */
diff --git a/src/minicontrol-viewer.c b/src/minicontrol-viewer.c
index 47200c3..a3a5ed7 100755
--- a/src/minicontrol-viewer.c
+++ b/src/minicontrol-viewer.c
@@ -64,8 +64,10 @@ static void _sig_to_viewer_handler_cb(void *data, GVariant *parameters)
event_arg_bundle = bundle_decode(serialized_arg,
serialized_arg_length);
if (event_arg_bundle == NULL) {
+ /* LCOV_EXCL_START */
ERR("fail to deserialize arguments");
return;
+ /* LCOV_EXCL_STOP */
}
}
@@ -97,17 +99,21 @@ EXPORT_API int minicontrol_viewer_set_event_cb(
MINICTRL_DBUS_SIG_TO_VIEWER,
_sig_to_viewer_handler_cb, NULL);
if (!event_sh) {
+ /* LCOV_EXCL_START */
ERR("fail to _minictrl_dbus_sig_handle_attach - %s",
MINICTRL_DBUS_SIG_TO_VIEWER);
return MINICONTROL_ERROR_IPC_FAILURE;
+ /* LCOV_EXCL_STOP */
}
minicontrol_viewer_h =
malloc(sizeof(struct _minicontrol_viewer));
if (!minicontrol_viewer_h) {
+ /* LCOV_EXCL_START */
ERR("fail to alloc minicontrol_viewer_h");
_minictrl_dbus_sig_handle_dettach(event_sh);
return MINICONTROL_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
minicontrol_viewer_h->event_sh = event_sh;
@@ -137,6 +143,7 @@ EXPORT_API int minicontrol_viewer_unset_event_cb(void)
return MINICONTROL_ERROR_NONE;
}
+/* LCOV_EXCL_START */
static void _minictrl_plug_server_del(Ecore_Evas *ee)
{
char *minicontrol_name = NULL;
@@ -161,6 +168,7 @@ static void _minictrl_plug_server_del(Ecore_Evas *ee)
_minictrl_provider_proc_send(MINICONTROL_DBUS_PROC_INCLUDE);
free(minicontrol_name);
}
+/* LCOV_EXCL_STOP */
static void _minictrl_plug_del(void *data, Evas *e, Evas_Object *obj,
void *event_info)
@@ -197,16 +205,20 @@ EXPORT_API Evas_Object *minicontrol_viewer_add(Evas_Object *parent,
plug = elm_plug_add(parent);
if (!plug) {
+ /* LCOV_EXCL_START */
ERR("fail to create plug");
set_last_result(MINICONTROL_ERROR_ELM_FAILURE);
return NULL;
+ /* LCOV_EXCL_STOP */
}
if (!elm_plug_connect(plug, minicontrol_name, 0, EINA_TRUE)) {
+ /* LCOV_EXCL_START */
ERR("Cannot connect plug[%s]", minicontrol_name);
set_last_result(MINICONTROL_ERROR_ELM_FAILURE);
evas_object_del(plug);
return NULL;
+ /* LCOV_EXCL_STOP */
}
plug_img = elm_plug_image_object_get(plug);
@@ -222,12 +234,15 @@ EXPORT_API Evas_Object *minicontrol_viewer_add(Evas_Object *parent,
return plug;
}
+/* LCOV_EXCL_START */
EXPORT_API Evas_Object *minicontrol_viewer_image_object_get(
const Evas_Object *obj)
{
return elm_plug_image_object_get(obj);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
EXPORT_API int minicontrol_viewer_request(const char *minicontrol_name,
minicontrol_request_e request, int value)
{
@@ -257,4 +272,5 @@ EXPORT_API int minicontrol_viewer_request(const char *minicontrol_name,
return MINICONTROL_ERROR_NONE;
}
+/* LCOV_EXCL_STOP */