add excluding coverage comments for tdm_display.c 85/161085/1
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Tue, 21 Nov 2017 10:26:17 +0000 (12:26 +0200)
committerKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Tue, 21 Nov 2017 10:26:17 +0000 (12:26 +0200)
add excluding coverage comments for tdm_display.c for folowing code:
- fail if there is not capability;
- poll fail.

Change-Id: I02b2bcb11058adc148057fd9a5e5d638751eab15
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
src/tdm_display.c

index 0e3aadc63b4f3659839b01b06fcf1df5230aaf9e..1f1caec2242d46b9dacf7d3a0cf9d8bd6a16ae60 100644 (file)
@@ -84,9 +84,11 @@ tdm_display_get_pp_capabilities(tdm_display *dpy,
        _pthread_mutex_lock(&private_display->lock);
 
        if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_PP)) {
+               /* LCOV_EXCL_START */
                TDM_ERR("no pp capability");
                _pthread_mutex_unlock(&private_display->lock);
                return TDM_ERROR_NO_CAPABILITY;
+               /* LCOV_EXCL_STOP */
        }
 
        *capabilities = private_display->caps_pp.capabilities;
@@ -108,9 +110,11 @@ tdm_display_get_pp_available_formats(tdm_display *dpy,
        _pthread_mutex_lock(&private_display->lock);
 
        if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_PP)) {
+               /* LCOV_EXCL_START */
                TDM_ERR("no pp capability");
                _pthread_mutex_unlock(&private_display->lock);
                return TDM_ERROR_NO_CAPABILITY;
+               /* LCOV_EXCL_STOP */
        }
 
        *formats = (const tbm_format *)private_display->caps_pp.formats;
@@ -130,9 +134,11 @@ tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h,
        _pthread_mutex_lock(&private_display->lock);
 
        if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_PP)) {
+               /* LCOV_EXCL_START */
                TDM_ERR("no pp capability");
                _pthread_mutex_unlock(&private_display->lock);
                return TDM_ERROR_NO_CAPABILITY;
+               /* LCOV_EXCL_STOP */
        }
 
        if (min_w)
@@ -162,9 +168,11 @@ tdm_display_get_capture_capabilities(tdm_display *dpy,
        _pthread_mutex_lock(&private_display->lock);
 
        if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_CAPTURE)) {
+               /* LCOV_EXCL_START */
                TDM_ERR("no capture capability");
                _pthread_mutex_unlock(&private_display->lock);
                return TDM_ERROR_NO_CAPABILITY;
+               /* LCOV_EXCL_STOP */
        }
 
        *capabilities = private_display->caps_capture.capabilities;
@@ -186,9 +194,11 @@ tdm_display_get_catpure_available_formats(tdm_display *dpy,
        _pthread_mutex_lock(&private_display->lock);
 
        if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_CAPTURE)) {
+               /* LCOV_EXCL_START */
                TDM_ERR("no capture capability");
                _pthread_mutex_unlock(&private_display->lock);
                return TDM_ERROR_NO_CAPABILITY;
+               /* LCOV_EXCL_STOP */
        }
 
        *formats = (const tbm_format *)private_display->caps_capture.formats;
@@ -208,9 +218,11 @@ tdm_display_get_capture_available_size(tdm_display *dpy, int *min_w, int *min_h,
        _pthread_mutex_lock(&private_display->lock);
 
        if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_CAPTURE)) {
+               /* LCOV_EXCL_START */
                TDM_ERR("no capture capability");
                _pthread_mutex_unlock(&private_display->lock);
                return TDM_ERROR_NO_CAPABILITY;
+               /* LCOV_EXCL_STOP */
        }
 
        if (min_w)
@@ -261,8 +273,10 @@ tdm_display_get_output_count(tdm_display *dpy, int *count)
        (*count)++;
 
        if (*count == 0) {
+               /* LCOV_EXCL_START */
                _pthread_mutex_unlock(&private_display->lock);
                return TDM_ERROR_NONE;
+               /* LCOV_EXCL_STOP */
        }
 
        _pthread_mutex_unlock(&private_display->lock);
@@ -333,12 +347,14 @@ tdm_display_handle_events(tdm_display *dpy)
                TDM_INFO("fd(%d) polling in", fd);
 
        while (poll(&fds, 1, -1) < 0) {
+               /* LCOV_EXCL_START */
                if (errno == EINTR || errno == EAGAIN)  /* normal case */
                        continue;
                else {
                        TDM_ERR("poll failed: %m");
                        return TDM_ERROR_OPERATION_FAILED;
                }
+               /* LCOV_EXCL_STOP */
        }
 
        if (tdm_debug_module & TDM_DEBUG_THREAD)