summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpr.jung <pr.jung@samsung.com>2017-01-12 17:11:20 +0900
committerpr.jung <pr.jung@samsung.com>2017-01-12 17:56:22 +0900
commit27fbcdc2ad8f57946c4d3056ab68214a19f5b455 (patch)
tree64155915d624a741e25958b1888d4d8f5f31d342
parent4d9738a5878cda6130fd059479aa3cedabaead3b (diff)
downloadlibsvi-tizen_3.0_tv.tar.gz
libsvi-tizen_3.0_tv.tar.bz2
libsvi-tizen_3.0_tv.zip
Change-Id: Ifc64ee7fbbba58dfdbbce460c02e65d125585c75 Signed-off-by: pr.jung <pr.jung@samsung.com>
-rw-r--r--src/dbus.c16
-rw-r--r--src/feedback.c6
-rw-r--r--src/sound.c4
-rw-r--r--src/vibrator.c6
4 files changed, 24 insertions, 8 deletions
diff --git a/src/dbus.c b/src/dbus.c
index 213a2b5..6f6021c 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -151,6 +151,7 @@ static struct proxy_node *find_matched_proxy_node(const char *dest,
return NULL;
}
+//LCOV_EXCL_START Not called Callback
static void on_name_vanished(GDBusConnection *connection,
const gchar *name,
gpointer user_data)
@@ -174,6 +175,7 @@ static void on_name_vanished(GDBusConnection *connection,
}
pthread_mutex_unlock(&dmutex);
}
+//LCOV_EXCL_STOP
static GDBusConnection *get_dbus_connection(void)
{
@@ -182,11 +184,13 @@ static GDBusConnection *get_dbus_connection(void)
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (!conn) {
+ //LCOV_EXCL_START System Error
if (err)
_D("Fail to get dbus connection: %s", err->message);
else
_D("Fail to get dbus connection");
return NULL;
+ //LCOV_EXCL_STOP
}
return conn;
@@ -242,12 +246,14 @@ static GDBusProxy *get_proxy_from_proxy_pool(const char *dest,
node = malloc(sizeof(struct proxy_node));
if (!node) {
+ //LCOV_EXCL_START System Error
g_object_unref(proxy);
if (err)
g_set_error(err, G_IO_ERROR,
G_IO_ERROR_FAILED,
"Cannot allocate proxy_node memory");
return NULL;
+ //LCOV_EXCL_STOP
}
node->proxy = proxy;
@@ -277,8 +283,8 @@ int dbus_method_sync(const char *dest, const char *path,
proxy = get_proxy_from_proxy_pool(dest, path, interface, &err);
if (!proxy) {
pthread_mutex_unlock(&dmutex);
- _E("fail to get proxy from proxy pool : %s-%s (%d-%s)",
- interface, method, err->code, err->message);
+ _E("fail to get proxy from proxy pool : %s-%s (%d-%s)", //LCOV_EXCL_LINE
+ interface, method, err->code, err->message); //LCOV_EXCL_LINE
result = g_dbus_error_to_errno(err->code);
g_clear_error(&err);
return result;
@@ -294,6 +300,7 @@ int dbus_method_sync(const char *dest, const char *path,
pthread_mutex_unlock(&dmutex);
if (!output) {
+ //LCOV_EXCL_START System Error
if (err) {
_E("g_dbus_proxy_call_sync error : %s-%s (%d-%s)",
interface, method, err->code, err->message);
@@ -305,6 +312,7 @@ int dbus_method_sync(const char *dest, const char *path,
result = -ECOMM;
}
return result;
+ //LCOV_EXCL_STOP
}
/* get output value */
@@ -315,6 +323,7 @@ int dbus_method_sync(const char *dest, const char *path,
return result;
}
+//LCOV_EXCL_START Not called Callback
static void feedback_signal_callback(GDBusConnection *conn,
const gchar *sender,
const gchar *path,
@@ -348,6 +357,7 @@ static void feedback_signal_callback(GDBusConnection *conn,
_E("Failed to call restart callback");
}
}
+//LCOV_EXCL_STOP
int register_signal_handler(feedback_restart_cb func)
{
@@ -393,9 +403,11 @@ int register_signal_handler(feedback_restart_cb func)
NULL,
NULL);
if (feedback_id == 0) {
+ //LCOV_EXCL_START System Error
free(callback);
_E("Failed to subscrive bus signal");
return -EPERM;
+ //LCOV_EXCL_STOP
}
callback->func = func;
diff --git a/src/feedback.c b/src/feedback.c
index f0ebded..c2ee8b9 100644
--- a/src/feedback.c
+++ b/src/feedback.c
@@ -34,6 +34,7 @@
static unsigned int init_cnt;
static pthread_mutex_t fmutex = PTHREAD_MUTEX_INITIALIZER;
+//LCOV_EXCL_START Not called Callback
static int restart_callback()
{
const struct device_ops *dev;
@@ -43,6 +44,7 @@ static int restart_callback()
dev->init();
return 0;
}
+//LCOV_EXCL_STOP
API int feedback_initialize(void)
{
@@ -62,7 +64,7 @@ API int feedback_initialize(void)
ret = register_signal_handler(restart_callback);
if (ret < 0)
- _E("Fail to register signal handler: %d", ret);
+ _E("Fail to register signal handler: %d", ret); //LCOV_EXCL_LINE
/* initialize device */
devices_init();
@@ -92,7 +94,7 @@ API int feedback_deinitialize(void)
ret = unregister_signal_handler(restart_callback);
if (ret < 0)
- _E("Fail to unregister signal handler: %d", ret);
+ _E("Fail to unregister signal handler: %d", ret); //LCOV_EXCL_LINE
/* deinitialize device */
devices_exit();
diff --git a/src/sound.c b/src/sound.c
index f2e107c..0aee61c 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -105,7 +105,7 @@ static void sound_init(void)
if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
_D("fail to get sound status, will work as turning off"); //LCOV_EXCL_LINE
- sndstatus = 0;
+ sndstatus = 0; //LCOV_EXCL_LINE System Error
}
/* add watch for status value */
@@ -132,7 +132,7 @@ static int sound_play(feedback_pattern_e pattern)
if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
_D("fail to get sound status, will work as turning off"); //LCOV_EXCL_LINE
- sndstatus = 0;
+ sndstatus = 0; //LCOV_EXCL_LINE System Error
}
if (sndstatus == 0 && profile->get_always_alert_case &&
diff --git a/src/vibrator.c b/src/vibrator.c
index aa0eeaf..b9cfee8 100644
--- a/src/vibrator.c
+++ b/src/vibrator.c
@@ -247,7 +247,7 @@ static int vibrator_play(feedback_pattern_e pattern)
if (ret < 0) {
_E("fail to play vibration"); //LCOV_EXCL_LINE
free(temp);
- if (ret == -ECOMM || ret == -ENOTSUP)
+ if (ret == -ECOMM || ret == -ENOTSUP) //LCOV_EXCL_LINE System Error
return ret; //LCOV_EXCL_LINE System Error
return -EPERM;
}
@@ -274,7 +274,7 @@ static int vibrator_stop(void)
ret = haptic_vibrate_stop(v_handle);
if (ret < 0) {
_E("haptic_vibrate_stop is failed"); //LCOV_EXCL_LINE
- if (ret == -ECOMM)
+ if (ret == -ECOMM) //LCOV_EXCL_LINE System Error
return ret; //LCOV_EXCL_LINE System Error
return -EPERM;
}
@@ -333,6 +333,7 @@ static int vibrator_is_supported(int pattern, bool *supported)
return 0;
}
+//LCOV_EXCL_START Not supported feature
static int vibrator_get_path(feedback_pattern_e pattern, char *buf, unsigned int buflen)
{
return 0;
@@ -342,6 +343,7 @@ static int vibrator_set_path(feedback_pattern_e pattern, char *path)
{
return 0;
}
+//LCOV_EXCL_STOP
static const struct device_ops vibrator_device_ops = {
.type = FEEDBACK_TYPE_VIBRATION,